HappyStacking.js 2.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814
  1. (function () {
  2. function I(a, b) {
  3. function d() {}
  4. d.prototype = a;
  5. var c = new d,
  6. e;
  7. for (e in b) c[e] = b[e];
  8. b.toString !== Object.prototype.toString && (c.toString = b.toString);
  9. return c
  10. }
  11. function A(a, b) {
  12. if (null == b) return null;
  13. null == b.__id__ && (b.__id__ = va++);
  14. var d;
  15. null == a.hx__closures__ ? a.hx__closures__ = {} : d = a.hx__closures__[b.__id__];
  16. null == d && (d = function () {
  17. return d.method.apply(d.scope, arguments)
  18. }, d.scope = a, d.method = b, a.hx__closures__[b.__id__] = d);
  19. return d
  20. }
  21. var s = {},
  22. N = function () {
  23. return F.Boot.__string_rec(this, "")
  24. },
  25. P = function () {};
  26. s.ApplicationMain = P;
  27. P.__name__ = ["ApplicationMain"];
  28. P.main = function () {
  29. P.completed = 0;
  30. P.loaders = new y.ds.StringMap;
  31. P.urlLoaders = new y.ds.StringMap;
  32. P.total = 0;
  33. k.Lib.get_current().loaderInfo = k.display.LoaderInfo.create(null);
  34. k.Lib.get_stage().frameRate = 45;
  35. k.Lib.get_current().addChild(P.preloader = new ja);
  36. P.preloader.onInit();
  37. P.loadFile("assets/ggg.png");
  38. P.loadFile("assets/FontCourier.png");
  39. P.loadFile("assets/FontGame.png");
  40. P.loadFile("assets/Objects.png");
  41. for (var a = 0, b = y.Resource.listNames(); a < b.length;) {
  42. var d =
  43. b[a];
  44. ++a;
  45. $.startsWith(d, "NME_:bitmap_") && (d = Y.resolveClass($.replace(d.substring(12), "_", ".")), null != d && (P.total++, Y.createInstance(d, [0, 0, !0, 16777215, P.bitmapClass_onComplete])))
  46. }
  47. if (0 != P.total) {
  48. P.loaderStack = [];
  49. for (b = P.loaders.keys(); b.hasNext();) a = b.next(), P.loaderStack.push(a);
  50. P.urlLoaderStack = [];
  51. for (b = P.urlLoaders.keys(); b.hasNext();) a = b.next(), P.urlLoaderStack.push(a);
  52. for (a = 0; 8 > a;) a++, P.nextLoader()
  53. } else P.begin()
  54. };
  55. P.nextLoader = function () {
  56. if (0 != P.loaderStack.length) {
  57. var a = P.loaderStack.shift(),
  58. b = P.loaders.get(a);
  59. b.contentLoaderInfo.addEventListener("complete", P.loader_onComplete);
  60. b.load(new k.net.URLRequest(a))
  61. } else 0 != P.urlLoaderStack.length && (a = P.urlLoaderStack.shift(), b = P.urlLoaders.get(a), b.addEventListener("complete", P.loader_onComplete), b.load(new k.net.URLRequest(a)))
  62. };
  63. P.loadFile = function (a) {
  64. P.loaders.set(a, new k.display.Loader);
  65. P.total++
  66. };
  67. P.loadBinary = function (a) {
  68. var b = new k.net.URLLoader;
  69. b.set_dataFormat(k.net.URLLoaderDataFormat.BINARY);
  70. P.urlLoaders.set(a, b);
  71. P.total++
  72. };
  73. P.loadSound =
  74. function (a) {};
  75. P.begin = function () {
  76. P.preloader.addEventListener("complete", P.preloader_onComplete);
  77. P.preloader.onLoaded()
  78. };
  79. P.bitmapClass_onComplete = function (a) {
  80. P.completed++;
  81. Y.getClass(a).preload = a;
  82. P.completed == P.total && P.begin()
  83. };
  84. P.loader_onComplete = function (a) {
  85. P.completed++;
  86. P.preloader.onUpdate(P.completed, P.total);
  87. P.completed == P.total ? P.begin() : P.nextLoader()
  88. };
  89. P.preloader_onComplete = function (a) {
  90. P.preloader.removeEventListener("complete", P.preloader_onComplete);
  91. k.Lib.get_current().removeChild(P.preloader);
  92. P.preloader = null;
  93. null == W.field(R, "main") ? (a = Y.createInstance(ka, []), F.Boot.__instanceof(a, k.display.DisplayObject) && k.Lib.get_current().addChild(a)) : W.field(R, "main").apply(R, [])
  94. };
  95. var k = {
  96. events: {}
  97. };
  98. k.events.IEventDispatcher = function () {};
  99. s["flash.events.IEventDispatcher"] = k.events.IEventDispatcher;
  100. k.events.IEventDispatcher.__name__ = ["flash", "events", "IEventDispatcher"];
  101. k.events.IEventDispatcher.prototype = {
  102. __class__: k.events.IEventDispatcher
  103. };
  104. k.events.EventDispatcher = function () {
  105. this.eventList = new y.ds.StringMap
  106. };
  107. s["flash.events.EventDispatcher"] = k.events.EventDispatcher;
  108. k.events.EventDispatcher.__name__ = ["flash", "events", "EventDispatcher"];
  109. k.events.EventDispatcher.__interfaces__ = [k.events.IEventDispatcher];
  110. k.events.EventDispatcher.prototype = {
  111. dispatchEvent: function (a) {
  112. null == a.get_target() && a.set_target(this);
  113. var b = a.type;
  114. if (this.eventList.exists(b))
  115. for (var d = 0, b = this.eventList.get(b); d < b.length;) {
  116. var c = b[d];
  117. ++d;
  118. c(a)
  119. }
  120. return !0
  121. },
  122. hasEventListener: function (a) {
  123. return this.eventList.exists(a)
  124. },
  125. removeEventListener: function (a,
  126. b, d, c, e) {
  127. if (this.eventList.exists(a)) {
  128. d = this.eventList.get(a);
  129. for (c = 0; c < d.length;)
  130. if (e = d[c], ++c, W.compareMethods(e, b)) {
  131. S.remove(d, e);
  132. break
  133. }
  134. 0 == d.length && this.eventList.remove(a)
  135. }
  136. },
  137. addEventListener: function (a, b, d, c, e) {
  138. var f;
  139. this.eventList.exists(a) ? f = this.eventList.get(a) : this.eventList.set(a, f = []);
  140. f.push(b)
  141. },
  142. __class__: k.events.EventDispatcher
  143. };
  144. k.events.EventWrapper = function () {
  145. k.events.EventDispatcher.call(this);
  146. this.eventMap = new y.ds.ObjectMap
  147. };
  148. s["flash.events.EventWrapper"] = k.events.EventWrapper;
  149. k.events.EventWrapper.__name__ = ["flash", "events", "EventWrapper"];
  150. k.events.EventWrapper.__super__ = k.events.EventDispatcher;
  151. k.events.EventWrapper.prototype = I(k.events.EventDispatcher.prototype, {
  152. removeEventListener: function (a, b, d, c, e) {
  153. null == e && (e = !1);
  154. null == c && (c = 0);
  155. null == d && (d = !1);
  156. k.events.EventDispatcher.prototype.removeEventListener.call(this, a, b, d, c, e);
  157. this.eventMap.h.hasOwnProperty(b.__id__) && (this.component.removeEventListener(a, this.eventMap.h[b.__id__], d), this.eventMap.remove(b))
  158. },
  159. addEventListener: function (a,
  160. b, d, c, e) {
  161. null == e && (e = !1);
  162. null == c && (c = 0);
  163. null == d && (d = !1);
  164. var f = this;
  165. k.events.EventDispatcher.prototype.addEventListener.call(this, a, b, d, c, e);
  166. c = function (a) {
  167. return function (a) {
  168. a.get_target() == f.component && a.set_target(f);
  169. a.set_currentTarget(f);
  170. b(a)
  171. }
  172. }(this);
  173. this.eventMap.h.hasOwnProperty(b.__id__) || this.eventMap.set(b, c);
  174. this.component.addEventListener(a, c, d)
  175. },
  176. __class__: k.events.EventWrapper
  177. });
  178. k.display = {};
  179. k.display.DisplayObject = function () {
  180. this.rotation = this.x = this.y = 0;
  181. this.alpha = this.scaleX = this.scaleY =
  182. 1;
  183. this.visible = !0;
  184. k.events.EventWrapper.call(this);
  185. this.eventRemap = new y.ds.StringMap;
  186. null == this.component && (this.component = k.Lib.jsDiv());
  187. this.component.node = this;
  188. this.transform = new k.geom.Transform(this)
  189. };
  190. s["flash.display.DisplayObject"] = k.display.DisplayObject;
  191. k.display.DisplayObject.__name__ = ["flash", "display", "DisplayObject"];
  192. k.display.DisplayObject.__super__ = k.events.EventWrapper;
  193. k.display.DisplayObject.prototype = I(k.events.EventWrapper.prototype, {
  194. toString: function () {
  195. return Y.getClassName(Y.getClass(this))
  196. },
  197. addEventListener: function (a, b, d, c, e) {
  198. null == e && (e = !1);
  199. null == c && (c = 0);
  200. null == d && (d = !1);
  201. var f = this;
  202. k.events.EventWrapper.prototype.addEventListener.call(this, a, b, d, c, e);
  203. k.display.DisplayObject.remapTouch.exists(a) && k.events.EventWrapper.prototype.addEventListener.call(this, k.display.DisplayObject.remapTouch.get(a), function (b) {
  204. var d = new k.events.MouseEvent(a, b.bubbles, b.cancelable, 0, 0, f, b.ctrlKey, b.altKey, b.shiftKey, !1);
  205. b = b.targetTouches;
  206. 0 < b.length ? (d.pageX = b[0].pageX, d.pageY = b[0].pageY) : (d.pageX = f.get_stage().mousePos.x,
  207. d.pageY = f.get_stage().mousePos.y);
  208. f.dispatchEvent(d)
  209. }, d, c, e)
  210. },
  211. get_mouseY: function () {
  212. return (k.display.DisplayObject.convPoint = this.globalToLocal(k.Lib.get_current().get_stage().mousePos, k.display.DisplayObject.convPoint)).y
  213. },
  214. get_mouseX: function () {
  215. return (k.display.DisplayObject.convPoint = this.globalToLocal(k.Lib.get_current().get_stage().mousePos, k.display.DisplayObject.convPoint)).x
  216. },
  217. localToGlobal: function (a, b) {
  218. null == b && (b = new k.geom.Point);
  219. var d = k.display.DisplayObject.convMatrix,
  220. c = a.x,
  221. e = a.y;
  222. null ==
  223. d && (d = k.display.DisplayObject.convMatrix = new k.geom.Matrix);
  224. d.identity();
  225. d = this.getGlobalMatrix(d);
  226. b.x = c * d.a + e * d.c + d.tx;
  227. b.y = c * d.b + e * d.d + d.ty;
  228. return b
  229. },
  230. globalToLocal: function (a, b) {
  231. null == b && (b = new k.geom.Point);
  232. var d = k.display.DisplayObject.convMatrix,
  233. c = a.x,
  234. e = a.y;
  235. null == d && (d = k.display.DisplayObject.convMatrix = new k.geom.Matrix);
  236. d.identity();
  237. d = this.getGlobalMatrix(d);
  238. d.invert();
  239. b.x = c * d.a + e * d.c + d.tx;
  240. b.y = c * d.b + e * d.d + d.ty;
  241. return b
  242. },
  243. getGlobalMatrix: function (a) {
  244. null == a && (a = new k.geom.Matrix);
  245. for (var b = this; null !=
  246. b;) 0 == this.x && 0 == this.y || a.translate(this.x, this.y), 1 == this.scaleX && 1 == this.scaleY || a.scale(this.scaleX, this.scaleY), 0 != this.rotation && a.rotate(this.rotation), a.concat(b.transform.get_matrix()), b = b.parent;
  247. return a
  248. },
  249. getBounds: function (a) {
  250. return null
  251. },
  252. set_stage: function (a) {
  253. if (this._stage != a) {
  254. var b = null != this._stage != (null != a);
  255. this._stage = a;
  256. b && this.dispatchEvent(new k.events.Event(null != a ? "addedToStage" : "removedFromStage"))
  257. }
  258. return a
  259. },
  260. get_stage: function () {
  261. return this._stage
  262. },
  263. set_scrollRect: function (a) {
  264. return a
  265. },
  266. set_visible: function (a) {
  267. this.component.style.display = (this.visible = a) ? null : "none";
  268. return a
  269. },
  270. set_alpha: function (a) {
  271. a != this.alpha && (this.component.style.opacity = (this.alpha = a).toFixed(4));
  272. return a
  273. },
  274. set_height: function (a) {
  275. return a
  276. },
  277. set_width: function (a) {
  278. return a
  279. },
  280. get_height: function () {
  281. return this.qHeight || 0
  282. },
  283. get_width: function () {
  284. return this.qWidth || 0
  285. },
  286. set_scaleY: function (a) {
  287. this.scaleY != a && (this.scaleY = a, this.syncMtx());
  288. return a
  289. },
  290. set_scaleX: function (a) {
  291. this.scaleX != a && (this.scaleX = a, this.syncMtx());
  292. return a
  293. },
  294. set_rotation: function (a) {
  295. this.rotation != a && (this.rotation = a, this.syncMtx());
  296. return a
  297. },
  298. set_y: function (a) {
  299. this.y != a && (this.y = a, this.syncMtx());
  300. return a
  301. },
  302. set_x: function (a) {
  303. this.x != a && (this.x = a, this.syncMtx());
  304. return a
  305. },
  306. syncMtx: function () {
  307. var a = this.component.style,
  308. b, d;
  309. !0 != this._syncMtx_set && (this._syncMtx_set = !0, b = "0% 0%", d = "syncMtx-origin", a.setProperty(d, b, null), a.setProperty("-o-" + d, b, null), a.setProperty("-ms-" + d, b, null), a.setProperty("-moz-" + d, b, null), a.setProperty("-webkit-" + d, b, null));
  310. b = "";
  311. if (0 != this.x || 0 != this.y) b += "translate(" + this.x + "px, " + this.y + "px) ";
  312. if (1 != this.scaleX || 1 != this.scaleY) b += "scale(" + this.scaleX + ", " + this.scaleY + ") ";
  313. 0 != this.rotation && (b += "rotate(" + this.rotation + "deg) ");
  314. null != this.transform && (d = this.transform.get_matrix(), null == d || d.isIdentity() || (b += "matrix(" + d.a + ", " + d.b + ", " + d.c + ", " + d.d + ", " + d.tx + ", " + d.ty + ") "));
  315. d = "transform";
  316. a.setProperty(d, b, null);
  317. a.setProperty("-o-" + d, b, null);
  318. a.setProperty("-ms-" + d, b, null);
  319. a.setProperty("-moz-" + d, b, null);
  320. a.setProperty("-webkit-" +
  321. d, b, null)
  322. },
  323. invalidate: function () {},
  324. broadcastEvent: function (a) {
  325. this.dispatchEvent(a)
  326. },
  327. __class__: k.display.DisplayObject
  328. });
  329. k.display.InteractiveObject = function () {
  330. k.display.DisplayObject.call(this);
  331. this.tabEnabled = !1;
  332. this.tabIndex = 0;
  333. this.mouseEnabled = this.doubleClickEnabled = !0
  334. };
  335. s["flash.display.InteractiveObject"] = k.display.InteractiveObject;
  336. k.display.InteractiveObject.__name__ = ["flash", "display", "InteractiveObject"];
  337. k.display.InteractiveObject.__super__ = k.display.DisplayObject;
  338. k.display.InteractiveObject.prototype =
  339. I(k.display.DisplayObject.prototype, {
  340. __class__: k.display.InteractiveObject
  341. });
  342. k.display.DisplayObjectContainer = function () {
  343. k.display.InteractiveObject.call(this);
  344. this.children = []
  345. };
  346. s["flash.display.DisplayObjectContainer"] = k.display.DisplayObjectContainer;
  347. k.display.DisplayObjectContainer.__name__ = ["flash", "display", "DisplayObjectContainer"];
  348. k.display.DisplayObjectContainer.__super__ = k.display.InteractiveObject;
  349. k.display.DisplayObjectContainer.prototype = I(k.display.InteractiveObject.prototype, {
  350. set_stage: function (a) {
  351. k.display.InteractiveObject.prototype.set_stage.call(this,
  352. a);
  353. for (var b = 0, d = this.children; b < d.length;) {
  354. var c = d[b];
  355. ++b;
  356. c.set_stage(a)
  357. }
  358. return a
  359. },
  360. broadcastEvent: function (a) {
  361. this.dispatchEvent(a);
  362. for (var b = 0, d = this.children; b < d.length;) {
  363. var c = d[b];
  364. ++b;
  365. c.broadcastEvent(a)
  366. }
  367. },
  368. contains: function (a) {
  369. for (var b = 0, d = this.children; b < d.length;) {
  370. var c = d[b];
  371. ++b;
  372. if (c == a) return !0
  373. }
  374. return !1
  375. },
  376. getChildIndex: function (a) {
  377. for (var b = -1, d = this.children.length; ++b < d;)
  378. if (this.children[b] == a) return b;
  379. return -1
  380. },
  381. getChildAt: function (a) {
  382. return this.children[a]
  383. },
  384. removeChildAt: function (a) {
  385. return this.removeChild(this.children[a])
  386. },
  387. addChildAt: function (a, b) {
  388. return b < this.children.length ? (null != a.parent && a.parent.removeChild(a), a.parent = this, a.set_stage(this.get_stage()), this.component.insertBefore(a.component, this.children[b].component), this.children.splice(b, 0, a), a) : this.addChild(a)
  389. },
  390. removeChild: function (a) {
  391. a.parent = null;
  392. a.set_stage(null);
  393. S.remove(this.children, a);
  394. this.component.removeChild(a.component);
  395. var b = new k.events.Event("removed");
  396. a.dispatchEvent(b);
  397. this.dispatchEvent(b);
  398. return a
  399. },
  400. addChild: function (a) {
  401. null != a.parent &&
  402. a.parent.removeChild(a);
  403. a.parent = this;
  404. a.set_stage(this.get_stage());
  405. this.children.push(a);
  406. this.component.appendChild(a.component);
  407. var b = new k.events.Event("added");
  408. a.dispatchEvent(b);
  409. this.dispatchEvent(b);
  410. return a
  411. },
  412. __class__: k.display.DisplayObjectContainer
  413. });
  414. k.display.IBitmapDrawable = function () {};
  415. s["flash.display.IBitmapDrawable"] = k.display.IBitmapDrawable;
  416. k.display.IBitmapDrawable.__name__ = ["flash", "display", "IBitmapDrawable"];
  417. k.display.IBitmapDrawable.prototype = {
  418. __class__: k.display.IBitmapDrawable
  419. };
  420. k.display.Sprite = function () {
  421. k.display.DisplayObjectContainer.call(this)
  422. };
  423. s["flash.display.Sprite"] = k.display.Sprite;
  424. k.display.Sprite.__name__ = ["flash", "display", "Sprite"];
  425. k.display.Sprite.__interfaces__ = [k.display.IBitmapDrawable];
  426. k.display.Sprite.__super__ = k.display.DisplayObjectContainer;
  427. k.display.Sprite.prototype = I(k.display.DisplayObjectContainer.prototype, {
  428. drawToSurface: function (a, b, d, c, e, f, l) {
  429. this.get_graphics().drawToSurface(a, b, d, c, e, f, l)
  430. },
  431. set_useHandCursor: function (a) {
  432. this.component.style.cursor =
  433. a ? "pointer" : null;
  434. return this.useHandCursor = a
  435. },
  436. set_stage: function (a) {
  437. var b = null == this.get_stage() && null != a;
  438. a = k.display.DisplayObjectContainer.prototype.set_stage.call(this, a);
  439. b && null != this._graphics && this._graphics.invalidate();
  440. return a
  441. },
  442. get_graphics: function () {
  443. if (null == this._graphics) {
  444. var a = new k.display.Graphics,
  445. b = a.component;
  446. a.set_displayObject(this);
  447. 0 == this.children.length ? this.component.appendChild(b) : this.component.insertBefore(b, this.children[0].component);
  448. this._graphics = a
  449. }
  450. return this._graphics
  451. },
  452. __class__: k.display.Sprite
  453. });
  454. var R = function () {
  455. this.oldFrames = 0;
  456. this.initted = !1;
  457. this.frameCount = 0;
  458. k.display.Sprite.call(this);
  459. this.ScreenBMD = new k.display.BitmapData(R.WIDTH, R.HEIGHT, !0, 0);
  460. this.ScreenBitmap = new k.display.Bitmap(this.ScreenBMD, k.display.PixelSnapping.AUTO, !0);
  461. this.addChild(this.ScreenBitmap);
  462. R.RESIZE_WIDTH = R.WIDTH;
  463. R.RESIZE_HEIGHT = R.HEIGHT;
  464. R.instance = this;
  465. T.Init();
  466. q.OzSprite.StaticInit();
  467. q.OzMatrix.InitPool();
  468. E.Register();
  469. G.Register();
  470. n.Register();
  471. q.OzUtil.SortIdsByName(q.OzSprite.BitmapsIds,
  472. q.OzSprite.BitmapsNames);
  473. k.Lib.get_current().get_stage().addEventListener("resize", A(this, this.onResize));
  474. k.Lib.get_current().get_stage().addEventListener("enterFrame", A(this, this.update));
  475. D.init(this);
  476. this.doc = new q.OzSprite;
  477. this.stateSprite = new q.OzSprite;
  478. this.debugSprite = new q.OzSprite;
  479. this.doc.addChild(this.stateSprite);
  480. this.doc.addChild(this.debugSprite);
  481. this.debugText = new q.OzSprite(null, q.SpriteType.TEXT);
  482. this.debugText.font = G.Font;
  483. this.debugText.text = "Hello, guys!";
  484. this.debugSprite.addChild(this.debugText);
  485. this.debugSprite.visible = !1;
  486. this.s = new M.StateGGG(this);
  487. (new y.Timer(1E3)).run = A(this, this.measureFPS)
  488. };
  489. s.Main = R;
  490. R.__name__ = ["Main"];
  491. R.__super__ = k.display.Sprite;
  492. R.prototype = I(k.display.Sprite.prototype, {
  493. measureFPS: function () {
  494. this.debugText.text = "" + (this.frameCount - this.oldFrames) + ":" + q.OzSprite.TilesheetBitmapDatas[E.cmcYouLoseText.tilesheetId][E.cmcYouLoseText.frames[0]].component.width;
  495. this.oldFrames = this.frameCount
  496. },
  497. draw: function (a) {
  498. q.OzSprite.TilesheetId = -1;
  499. this.doc.draw();
  500. q.OzSprite.Flush()
  501. },
  502. changeState: function (a) {
  503. null != this.s && this.s.destroy();
  504. this.s = a;
  505. this.s.update()
  506. },
  507. update: function (a) {
  508. this.frameCount++;
  509. a = 1 == this.frameCount;
  510. !a && Z.PlatformHTML5.invalidRect() && (a = !0);
  511. if (a) this.onResize();
  512. this.s.update();
  513. this.draw();
  514. },
  515. onResize: function (a) {
  516. Z.PlatformHTML5.resize()
  517. },
  518. __class__: R
  519. });
  520. var ka = function () {
  521. R.call(this)
  522. };
  523. s.DocumentClass = ka;
  524. ka.__name__ = ["DocumentClass"];
  525. ka.__super__ = R;
  526. ka.prototype = I(R.prototype, {
  527. get_stage: function () {
  528. return k.Lib.get_current().get_stage()
  529. },
  530. __class__: ka
  531. });
  532. var G = function () {};
  533. s.FontCourier = G;
  534. G.__name__ = ["FontCourier"];
  535. G.Register = function () {
  536. G.Font = new q.OzFont;
  537. G.Font.face = "Courier";
  538. G.Font.size = 12;
  539. G.Font.padding = [0, 0, 0, 0];
  540. G.Font.spacing = [2, 2];
  541. G.Font.lineHeight = 14;
  542. G.Font.base = 9;
  543. G.Font.numPages = 1;
  544. G.Font.bitmapName = "FontCourier.png";
  545. G.Font.numChars = 95;
  546. G.Font.chars[32] = {
  547. id: 32,
  548. x: 110,
  549. y: 70,
  550. width: 0,
  551. height: 0,
  552. xOffset: 0,
  553. yOffset: 11,
  554. xAdvance: 7,
  555. page: 0,
  556. letter: " ",
  557. movieClip: null
  558. };
  559. G.Font.chars[33] = {
  560. id: 33,
  561. x: 34,
  562. y: 40,
  563. width: 4,
  564. height: 9,
  565. xOffset: 3,
  566. yOffset: 2,
  567. xAdvance: 7,
  568. page: 0,
  569. letter: "!",
  570. movieClip: null
  571. };
  572. G.Font.chars[34] = {
  573. id: 34,
  574. x: 56,
  575. y: 70,
  576. width: 5,
  577. height: 4,
  578. xOffset: 2,
  579. yOffset: 2,
  580. xAdvance: 7,
  581. page: 0,
  582. letter: '"',
  583. movieClip: null
  584. };
  585. G.Font.chars[35] = {
  586. id: 35,
  587. x: 76,
  588. y: 2,
  589. width: 9,
  590. height: 10,
  591. xOffset: 0,
  592. yOffset: 1,
  593. xAdvance: 7,
  594. page: 0,
  595. letter: "#",
  596. movieClip: null
  597. };
  598. G.Font.chars[36] = {
  599. id: 36,
  600. x: 14,
  601. y: 2,
  602. width: 6,
  603. height: 11,
  604. xOffset: 1,
  605. yOffset: 1,
  606. xAdvance: 7,
  607. page: 0,
  608. letter: "$",
  609. movieClip: null
  610. };
  611. G.Font.chars[37] = {
  612. id: 37,
  613. x: 2,
  614. y: 40,
  615. width: 6,
  616. height: 9,
  617. xOffset: 1,
  618. yOffset: 2,
  619. xAdvance: 7,
  620. page: 0,
  621. letter: "%",
  622. movieClip: null
  623. };
  624. G.Font.chars[38] = {
  625. id: 38,
  626. x: 106,
  627. y: 51,
  628. width: 6,
  629. height: 8,
  630. xOffset: 1,
  631. yOffset: 3,
  632. xAdvance: 7,
  633. page: 0,
  634. letter: "&",
  635. movieClip: null
  636. };
  637. G.Font.chars[39] = {
  638. id: 39,
  639. x: 69,
  640. y: 70,
  641. width: 3,
  642. height: 4,
  643. xOffset: 3,
  644. yOffset: 2,
  645. xAdvance: 7,
  646. page: 0,
  647. letter: "'",
  648. movieClip: null
  649. };
  650. G.Font.chars[40] = {
  651. id: 40,
  652. x: 58,
  653. y: 2,
  654. width: 4,
  655. height: 11,
  656. xOffset: 2,
  657. yOffset: 2,
  658. xAdvance: 7,
  659. page: 0,
  660. letter: "(",
  661. movieClip: null
  662. };
  663. G.Font.chars[41] = {
  664. id: 41,
  665. x: 52,
  666. y: 2,
  667. width: 4,
  668. height: 11,
  669. xOffset: 2,
  670. yOffset: 2,
  671. xAdvance: 7,
  672. page: 0,
  673. letter: ")",
  674. movieClip: null
  675. };
  676. G.Font.chars[42] = {
  677. id: 42,
  678. x: 25,
  679. y: 70,
  680. width: 6,
  681. height: 6,
  682. xOffset: 1,
  683. yOffset: 3,
  684. xAdvance: 7,
  685. page: 0,
  686. letter: "*",
  687. movieClip: null
  688. };
  689. G.Font.chars[43] = {
  690. id: 43,
  691. x: 62,
  692. y: 51,
  693. width: 8,
  694. height: 8,
  695. xOffset: 1,
  696. yOffset: 2,
  697. xAdvance: 7,
  698. page: 0,
  699. letter: "+",
  700. movieClip: null
  701. };
  702. G.Font.chars[44] = {
  703. id: 44,
  704. x: 33,
  705. y: 70,
  706. width: 4,
  707. height: 5,
  708. xOffset: 2,
  709. yOffset: 8,
  710. xAdvance: 7,
  711. page: 0,
  712. letter: ",",
  713. movieClip: null
  714. };
  715. G.Font.chars[45] = {
  716. id: 45,
  717. x: 83,
  718. y: 70,
  719. width: 7,
  720. height: 3,
  721. xOffset: 1,
  722. yOffset: 6,
  723. xAdvance: 7,
  724. page: 0,
  725. letter: "-",
  726. movieClip: null
  727. };
  728. G.Font.chars[46] = {
  729. id: 46,
  730. x: 63,
  731. y: 70,
  732. width: 4,
  733. height: 4,
  734. xOffset: 2,
  735. yOffset: 7,
  736. xAdvance: 7,
  737. page: 0,
  738. letter: ".",
  739. movieClip: null
  740. };
  741. G.Font.chars[47] = {
  742. id: 47,
  743. x: 22,
  744. y: 2,
  745. width: 6,
  746. height: 11,
  747. xOffset: 1,
  748. yOffset: 1,
  749. xAdvance: 7,
  750. page: 0,
  751. letter: "/",
  752. movieClip: null
  753. };
  754. G.Font.chars[48] = {
  755. id: 48,
  756. x: 75,
  757. y: 29,
  758. width: 6,
  759. height: 9,
  760. xOffset: 1,
  761. yOffset: 2,
  762. xAdvance: 7,
  763. page: 0,
  764. letter: "0",
  765. movieClip: null
  766. };
  767. G.Font.chars[49] = {
  768. id: 49,
  769. x: 18,
  770. y: 40,
  771. width: 6,
  772. height: 9,
  773. xOffset: 2,
  774. yOffset: 2,
  775. xAdvance: 7,
  776. page: 0,
  777. letter: "1",
  778. movieClip: null
  779. };
  780. G.Font.chars[50] = {
  781. id: 50,
  782. x: 107,
  783. y: 29,
  784. width: 6,
  785. height: 9,
  786. xOffset: 1,
  787. yOffset: 2,
  788. xAdvance: 7,
  789. page: 0,
  790. letter: "2",
  791. movieClip: null
  792. };
  793. G.Font.chars[51] = {
  794. id: 51,
  795. x: 67,
  796. y: 29,
  797. width: 6,
  798. height: 9,
  799. xOffset: 1,
  800. yOffset: 2,
  801. xAdvance: 7,
  802. page: 0,
  803. letter: "3",
  804. movieClip: null
  805. };
  806. G.Font.chars[52] = {
  807. id: 52,
  808. x: 115,
  809. y: 29,
  810. width: 6,
  811. height: 9,
  812. xOffset: 1,
  813. yOffset: 2,
  814. xAdvance: 7,
  815. page: 0,
  816. letter: "4",
  817. movieClip: null
  818. };
  819. G.Font.chars[53] = {
  820. id: 53,
  821. x: 58,
  822. y: 29,
  823. width: 7,
  824. height: 9,
  825. xOffset: 1,
  826. yOffset: 2,
  827. xAdvance: 7,
  828. page: 0,
  829. letter: "5",
  830. movieClip: null
  831. };
  832. G.Font.chars[54] = {
  833. id: 54,
  834. x: 83,
  835. y: 29,
  836. width: 6,
  837. height: 9,
  838. xOffset: 1,
  839. yOffset: 2,
  840. xAdvance: 7,
  841. page: 0,
  842. letter: "6",
  843. movieClip: null
  844. };
  845. G.Font.chars[55] = {
  846. id: 55,
  847. x: 10,
  848. y: 40,
  849. width: 6,
  850. height: 9,
  851. xOffset: 1,
  852. yOffset: 2,
  853. xAdvance: 7,
  854. page: 0,
  855. letter: "7",
  856. movieClip: null
  857. };
  858. G.Font.chars[56] = {
  859. id: 56,
  860. x: 99,
  861. y: 29,
  862. width: 6,
  863. height: 9,
  864. xOffset: 1,
  865. yOffset: 2,
  866. xAdvance: 7,
  867. page: 0,
  868. letter: "8",
  869. movieClip: null
  870. };
  871. G.Font.chars[57] = {
  872. id: 57,
  873. x: 91,
  874. y: 29,
  875. width: 6,
  876. height: 9,
  877. xOffset: 1,
  878. yOffset: 2,
  879. xAdvance: 7,
  880. page: 0,
  881. letter: "9",
  882. movieClip: null
  883. };
  884. G.Font.chars[58] = {
  885. id: 58,
  886. x: 19,
  887. y: 70,
  888. width: 4,
  889. height: 7,
  890. xOffset: 2,
  891. yOffset: 4,
  892. xAdvance: 7,
  893. page: 0,
  894. letter: ":",
  895. movieClip: null
  896. };
  897. G.Font.chars[59] = {
  898. id: 59,
  899. x: 40,
  900. y: 40,
  901. width: 4,
  902. height: 9,
  903. xOffset: 2,
  904. yOffset: 4,
  905. xAdvance: 7,
  906. page: 0,
  907. letter: ";",
  908. movieClip: null
  909. };
  910. G.Font.chars[60] = {
  911. id: 60,
  912. x: 33,
  913. y: 61,
  914. width: 8,
  915. height: 7,
  916. xOffset: 0,
  917. yOffset: 3,
  918. xAdvance: 7,
  919. page: 0,
  920. letter: "<",
  921. movieClip: null
  922. };
  923. G.Font.chars[61] = {
  924. id: 61,
  925. x: 39,
  926. y: 70,
  927. width: 7,
  928. height: 4,
  929. xOffset: 1,
  930. yOffset: 5,
  931. xAdvance: 7,
  932. page: 0,
  933. letter: "=",
  934. movieClip: null
  935. };
  936. G.Font.chars[62] = {
  937. id: 62,
  938. x: 43,
  939. y: 61,
  940. width: 8,
  941. height: 7,
  942. xOffset: 0,
  943. yOffset: 3,
  944. xAdvance: 7,
  945. page: 0,
  946. letter: ">",
  947. movieClip: null
  948. };
  949. G.Font.chars[63] = {
  950. id: 63,
  951. x: 26,
  952. y: 40,
  953. width: 6,
  954. height: 9,
  955. xOffset: 1,
  956. yOffset: 2,
  957. xAdvance: 7,
  958. page: 0,
  959. letter: "?",
  960. movieClip: null
  961. };
  962. G.Font.chars[64] = {
  963. id: 64,
  964. x: 106,
  965. y: 2,
  966. width: 6,
  967. height: 10,
  968. xOffset: 1,
  969. yOffset: 2,
  970. xAdvance: 7,
  971. page: 0,
  972. letter: "@",
  973. movieClip: null
  974. };
  975. G.Font.chars[65] = {
  976. id: 65,
  977. x: 46,
  978. y: 40,
  979. width: 9,
  980. height: 8,
  981. xOffset: 0,
  982. yOffset: 3,
  983. xAdvance: 7,
  984. page: 0,
  985. letter: "A",
  986. movieClip: null
  987. };
  988. G.Font.chars[66] = {
  989. id: 66,
  990. x: 12,
  991. y: 51,
  992. width: 8,
  993. height: 8,
  994. xOffset: 0,
  995. yOffset: 3,
  996. xAdvance: 7,
  997. page: 0,
  998. letter: "B",
  999. movieClip: null
  1000. };
  1001. G.Font.chars[67] = {
  1002. id: 67,
  1003. x: 112,
  1004. y: 18,
  1005. width: 8,
  1006. height: 9,
  1007. xOffset: 0,
  1008. yOffset: 2,
  1009. xAdvance: 7,
  1010. page: 0,
  1011. letter: "C",
  1012. movieClip: null
  1013. };
  1014. G.Font.chars[68] = {
  1015. id: 68,
  1016. x: 32,
  1017. y: 51,
  1018. width: 8,
  1019. height: 8,
  1020. xOffset: 1,
  1021. yOffset: 3,
  1022. xAdvance: 7,
  1023. page: 0,
  1024. letter: "D",
  1025. movieClip: null
  1026. };
  1027. G.Font.chars[69] = {
  1028. id: 69,
  1029. x: 81,
  1030. y: 51,
  1031. width: 7,
  1032. height: 8,
  1033. xOffset: 0,
  1034. yOffset: 3,
  1035. xAdvance: 7,
  1036. page: 0,
  1037. letter: "E",
  1038. movieClip: null
  1039. };
  1040. G.Font.chars[70] = {
  1041. id: 70,
  1042. x: 72,
  1043. y: 51,
  1044. width: 7,
  1045. height: 8,
  1046. xOffset: 1,
  1047. yOffset: 3,
  1048. xAdvance: 7,
  1049. page: 0,
  1050. letter: "F",
  1051. movieClip: null
  1052. };
  1053. G.Font.chars[71] = {
  1054. id: 71,
  1055. x: 72,
  1056. y: 18,
  1057. width: 8,
  1058. height: 9,
  1059. xOffset: 0,
  1060. yOffset: 2,
  1061. xAdvance: 7,
  1062. page: 0,
  1063. letter: "G",
  1064. movieClip: null
  1065. };
  1066. G.Font.chars[72] = {
  1067. id: 72,
  1068. x: 42,
  1069. y: 51,
  1070. width: 8,
  1071. height: 8,
  1072. xOffset: 1,
  1073. yOffset: 3,
  1074. xAdvance: 7,
  1075. page: 0,
  1076. letter: "H",
  1077. movieClip: null
  1078. };
  1079. G.Font.chars[73] = {
  1080. id: 73,
  1081. x: 90,
  1082. y: 51,
  1083. width: 6,
  1084. height: 8,
  1085. xOffset: 1,
  1086. yOffset: 3,
  1087. xAdvance: 7,
  1088. page: 0,
  1089. letter: "I",
  1090. movieClip: null
  1091. };
  1092. G.Font.chars[74] = {
  1093. id: 74,
  1094. x: 2,
  1095. y: 29,
  1096. width: 8,
  1097. height: 9,
  1098. xOffset: 1,
  1099. yOffset: 2,
  1100. xAdvance: 7,
  1101. page: 0,
  1102. letter: "J",
  1103. movieClip: null
  1104. };
  1105. G.Font.chars[75] = {
  1106. id: 75,
  1107. x: 89,
  1108. y: 40,
  1109. width: 8,
  1110. height: 8,
  1111. xOffset: 0,
  1112. yOffset: 3,
  1113. xAdvance: 7,
  1114. page: 0,
  1115. letter: "K",
  1116. movieClip: null
  1117. };
  1118. G.Font.chars[76] = {
  1119. id: 76,
  1120. x: 99,
  1121. y: 40,
  1122. width: 8,
  1123. height: 8,
  1124. xOffset: 0,
  1125. yOffset: 3,
  1126. xAdvance: 7,
  1127. page: 0,
  1128. letter: "L",
  1129. movieClip: null
  1130. };
  1131. G.Font.chars[77] = {
  1132. id: 77,
  1133. x: 68,
  1134. y: 40,
  1135. width: 9,
  1136. height: 8,
  1137. xOffset: 0,
  1138. yOffset: 3,
  1139. xAdvance: 7,
  1140. page: 0,
  1141. letter: "M",
  1142. movieClip: null
  1143. };
  1144. G.Font.chars[78] = {
  1145. id: 78,
  1146. x: 82,
  1147. y: 18,
  1148. width: 8,
  1149. height: 9,
  1150. xOffset: 0,
  1151. yOffset: 2,
  1152. xAdvance: 7,
  1153. page: 0,
  1154. letter: "N",
  1155. movieClip: null
  1156. };
  1157. G.Font.chars[79] = {
  1158. id: 79,
  1159. x: 102,
  1160. y: 18,
  1161. width: 8,
  1162. height: 9,
  1163. xOffset: 0,
  1164. yOffset: 2,
  1165. xAdvance: 7,
  1166. page: 0,
  1167. letter: "O",
  1168. movieClip: null
  1169. };
  1170. G.Font.chars[80] = {
  1171. id: 80,
  1172. x: 52,
  1173. y: 51,
  1174. width: 8,
  1175. height: 8,
  1176. xOffset: 1,
  1177. yOffset: 3,
  1178. xAdvance: 7,
  1179. page: 0,
  1180. letter: "P",
  1181. movieClip: null
  1182. };
  1183. G.Font.chars[81] = {
  1184. id: 81,
  1185. x: 87,
  1186. y: 2,
  1187. width: 8,
  1188. height: 10,
  1189. xOffset: 0,
  1190. yOffset: 3,
  1191. xAdvance: 7,
  1192. page: 0,
  1193. letter: "Q",
  1194. movieClip: null
  1195. };
  1196. G.Font.chars[82] = {
  1197. id: 82,
  1198. x: 79,
  1199. y: 40,
  1200. width: 8,
  1201. height: 8,
  1202. xOffset: 0,
  1203. yOffset: 3,
  1204. xAdvance: 7,
  1205. page: 0,
  1206. letter: "R",
  1207. movieClip: null
  1208. };
  1209. G.Font.chars[83] = {
  1210. id: 83,
  1211. x: 49,
  1212. y: 29,
  1213. width: 7,
  1214. height: 9,
  1215. xOffset: 1,
  1216. yOffset: 2,
  1217. xAdvance: 7,
  1218. page: 0,
  1219. letter: "S",
  1220. movieClip: null
  1221. };
  1222. G.Font.chars[84] = {
  1223. id: 84,
  1224. x: 22,
  1225. y: 51,
  1226. width: 8,
  1227. height: 8,
  1228. xOffset: 1,
  1229. yOffset: 3,
  1230. xAdvance: 7,
  1231. page: 0,
  1232. letter: "T",
  1233. movieClip: null
  1234. };
  1235. G.Font.chars[85] = {
  1236. id: 85,
  1237. x: 92,
  1238. y: 18,
  1239. width: 8,
  1240. height: 9,
  1241. xOffset: 0,
  1242. yOffset: 2,
  1243. xAdvance: 7,
  1244. page: 0,
  1245. letter: "U",
  1246. movieClip: null
  1247. };
  1248. G.Font.chars[86] = {
  1249. id: 86,
  1250. x: 114,
  1251. y: 2,
  1252. width: 9,
  1253. height: 9,
  1254. xOffset: 0,
  1255. yOffset: 2,
  1256. xAdvance: 7,
  1257. page: 0,
  1258. letter: "V",
  1259. movieClip: null
  1260. };
  1261. G.Font.chars[87] = {
  1262. id: 87,
  1263. x: 57,
  1264. y: 40,
  1265. width: 9,
  1266. height: 8,
  1267. xOffset: 0,
  1268. yOffset: 3,
  1269. xAdvance: 7,
  1270. page: 0,
  1271. letter: "W",
  1272. movieClip: null
  1273. };
  1274. G.Font.chars[88] = {
  1275. id: 88,
  1276. x: 2,
  1277. y: 51,
  1278. width: 8,
  1279. height: 8,
  1280. xOffset: 1,
  1281. yOffset: 3,
  1282. xAdvance: 7,
  1283. page: 0,
  1284. letter: "X",
  1285. movieClip: null
  1286. };
  1287. G.Font.chars[89] = {
  1288. id: 89,
  1289. x: 109,
  1290. y: 40,
  1291. width: 8,
  1292. height: 8,
  1293. xOffset: 0,
  1294. yOffset: 3,
  1295. xAdvance: 7,
  1296. page: 0,
  1297. letter: "Y",
  1298. movieClip: null
  1299. };
  1300. G.Font.chars[90] = {
  1301. id: 90,
  1302. x: 98,
  1303. y: 51,
  1304. width: 6,
  1305. height: 8,
  1306. xOffset: 1,
  1307. yOffset: 3,
  1308. xAdvance: 7,
  1309. page: 0,
  1310. letter: "Z",
  1311. movieClip: null
  1312. };
  1313. G.Font.chars[91] = {
  1314. id: 91,
  1315. x: 64,
  1316. y: 2,
  1317. width: 4,
  1318. height: 11,
  1319. xOffset: 2,
  1320. yOffset: 2,
  1321. xAdvance: 7,
  1322. page: 0,
  1323. letter: "[",
  1324. movieClip: null
  1325. };
  1326. G.Font.chars[92] = {
  1327. id: 92,
  1328. x: 30,
  1329. y: 2,
  1330. width: 6,
  1331. height: 11,
  1332. xOffset: 1,
  1333. yOffset: 1,
  1334. xAdvance: 7,
  1335. page: 0,
  1336. letter: "\\",
  1337. movieClip: null
  1338. };
  1339. G.Font.chars[93] = {
  1340. id: 93,
  1341. x: 70,
  1342. y: 2,
  1343. width: 4,
  1344. height: 11,
  1345. xOffset: 2,
  1346. yOffset: 2,
  1347. xAdvance: 7,
  1348. page: 0,
  1349. letter: "]",
  1350. movieClip: null
  1351. };
  1352. G.Font.chars[94] = {
  1353. id: 94,
  1354. x: 48,
  1355. y: 70,
  1356. width: 6,
  1357. height: 4,
  1358. xOffset: 2,
  1359. yOffset: 2,
  1360. xAdvance: 7,
  1361. page: 0,
  1362. letter: "^",
  1363. movieClip: null
  1364. };
  1365. G.Font.chars[95] = {
  1366. id: 95,
  1367. x: 99,
  1368. y: 70,
  1369. width: 9,
  1370. height: 2,
  1371. xOffset: 0,
  1372. yOffset: 12,
  1373. xAdvance: 7,
  1374. page: 0,
  1375. letter: "_",
  1376. movieClip: null
  1377. };
  1378. G.Font.chars[96] = {
  1379. id: 96,
  1380. x: 92,
  1381. y: 70,
  1382. width: 5,
  1383. height: 3,
  1384. xOffset: 1,
  1385. yOffset: 2,
  1386. xAdvance: 7,
  1387. page: 0,
  1388. letter: "`",
  1389. movieClip: null
  1390. };
  1391. G.Font.chars[97] = {
  1392. id: 97,
  1393. x: 93,
  1394. y: 61,
  1395. width: 7,
  1396. height: 7,
  1397. xOffset: 1,
  1398. yOffset: 4,
  1399. xAdvance: 7,
  1400. page: 0,
  1401. letter: "a",
  1402. movieClip: null
  1403. };
  1404. G.Font.chars[98] = {
  1405. id: 98,
  1406. x: 22,
  1407. y: 18,
  1408. width: 8,
  1409. height: 9,
  1410. xOffset: 0,
  1411. yOffset: 2,
  1412. xAdvance: 7,
  1413. page: 0,
  1414. letter: "b",
  1415. movieClip: null
  1416. };
  1417. G.Font.chars[99] = {
  1418. id: 99,
  1419. x: 111,
  1420. y: 61,
  1421. width: 7,
  1422. height: 7,
  1423. xOffset: 1,
  1424. yOffset: 4,
  1425. xAdvance: 7,
  1426. page: 0,
  1427. letter: "c",
  1428. movieClip: null
  1429. };
  1430. G.Font.chars[100] = {
  1431. id: 100,
  1432. x: 12,
  1433. y: 18,
  1434. width: 8,
  1435. height: 9,
  1436. xOffset: 1,
  1437. yOffset: 2,
  1438. xAdvance: 7,
  1439. page: 0,
  1440. letter: "d",
  1441. movieClip: null
  1442. };
  1443. G.Font.chars[101] = {
  1444. id: 101,
  1445. x: 102,
  1446. y: 61,
  1447. width: 7,
  1448. height: 7,
  1449. xOffset: 1,
  1450. yOffset: 4,
  1451. xAdvance: 7,
  1452. page: 0,
  1453. letter: "e",
  1454. movieClip: null
  1455. };
  1456. G.Font.chars[102] = {
  1457. id: 102,
  1458. x: 31,
  1459. y: 29,
  1460. width: 7,
  1461. height: 9,
  1462. xOffset: 1,
  1463. yOffset: 2,
  1464. xAdvance: 7,
  1465. page: 0,
  1466. letter: "f",
  1467. movieClip: null
  1468. };
  1469. G.Font.chars[103] = {
  1470. id: 103,
  1471. x: 22,
  1472. y: 29,
  1473. width: 7,
  1474. height: 9,
  1475. xOffset: 1,
  1476. yOffset: 4,
  1477. xAdvance: 7,
  1478. page: 0,
  1479. letter: "g",
  1480. movieClip: null
  1481. };
  1482. G.Font.chars[104] = {
  1483. id: 104,
  1484. x: 62,
  1485. y: 18,
  1486. width: 8,
  1487. height: 9,
  1488. xOffset: 1,
  1489. yOffset: 2,
  1490. xAdvance: 7,
  1491. page: 0,
  1492. letter: "h",
  1493. movieClip: null
  1494. };
  1495. G.Font.chars[105] = {
  1496. id: 105,
  1497. x: 97,
  1498. y: 2,
  1499. width: 7,
  1500. height: 10,
  1501. xOffset: 1,
  1502. yOffset: 1,
  1503. xAdvance: 7,
  1504. page: 0,
  1505. letter: "i",
  1506. movieClip: null
  1507. };
  1508. G.Font.chars[106] = {
  1509. id: 106,
  1510. x: 6,
  1511. y: 2,
  1512. width: 6,
  1513. height: 12,
  1514. xOffset: 1,
  1515. yOffset: 1,
  1516. xAdvance: 7,
  1517. page: 0,
  1518. letter: "j",
  1519. movieClip: null
  1520. };
  1521. G.Font.chars[107] = {
  1522. id: 107,
  1523. x: 52,
  1524. y: 18,
  1525. width: 8,
  1526. height: 9,
  1527. xOffset: 1,
  1528. yOffset: 2,
  1529. xAdvance: 7,
  1530. page: 0,
  1531. letter: "k",
  1532. movieClip: null
  1533. };
  1534. G.Font.chars[108] = {
  1535. id: 108,
  1536. x: 40,
  1537. y: 29,
  1538. width: 7,
  1539. height: 9,
  1540. xOffset: 1,
  1541. yOffset: 2,
  1542. xAdvance: 7,
  1543. page: 0,
  1544. letter: "l",
  1545. movieClip: null
  1546. };
  1547. G.Font.chars[109] = {
  1548. id: 109,
  1549. x: 2,
  1550. y: 61,
  1551. width: 9,
  1552. height: 7,
  1553. xOffset: 0,
  1554. yOffset: 4,
  1555. xAdvance: 7,
  1556. page: 0,
  1557. letter: "m",
  1558. movieClip: null
  1559. };
  1560. G.Font.chars[110] = {
  1561. id: 110,
  1562. x: 53,
  1563. y: 61,
  1564. width: 8,
  1565. height: 7,
  1566. xOffset: 1,
  1567. yOffset: 4,
  1568. xAdvance: 7,
  1569. page: 0,
  1570. letter: "n",
  1571. movieClip: null
  1572. };
  1573. G.Font.chars[111] = {
  1574. id: 111,
  1575. x: 23,
  1576. y: 61,
  1577. width: 8,
  1578. height: 7,
  1579. xOffset: 1,
  1580. yOffset: 4,
  1581. xAdvance: 7,
  1582. page: 0,
  1583. letter: "o",
  1584. movieClip: null
  1585. };
  1586. G.Font.chars[112] = {
  1587. id: 112,
  1588. x: 32,
  1589. y: 18,
  1590. width: 8,
  1591. height: 9,
  1592. xOffset: 0,
  1593. yOffset: 4,
  1594. xAdvance: 7,
  1595. page: 0,
  1596. letter: "p",
  1597. movieClip: null
  1598. };
  1599. G.Font.chars[113] = {
  1600. id: 113,
  1601. x: 42,
  1602. y: 18,
  1603. width: 8,
  1604. height: 9,
  1605. xOffset: 0,
  1606. yOffset: 4,
  1607. xAdvance: 7,
  1608. page: 0,
  1609. letter: "q",
  1610. movieClip: null
  1611. };
  1612. G.Font.chars[114] = {
  1613. id: 114,
  1614. x: 63,
  1615. y: 61,
  1616. width: 8,
  1617. height: 7,
  1618. xOffset: 1,
  1619. yOffset: 4,
  1620. xAdvance: 7,
  1621. page: 0,
  1622. letter: "r",
  1623. movieClip: null
  1624. };
  1625. G.Font.chars[115] = {
  1626. id: 115,
  1627. x: 2,
  1628. y: 70,
  1629. width: 7,
  1630. height: 7,
  1631. xOffset: 1,
  1632. yOffset: 4,
  1633. xAdvance: 7,
  1634. page: 0,
  1635. letter: "s",
  1636. movieClip: null
  1637. };
  1638. G.Font.chars[116] = {
  1639. id: 116,
  1640. x: 12,
  1641. y: 29,
  1642. width: 8,
  1643. height: 9,
  1644. xOffset: 1,
  1645. yOffset: 2,
  1646. xAdvance: 7,
  1647. page: 0,
  1648. letter: "t",
  1649. movieClip: null
  1650. };
  1651. G.Font.chars[117] = {
  1652. id: 117,
  1653. x: 73,
  1654. y: 61,
  1655. width: 8,
  1656. height: 7,
  1657. xOffset: 0,
  1658. yOffset: 4,
  1659. xAdvance: 7,
  1660. page: 0,
  1661. letter: "u",
  1662. movieClip: null
  1663. };
  1664. G.Font.chars[118] = {
  1665. id: 118,
  1666. x: 13,
  1667. y: 61,
  1668. width: 8,
  1669. height: 7,
  1670. xOffset: 0,
  1671. yOffset: 4,
  1672. xAdvance: 7,
  1673. page: 0,
  1674. letter: "v",
  1675. movieClip: null
  1676. };
  1677. G.Font.chars[119] = {
  1678. id: 119,
  1679. x: 114,
  1680. y: 51,
  1681. width: 9,
  1682. height: 7,
  1683. xOffset: 0,
  1684. yOffset: 4,
  1685. xAdvance: 7,
  1686. page: 0,
  1687. letter: "w",
  1688. movieClip: null
  1689. };
  1690. G.Font.chars[120] = {
  1691. id: 120,
  1692. x: 83,
  1693. y: 61,
  1694. width: 8,
  1695. height: 7,
  1696. xOffset: 0,
  1697. yOffset: 4,
  1698. xAdvance: 7,
  1699. page: 0,
  1700. letter: "x",
  1701. movieClip: null
  1702. };
  1703. G.Font.chars[121] = {
  1704. id: 121,
  1705. x: 2,
  1706. y: 18,
  1707. width: 8,
  1708. height: 9,
  1709. xOffset: 0,
  1710. yOffset: 4,
  1711. xAdvance: 7,
  1712. page: 0,
  1713. letter: "y",
  1714. movieClip: null
  1715. };
  1716. G.Font.chars[122] = {
  1717. id: 122,
  1718. x: 11,
  1719. y: 70,
  1720. width: 6,
  1721. height: 7,
  1722. xOffset: 1,
  1723. yOffset: 4,
  1724. xAdvance: 7,
  1725. page: 0,
  1726. letter: "z",
  1727. movieClip: null
  1728. };
  1729. G.Font.chars[123] = {
  1730. id: 123,
  1731. x: 38,
  1732. y: 2,
  1733. width: 5,
  1734. height: 11,
  1735. xOffset: 2,
  1736. yOffset: 2,
  1737. xAdvance: 7,
  1738. page: 0,
  1739. letter: "{",
  1740. movieClip: null
  1741. };
  1742. G.Font.chars[124] = {
  1743. id: 124,
  1744. x: 2,
  1745. y: 2,
  1746. width: 2,
  1747. height: 14,
  1748. xOffset: 3,
  1749. yOffset: 0,
  1750. xAdvance: 7,
  1751. page: 0,
  1752. letter: "|",
  1753. movieClip: null
  1754. };
  1755. G.Font.chars[125] = {
  1756. id: 125,
  1757. x: 45,
  1758. y: 2,
  1759. width: 5,
  1760. height: 11,
  1761. xOffset: 2,
  1762. yOffset: 2,
  1763. xAdvance: 7,
  1764. page: 0,
  1765. letter: "}",
  1766. movieClip: null
  1767. };
  1768. G.Font.RegisterCharacters()
  1769. };
  1770. var n = function () {};
  1771. s.FontGame = n;
  1772. n.__name__ = ["FontGame"];
  1773. n.Register = function () {
  1774. n.Font = new q.OzFont;
  1775. n.Font.face = "Cookies";
  1776. n.Font.size = 20;
  1777. n.Font.padding = [0, 0, 0, 0];
  1778. n.Font.spacing = [2, 2];
  1779. n.Font.lineHeight = 22;
  1780. n.Font.base = 16;
  1781. n.Font.numPages = 1;
  1782. n.Font.bitmapName = "FontGame.png";
  1783. n.Font.numChars = 95;
  1784. n.Font.chars[32] = {
  1785. id: 32,
  1786. x: 118,
  1787. y: 134,
  1788. width: 0,
  1789. height: 0,
  1790. xOffset: 0,
  1791. yOffset: 18,
  1792. xAdvance: 6,
  1793. page: 0,
  1794. letter: " ",
  1795. movieClip: null
  1796. };
  1797. n.Font.chars[33] = {
  1798. id: 33,
  1799. x: 125,
  1800. y: 92,
  1801. width: 10,
  1802. height: 20,
  1803. xOffset: 0,
  1804. yOffset: -2,
  1805. xAdvance: 6,
  1806. page: 0,
  1807. letter: "!",
  1808. movieClip: null
  1809. };
  1810. n.Font.chars[34] = {
  1811. id: 34,
  1812. x: 228,
  1813. y: 114,
  1814. width: 15,
  1815. height: 12,
  1816. xOffset: 1,
  1817. yOffset: -2,
  1818. xAdvance: 12,
  1819. page: 0,
  1820. letter: '"',
  1821. movieClip: null
  1822. };
  1823. n.Font.chars[35] = {
  1824. id: 35,
  1825. x: 158,
  1826. y: 114,
  1827. width: 16,
  1828. height: 16,
  1829. xOffset: 0,
  1830. yOffset: -1,
  1831. xAdvance: 12,
  1832. page: 0,
  1833. letter: "#",
  1834. movieClip: null
  1835. };
  1836. n.Font.chars[36] = {
  1837. id: 36,
  1838. x: 230,
  1839. y: 2,
  1840. width: 16,
  1841. height: 20,
  1842. xOffset: 0,
  1843. yOffset: -2,
  1844. xAdvance: 12,
  1845. page: 0,
  1846. letter: "$",
  1847. movieClip: null
  1848. };
  1849. n.Font.chars[37] = {
  1850. id: 37,
  1851. x: 50,
  1852. y: 2,
  1853. width: 16,
  1854. height: 20,
  1855. xOffset: 0,
  1856. yOffset: -2,
  1857. xAdvance: 12,
  1858. page: 0,
  1859. letter: "%",
  1860. movieClip: null
  1861. };
  1862. n.Font.chars[38] = {
  1863. id: 38,
  1864. x: 2,
  1865. y: 26,
  1866. width: 16,
  1867. height: 20,
  1868. xOffset: 0,
  1869. yOffset: -2,
  1870. xAdvance: 12,
  1871. page: 0,
  1872. letter: "&",
  1873. movieClip: null
  1874. };
  1875. n.Font.chars[39] = {
  1876. id: 39,
  1877. x: 18,
  1878. y: 134,
  1879. width: 10,
  1880. height: 12,
  1881. xOffset: 2,
  1882. yOffset: -2,
  1883. xAdvance: 8,
  1884. page: 0,
  1885. letter: "'",
  1886. movieClip: null
  1887. };
  1888. n.Font.chars[40] = {
  1889. id: 40,
  1890. x: 19,
  1891. y: 92,
  1892. width: 14,
  1893. height: 20,
  1894. xOffset: 1,
  1895. yOffset: -2,
  1896. xAdvance: 11,
  1897. page: 0,
  1898. letter: "(",
  1899. movieClip: null
  1900. };
  1901. n.Font.chars[41] = {
  1902. id: 41,
  1903. x: 35,
  1904. y: 92,
  1905. width: 14,
  1906. height: 20,
  1907. xOffset: 1,
  1908. yOffset: -2,
  1909. xAdvance: 11,
  1910. page: 0,
  1911. letter: ")",
  1912. movieClip: null
  1913. };
  1914. n.Font.chars[42] = {
  1915. id: 42,
  1916. x: 193,
  1917. y: 114,
  1918. width: 16,
  1919. height: 14,
  1920. xOffset: 1,
  1921. yOffset: -2,
  1922. xAdvance: 12,
  1923. page: 0,
  1924. letter: "*",
  1925. movieClip: null
  1926. };
  1927. n.Font.chars[43] = {
  1928. id: 43,
  1929. x: 176,
  1930. y: 114,
  1931. width: 15,
  1932. height: 16,
  1933. xOffset: 0,
  1934. yOffset: -1,
  1935. xAdvance: 11,
  1936. page: 0,
  1937. letter: "+",
  1938. movieClip: null
  1939. };
  1940. n.Font.chars[44] = {
  1941. id: 44,
  1942. x: 30,
  1943. y: 134,
  1944. width: 10,
  1945. height: 12,
  1946. xOffset: 2,
  1947. yOffset: 8,
  1948. xAdvance: 8,
  1949. page: 0,
  1950. letter: ",",
  1951. movieClip: null
  1952. };
  1953. n.Font.chars[45] = {
  1954. id: 45,
  1955. x: 84,
  1956. y: 134,
  1957. width: 15,
  1958. height: 9,
  1959. xOffset: 1,
  1960. yOffset: 3,
  1961. xAdvance: 12,
  1962. page: 0,
  1963. letter: "-",
  1964. movieClip: null
  1965. };
  1966. n.Font.chars[46] = {
  1967. id: 46,
  1968. x: 72,
  1969. y: 134,
  1970. width: 10,
  1971. height: 10,
  1972. xOffset: 2,
  1973. yOffset: 8,
  1974. xAdvance: 8,
  1975. page: 0,
  1976. letter: ".",
  1977. movieClip: null
  1978. };
  1979. n.Font.chars[47] = {
  1980. id: 47,
  1981. x: 2,
  1982. y: 70,
  1983. width: 15,
  1984. height: 20,
  1985. xOffset: 0,
  1986. yOffset: -2,
  1987. xAdvance: 11,
  1988. page: 0,
  1989. letter: "/",
  1990. movieClip: null
  1991. };
  1992. n.Font.chars[48] = {
  1993. id: 48,
  1994. x: 19,
  1995. y: 70,
  1996. width: 15,
  1997. height: 20,
  1998. xOffset: 1,
  1999. yOffset: -2,
  2000. xAdvance: 12,
  2001. page: 0,
  2002. letter: "0",
  2003. movieClip: null
  2004. };
  2005. n.Font.chars[49] = {
  2006. id: 49,
  2007. x: 98,
  2008. y: 92,
  2009. width: 13,
  2010. height: 20,
  2011. xOffset: 3,
  2012. yOffset: -2,
  2013. xAdvance: 12,
  2014. page: 0,
  2015. letter: "1",
  2016. movieClip: null
  2017. };
  2018. n.Font.chars[50] = {
  2019. id: 50,
  2020. x: 36,
  2021. y: 70,
  2022. width: 15,
  2023. height: 20,
  2024. xOffset: 1,
  2025. yOffset: -2,
  2026. xAdvance: 12,
  2027. page: 0,
  2028. letter: "2",
  2029. movieClip: null
  2030. };
  2031. n.Font.chars[51] = {
  2032. id: 51,
  2033. x: 53,
  2034. y: 70,
  2035. width: 15,
  2036. height: 20,
  2037. xOffset: 1,
  2038. yOffset: -2,
  2039. xAdvance: 12,
  2040. page: 0,
  2041. letter: "3",
  2042. movieClip: null
  2043. };
  2044. n.Font.chars[52] = {
  2045. id: 52,
  2046. x: 20,
  2047. y: 26,
  2048. width: 16,
  2049. height: 20,
  2050. xOffset: 1,
  2051. yOffset: -2,
  2052. xAdvance: 12,
  2053. page: 0,
  2054. letter: "4",
  2055. movieClip: null
  2056. };
  2057. n.Font.chars[53] = {
  2058. id: 53,
  2059. x: 70,
  2060. y: 70,
  2061. width: 15,
  2062. height: 20,
  2063. xOffset: 1,
  2064. yOffset: -2,
  2065. xAdvance: 12,
  2066. page: 0,
  2067. letter: "5",
  2068. movieClip: null
  2069. };
  2070. n.Font.chars[54] = {
  2071. id: 54,
  2072. x: 87,
  2073. y: 70,
  2074. width: 15,
  2075. height: 20,
  2076. xOffset: 1,
  2077. yOffset: -2,
  2078. xAdvance: 12,
  2079. page: 0,
  2080. letter: "6",
  2081. movieClip: null
  2082. };
  2083. n.Font.chars[55] = {
  2084. id: 55,
  2085. x: 104,
  2086. y: 70,
  2087. width: 15,
  2088. height: 20,
  2089. xOffset: 1,
  2090. yOffset: -2,
  2091. xAdvance: 12,
  2092. page: 0,
  2093. letter: "7",
  2094. movieClip: null
  2095. };
  2096. n.Font.chars[56] = {
  2097. id: 56,
  2098. x: 38,
  2099. y: 26,
  2100. width: 16,
  2101. height: 20,
  2102. xOffset: 1,
  2103. yOffset: -2,
  2104. xAdvance: 12,
  2105. page: 0,
  2106. letter: "8",
  2107. movieClip: null
  2108. };
  2109. n.Font.chars[57] = {
  2110. id: 57,
  2111. x: 121,
  2112. y: 70,
  2113. width: 15,
  2114. height: 20,
  2115. xOffset: 1,
  2116. yOffset: -2,
  2117. xAdvance: 12,
  2118. page: 0,
  2119. letter: "9",
  2120. movieClip: null
  2121. };
  2122. n.Font.chars[58] = {
  2123. id: 58,
  2124. x: 146,
  2125. y: 114,
  2126. width: 10,
  2127. height: 18,
  2128. xOffset: 2,
  2129. yOffset: 0,
  2130. xAdvance: 8,
  2131. page: 0,
  2132. letter: ":",
  2133. movieClip: null
  2134. };
  2135. n.Font.chars[59] = {
  2136. id: 59,
  2137. x: 20,
  2138. y: 2,
  2139. width: 10,
  2140. height: 21,
  2141. xOffset: 2,
  2142. yOffset: -1,
  2143. xAdvance: 8,
  2144. page: 0,
  2145. letter: ";",
  2146. movieClip: null
  2147. };
  2148. n.Font.chars[60] = {
  2149. id: 60,
  2150. x: 223,
  2151. y: 70,
  2152. width: 15,
  2153. height: 20,
  2154. xOffset: 1,
  2155. yOffset: -2,
  2156. xAdvance: 11,
  2157. page: 0,
  2158. letter: "<",
  2159. movieClip: null
  2160. };
  2161. n.Font.chars[61] = {
  2162. id: 61,
  2163. x: 211,
  2164. y: 114,
  2165. width: 15,
  2166. height: 13,
  2167. xOffset: 1,
  2168. yOffset: 1,
  2169. xAdvance: 12,
  2170. page: 0,
  2171. letter: "=",
  2172. movieClip: null
  2173. };
  2174. n.Font.chars[62] = {
  2175. id: 62,
  2176. x: 2,
  2177. y: 92,
  2178. width: 15,
  2179. height: 20,
  2180. xOffset: 1,
  2181. yOffset: -2,
  2182. xAdvance: 11,
  2183. page: 0,
  2184. letter: ">",
  2185. movieClip: null
  2186. };
  2187. n.Font.chars[63] = {
  2188. id: 63,
  2189. x: 138,
  2190. y: 70,
  2191. width: 15,
  2192. height: 20,
  2193. xOffset: 1,
  2194. yOffset: -2,
  2195. xAdvance: 11,
  2196. page: 0,
  2197. letter: "?",
  2198. movieClip: null
  2199. };
  2200. n.Font.chars[64] = {
  2201. id: 64,
  2202. x: 56,
  2203. y: 26,
  2204. width: 16,
  2205. height: 20,
  2206. xOffset: 0,
  2207. yOffset: -2,
  2208. xAdvance: 12,
  2209. page: 0,
  2210. letter: "@",
  2211. movieClip: null
  2212. };
  2213. n.Font.chars[65] = {
  2214. id: 65,
  2215. x: 86,
  2216. y: 2,
  2217. width: 16,
  2218. height: 20,
  2219. xOffset: 0,
  2220. yOffset: -2,
  2221. xAdvance: 12,
  2222. page: 0,
  2223. letter: "A",
  2224. movieClip: null
  2225. };
  2226. n.Font.chars[66] = {
  2227. id: 66,
  2228. x: 74,
  2229. y: 26,
  2230. width: 16,
  2231. height: 20,
  2232. xOffset: 0,
  2233. yOffset: -2,
  2234. xAdvance: 12,
  2235. page: 0,
  2236. letter: "B",
  2237. movieClip: null
  2238. };
  2239. n.Font.chars[67] = {
  2240. id: 67,
  2241. x: 92,
  2242. y: 26,
  2243. width: 16,
  2244. height: 20,
  2245. xOffset: 0,
  2246. yOffset: -2,
  2247. xAdvance: 11,
  2248. page: 0,
  2249. letter: "C",
  2250. movieClip: null
  2251. };
  2252. n.Font.chars[68] = {
  2253. id: 68,
  2254. x: 110,
  2255. y: 26,
  2256. width: 16,
  2257. height: 20,
  2258. xOffset: 1,
  2259. yOffset: -2,
  2260. xAdvance: 12,
  2261. page: 0,
  2262. letter: "D",
  2263. movieClip: null
  2264. };
  2265. n.Font.chars[69] = {
  2266. id: 69,
  2267. x: 146,
  2268. y: 48,
  2269. width: 16,
  2270. height: 20,
  2271. xOffset: 0,
  2272. yOffset: -2,
  2273. xAdvance: 11,
  2274. page: 0,
  2275. letter: "E",
  2276. movieClip: null
  2277. };
  2278. n.Font.chars[70] = {
  2279. id: 70,
  2280. x: 164,
  2281. y: 48,
  2282. width: 16,
  2283. height: 20,
  2284. xOffset: 0,
  2285. yOffset: -2,
  2286. xAdvance: 11,
  2287. page: 0,
  2288. letter: "F",
  2289. movieClip: null
  2290. };
  2291. n.Font.chars[71] = {
  2292. id: 71,
  2293. x: 128,
  2294. y: 26,
  2295. width: 16,
  2296. height: 20,
  2297. xOffset: 0,
  2298. yOffset: -2,
  2299. xAdvance: 12,
  2300. page: 0,
  2301. letter: "G",
  2302. movieClip: null
  2303. };
  2304. n.Font.chars[72] = {
  2305. id: 72,
  2306. x: 155,
  2307. y: 70,
  2308. width: 15,
  2309. height: 20,
  2310. xOffset: 0,
  2311. yOffset: -2,
  2312. xAdvance: 12,
  2313. page: 0,
  2314. letter: "H",
  2315. movieClip: null
  2316. };
  2317. n.Font.chars[73] = {
  2318. id: 73,
  2319. x: 137,
  2320. y: 92,
  2321. width: 10,
  2322. height: 20,
  2323. xOffset: 0,
  2324. yOffset: -2,
  2325. xAdvance: 6,
  2326. page: 0,
  2327. letter: "I",
  2328. movieClip: null
  2329. };
  2330. n.Font.chars[74] = {
  2331. id: 74,
  2332. x: 172,
  2333. y: 70,
  2334. width: 15,
  2335. height: 20,
  2336. xOffset: 0,
  2337. yOffset: -2,
  2338. xAdvance: 12,
  2339. page: 0,
  2340. letter: "J",
  2341. movieClip: null
  2342. };
  2343. n.Font.chars[75] = {
  2344. id: 75,
  2345. x: 140,
  2346. y: 2,
  2347. width: 16,
  2348. height: 20,
  2349. xOffset: 0,
  2350. yOffset: -2,
  2351. xAdvance: 12,
  2352. page: 0,
  2353. letter: "K",
  2354. movieClip: null
  2355. };
  2356. n.Font.chars[76] = {
  2357. id: 76,
  2358. x: 146,
  2359. y: 26,
  2360. width: 16,
  2361. height: 20,
  2362. xOffset: 0,
  2363. yOffset: -2,
  2364. xAdvance: 11,
  2365. page: 0,
  2366. letter: "L",
  2367. movieClip: null
  2368. };
  2369. n.Font.chars[77] = {
  2370. id: 77,
  2371. x: 68,
  2372. y: 2,
  2373. width: 16,
  2374. height: 20,
  2375. xOffset: 0,
  2376. yOffset: -2,
  2377. xAdvance: 12,
  2378. page: 0,
  2379. letter: "M",
  2380. movieClip: null
  2381. };
  2382. n.Font.chars[78] = {
  2383. id: 78,
  2384. x: 104,
  2385. y: 2,
  2386. width: 16,
  2387. height: 20,
  2388. xOffset: 0,
  2389. yOffset: -2,
  2390. xAdvance: 12,
  2391. page: 0,
  2392. letter: "N",
  2393. movieClip: null
  2394. };
  2395. n.Font.chars[79] = {
  2396. id: 79,
  2397. x: 164,
  2398. y: 26,
  2399. width: 16,
  2400. height: 20,
  2401. xOffset: 0,
  2402. yOffset: -2,
  2403. xAdvance: 12,
  2404. page: 0,
  2405. letter: "O",
  2406. movieClip: null
  2407. };
  2408. n.Font.chars[80] = {
  2409. id: 80,
  2410. x: 182,
  2411. y: 26,
  2412. width: 16,
  2413. height: 20,
  2414. xOffset: 0,
  2415. yOffset: -2,
  2416. xAdvance: 12,
  2417. page: 0,
  2418. letter: "P",
  2419. movieClip: null
  2420. };
  2421. n.Font.chars[81] = {
  2422. id: 81,
  2423. x: 158,
  2424. y: 2,
  2425. width: 16,
  2426. height: 20,
  2427. xOffset: 0,
  2428. yOffset: -2,
  2429. xAdvance: 12,
  2430. page: 0,
  2431. letter: "Q",
  2432. movieClip: null
  2433. };
  2434. n.Font.chars[82] = {
  2435. id: 82,
  2436. x: 176,
  2437. y: 2,
  2438. width: 16,
  2439. height: 20,
  2440. xOffset: 0,
  2441. yOffset: -2,
  2442. xAdvance: 12,
  2443. page: 0,
  2444. letter: "R",
  2445. movieClip: null
  2446. };
  2447. n.Font.chars[83] = {
  2448. id: 83,
  2449. x: 200,
  2450. y: 26,
  2451. width: 16,
  2452. height: 20,
  2453. xOffset: 0,
  2454. yOffset: -2,
  2455. xAdvance: 12,
  2456. page: 0,
  2457. letter: "S",
  2458. movieClip: null
  2459. };
  2460. n.Font.chars[84] = {
  2461. id: 84,
  2462. x: 218,
  2463. y: 26,
  2464. width: 16,
  2465. height: 20,
  2466. xOffset: 0,
  2467. yOffset: -2,
  2468. xAdvance: 12,
  2469. page: 0,
  2470. letter: "T",
  2471. movieClip: null
  2472. };
  2473. n.Font.chars[85] = {
  2474. id: 85,
  2475. x: 236,
  2476. y: 26,
  2477. width: 16,
  2478. height: 20,
  2479. xOffset: 0,
  2480. yOffset: -2,
  2481. xAdvance: 12,
  2482. page: 0,
  2483. letter: "U",
  2484. movieClip: null
  2485. };
  2486. n.Font.chars[86] = {
  2487. id: 86,
  2488. x: 122,
  2489. y: 2,
  2490. width: 16,
  2491. height: 20,
  2492. xOffset: 0,
  2493. yOffset: -2,
  2494. xAdvance: 12,
  2495. page: 0,
  2496. letter: "V",
  2497. movieClip: null
  2498. };
  2499. n.Font.chars[87] = {
  2500. id: 87,
  2501. x: 32,
  2502. y: 2,
  2503. width: 16,
  2504. height: 20,
  2505. xOffset: 0,
  2506. yOffset: -2,
  2507. xAdvance: 12,
  2508. page: 0,
  2509. letter: "W",
  2510. movieClip: null
  2511. };
  2512. n.Font.chars[88] = {
  2513. id: 88,
  2514. x: 2,
  2515. y: 48,
  2516. width: 16,
  2517. height: 20,
  2518. xOffset: 0,
  2519. yOffset: -2,
  2520. xAdvance: 12,
  2521. page: 0,
  2522. letter: "X",
  2523. movieClip: null
  2524. };
  2525. n.Font.chars[89] = {
  2526. id: 89,
  2527. x: 20,
  2528. y: 48,
  2529. width: 16,
  2530. height: 20,
  2531. xOffset: 0,
  2532. yOffset: -2,
  2533. xAdvance: 11,
  2534. page: 0,
  2535. letter: "Y",
  2536. movieClip: null
  2537. };
  2538. n.Font.chars[90] = {
  2539. id: 90,
  2540. x: 182,
  2541. y: 48,
  2542. width: 16,
  2543. height: 20,
  2544. xOffset: 0,
  2545. yOffset: -2,
  2546. xAdvance: 12,
  2547. page: 0,
  2548. letter: "Z",
  2549. movieClip: null
  2550. };
  2551. n.Font.chars[91] = {
  2552. id: 91,
  2553. x: 235,
  2554. y: 48,
  2555. width: 15,
  2556. height: 20,
  2557. xOffset: 1,
  2558. yOffset: -2,
  2559. xAdvance: 11,
  2560. page: 0,
  2561. letter: "[",
  2562. movieClip: null
  2563. };
  2564. n.Font.chars[92] = {
  2565. id: 92,
  2566. x: 189,
  2567. y: 70,
  2568. width: 15,
  2569. height: 20,
  2570. xOffset: 0,
  2571. yOffset: -2,
  2572. xAdvance: 11,
  2573. page: 0,
  2574. letter: "\\",
  2575. movieClip: null
  2576. };
  2577. n.Font.chars[93] = {
  2578. id: 93,
  2579. x: 218,
  2580. y: 48,
  2581. width: 15,
  2582. height: 20,
  2583. xOffset: 1,
  2584. yOffset: -2,
  2585. xAdvance: 11,
  2586. page: 0,
  2587. letter: "]",
  2588. movieClip: null
  2589. };
  2590. n.Font.chars[94] = {
  2591. id: 94,
  2592. x: 2,
  2593. y: 134,
  2594. width: 14,
  2595. height: 12,
  2596. xOffset: 1,
  2597. yOffset: -2,
  2598. xAdvance: 11,
  2599. page: 0,
  2600. letter: "^",
  2601. movieClip: null
  2602. };
  2603. n.Font.chars[95] = {
  2604. id: 95,
  2605. x: 101,
  2606. y: 134,
  2607. width: 15,
  2608. height: 9,
  2609. xOffset: 1,
  2610. yOffset: 9,
  2611. xAdvance: 12,
  2612. page: 0,
  2613. letter: "_",
  2614. movieClip: null
  2615. };
  2616. n.Font.chars[96] = {
  2617. id: 96,
  2618. x: 60,
  2619. y: 134,
  2620. width: 10,
  2621. height: 10,
  2622. xOffset: 3,
  2623. yOffset: -2,
  2624. xAdvance: 9,
  2625. page: 0,
  2626. letter: "`",
  2627. movieClip: null
  2628. };
  2629. n.Font.chars[97] = {
  2630. id: 97,
  2631. x: 161,
  2632. y: 92,
  2633. width: 16,
  2634. height: 19,
  2635. xOffset: 0,
  2636. yOffset: -1,
  2637. xAdvance: 12,
  2638. page: 0,
  2639. letter: "a",
  2640. movieClip: null
  2641. };
  2642. n.Font.chars[98] = {
  2643. id: 98,
  2644. x: 38,
  2645. y: 48,
  2646. width: 16,
  2647. height: 20,
  2648. xOffset: 0,
  2649. yOffset: -2,
  2650. xAdvance: 11,
  2651. page: 0,
  2652. letter: "b",
  2653. movieClip: null
  2654. };
  2655. n.Font.chars[99] = {
  2656. id: 99,
  2657. x: 20,
  2658. y: 114,
  2659. width: 16,
  2660. height: 18,
  2661. xOffset: 0,
  2662. yOffset: 0,
  2663. xAdvance: 11,
  2664. page: 0,
  2665. letter: "c",
  2666. movieClip: null
  2667. };
  2668. n.Font.chars[100] = {
  2669. id: 100,
  2670. x: 56,
  2671. y: 48,
  2672. width: 16,
  2673. height: 20,
  2674. xOffset: 0,
  2675. yOffset: -2,
  2676. xAdvance: 12,
  2677. page: 0,
  2678. letter: "d",
  2679. movieClip: null
  2680. };
  2681. n.Font.chars[101] = {
  2682. id: 101,
  2683. x: 110,
  2684. y: 114,
  2685. width: 16,
  2686. height: 18,
  2687. xOffset: 0,
  2688. yOffset: 0,
  2689. xAdvance: 12,
  2690. page: 0,
  2691. letter: "e",
  2692. movieClip: null
  2693. };
  2694. n.Font.chars[102] = {
  2695. id: 102,
  2696. x: 200,
  2697. y: 48,
  2698. width: 16,
  2699. height: 20,
  2700. xOffset: 0,
  2701. yOffset: -2,
  2702. xAdvance: 12,
  2703. page: 0,
  2704. letter: "f",
  2705. movieClip: null
  2706. };
  2707. n.Font.chars[103] = {
  2708. id: 103,
  2709. x: 74,
  2710. y: 48,
  2711. width: 16,
  2712. height: 20,
  2713. xOffset: 0,
  2714. yOffset: 0,
  2715. xAdvance: 12,
  2716. page: 0,
  2717. letter: "g",
  2718. movieClip: null
  2719. };
  2720. n.Font.chars[104] = {
  2721. id: 104,
  2722. x: 206,
  2723. y: 70,
  2724. width: 15,
  2725. height: 20,
  2726. xOffset: 0,
  2727. yOffset: -2,
  2728. xAdvance: 11,
  2729. page: 0,
  2730. letter: "h",
  2731. movieClip: null
  2732. };
  2733. n.Font.chars[105] = {
  2734. id: 105,
  2735. x: 149,
  2736. y: 92,
  2737. width: 10,
  2738. height: 20,
  2739. xOffset: 0,
  2740. yOffset: -2,
  2741. xAdvance: 6,
  2742. page: 0,
  2743. letter: "i",
  2744. movieClip: null
  2745. };
  2746. n.Font.chars[106] = {
  2747. id: 106,
  2748. x: 2,
  2749. y: 2,
  2750. width: 16,
  2751. height: 22,
  2752. xOffset: 0,
  2753. yOffset: -2,
  2754. xAdvance: 12,
  2755. page: 0,
  2756. letter: "j",
  2757. movieClip: null
  2758. };
  2759. n.Font.chars[107] = {
  2760. id: 107,
  2761. x: 194,
  2762. y: 2,
  2763. width: 16,
  2764. height: 20,
  2765. xOffset: 0,
  2766. yOffset: -2,
  2767. xAdvance: 12,
  2768. page: 0,
  2769. letter: "k",
  2770. movieClip: null
  2771. };
  2772. n.Font.chars[108] = {
  2773. id: 108,
  2774. x: 83,
  2775. y: 92,
  2776. width: 13,
  2777. height: 20,
  2778. xOffset: 0,
  2779. yOffset: -2,
  2780. xAdvance: 8,
  2781. page: 0,
  2782. letter: "l",
  2783. movieClip: null
  2784. };
  2785. n.Font.chars[109] = {
  2786. id: 109,
  2787. x: 197,
  2788. y: 92,
  2789. width: 16,
  2790. height: 18,
  2791. xOffset: 0,
  2792. yOffset: 0,
  2793. xAdvance: 12,
  2794. page: 0,
  2795. letter: "m",
  2796. movieClip: null
  2797. };
  2798. n.Font.chars[110] = {
  2799. id: 110,
  2800. x: 215,
  2801. y: 92,
  2802. width: 16,
  2803. height: 18,
  2804. xOffset: 0,
  2805. yOffset: 0,
  2806. xAdvance: 12,
  2807. page: 0,
  2808. letter: "n",
  2809. movieClip: null
  2810. };
  2811. n.Font.chars[111] = {
  2812. id: 111,
  2813. x: 38,
  2814. y: 114,
  2815. width: 16,
  2816. height: 18,
  2817. xOffset: 0,
  2818. yOffset: 0,
  2819. xAdvance: 12,
  2820. page: 0,
  2821. letter: "o",
  2822. movieClip: null
  2823. };
  2824. n.Font.chars[112] = {
  2825. id: 112,
  2826. x: 92,
  2827. y: 48,
  2828. width: 16,
  2829. height: 20,
  2830. xOffset: 0,
  2831. yOffset: 0,
  2832. xAdvance: 12,
  2833. page: 0,
  2834. letter: "p",
  2835. movieClip: null
  2836. };
  2837. n.Font.chars[113] = {
  2838. id: 113,
  2839. x: 212,
  2840. y: 2,
  2841. width: 16,
  2842. height: 20,
  2843. xOffset: 0,
  2844. yOffset: 0,
  2845. xAdvance: 12,
  2846. page: 0,
  2847. letter: "q",
  2848. movieClip: null
  2849. };
  2850. n.Font.chars[114] = {
  2851. id: 114,
  2852. x: 2,
  2853. y: 114,
  2854. width: 16,
  2855. height: 18,
  2856. xOffset: 0,
  2857. yOffset: 0,
  2858. xAdvance: 11,
  2859. page: 0,
  2860. letter: "r",
  2861. movieClip: null
  2862. };
  2863. n.Font.chars[115] = {
  2864. id: 115,
  2865. x: 56,
  2866. y: 114,
  2867. width: 16,
  2868. height: 18,
  2869. xOffset: 0,
  2870. yOffset: 0,
  2871. xAdvance: 12,
  2872. page: 0,
  2873. letter: "s",
  2874. movieClip: null
  2875. };
  2876. n.Font.chars[116] = {
  2877. id: 116,
  2878. x: 110,
  2879. y: 48,
  2880. width: 16,
  2881. height: 20,
  2882. xOffset: 0,
  2883. yOffset: -2,
  2884. xAdvance: 12,
  2885. page: 0,
  2886. letter: "t",
  2887. movieClip: null
  2888. };
  2889. n.Font.chars[117] = {
  2890. id: 117,
  2891. x: 74,
  2892. y: 114,
  2893. width: 16,
  2894. height: 18,
  2895. xOffset: 0,
  2896. yOffset: 0,
  2897. xAdvance: 12,
  2898. page: 0,
  2899. letter: "u",
  2900. movieClip: null
  2901. };
  2902. n.Font.chars[118] = {
  2903. id: 118,
  2904. x: 233,
  2905. y: 92,
  2906. width: 16,
  2907. height: 18,
  2908. xOffset: 0,
  2909. yOffset: 0,
  2910. xAdvance: 12,
  2911. page: 0,
  2912. letter: "v",
  2913. movieClip: null
  2914. };
  2915. n.Font.chars[119] = {
  2916. id: 119,
  2917. x: 179,
  2918. y: 92,
  2919. width: 16,
  2920. height: 18,
  2921. xOffset: 0,
  2922. yOffset: 0,
  2923. xAdvance: 12,
  2924. page: 0,
  2925. letter: "w",
  2926. movieClip: null
  2927. };
  2928. n.Font.chars[120] = {
  2929. id: 120,
  2930. x: 92,
  2931. y: 114,
  2932. width: 16,
  2933. height: 18,
  2934. xOffset: 0,
  2935. yOffset: 0,
  2936. xAdvance: 12,
  2937. page: 0,
  2938. letter: "x",
  2939. movieClip: null
  2940. };
  2941. n.Font.chars[121] = {
  2942. id: 121,
  2943. x: 128,
  2944. y: 48,
  2945. width: 16,
  2946. height: 20,
  2947. xOffset: 0,
  2948. yOffset: 0,
  2949. xAdvance: 12,
  2950. page: 0,
  2951. letter: "y",
  2952. movieClip: null
  2953. };
  2954. n.Font.chars[122] = {
  2955. id: 122,
  2956. x: 128,
  2957. y: 114,
  2958. width: 16,
  2959. height: 18,
  2960. xOffset: 0,
  2961. yOffset: 0,
  2962. xAdvance: 12,
  2963. page: 0,
  2964. letter: "z",
  2965. movieClip: null
  2966. };
  2967. n.Font.chars[123] = {
  2968. id: 123,
  2969. x: 67,
  2970. y: 92,
  2971. width: 14,
  2972. height: 20,
  2973. xOffset: 1,
  2974. yOffset: -2,
  2975. xAdvance: 10,
  2976. page: 0,
  2977. letter: "{",
  2978. movieClip: null
  2979. };
  2980. n.Font.chars[124] = {
  2981. id: 124,
  2982. x: 113,
  2983. y: 92,
  2984. width: 10,
  2985. height: 20,
  2986. xOffset: 0,
  2987. yOffset: -2,
  2988. xAdvance: 6,
  2989. page: 0,
  2990. letter: "|",
  2991. movieClip: null
  2992. };
  2993. n.Font.chars[125] = {
  2994. id: 125,
  2995. x: 51,
  2996. y: 92,
  2997. width: 14,
  2998. height: 20,
  2999. xOffset: 1,
  3000. yOffset: -2,
  3001. xAdvance: 10,
  3002. page: 0,
  3003. letter: "}",
  3004. movieClip: null
  3005. };
  3006. n.Font.chars[126] = {
  3007. id: 126,
  3008. x: 42,
  3009. y: 134,
  3010. width: 16,
  3011. height: 10,
  3012. xOffset: 0,
  3013. yOffset: -2,
  3014. xAdvance: 12,
  3015. page: 0,
  3016. letter: "~",
  3017. movieClip: null
  3018. };
  3019. n.Font.numKernings = 480;
  3020. n.Font.addKerning(32, 115, -2);
  3021. n.Font.addKerning(33, 46, -2);
  3022. n.Font.addKerning(33, 49, -2);
  3023. n.Font.addKerning(33, 104, -5);
  3024. n.Font.addKerning(33, 105, -2);
  3025. n.Font.addKerning(34, 44, -8);
  3026. n.Font.addKerning(34, 45, -3);
  3027. n.Font.addKerning(34, 46, -8);
  3028. n.Font.addKerning(34, 47, -5);
  3029. n.Font.addKerning(34, 49, -2);
  3030. n.Font.addKerning(34, 52, -3);
  3031. n.Font.addKerning(34, 74, -5);
  3032. n.Font.addKerning(34, 99, -2);
  3033. n.Font.addKerning(34, 100, -5);
  3034. n.Font.addKerning(34, 106, -5);
  3035. n.Font.addKerning(34, 111, -2);
  3036. n.Font.addKerning(35, 39, -2);
  3037. n.Font.addKerning(35, 41, -3);
  3038. n.Font.addKerning(35, 44, -4);
  3039. n.Font.addKerning(35, 46, -4);
  3040. n.Font.addKerning(35, 47, -2);
  3041. n.Font.addKerning(35, 49, -4);
  3042. n.Font.addKerning(35, 51, -2);
  3043. n.Font.addKerning(35, 58, -2);
  3044. n.Font.addKerning(35, 59, -2);
  3045. n.Font.addKerning(35, 64, -3);
  3046. n.Font.addKerning(35,
  3047. 93, -2);
  3048. n.Font.addKerning(35, 106, -3);
  3049. n.Font.addKerning(35, 124, -3);
  3050. n.Font.addKerning(36, 64, -1);
  3051. n.Font.addKerning(36, 84, -3);
  3052. n.Font.addKerning(36, 124, -2);
  3053. n.Font.addKerning(36, 125, -2);
  3054. n.Font.addKerning(39, 44, -8);
  3055. n.Font.addKerning(39, 45, -3);
  3056. n.Font.addKerning(39, 46, -8);
  3057. n.Font.addKerning(39, 47, -7);
  3058. n.Font.addKerning(39, 49, -2);
  3059. n.Font.addKerning(39, 52, -3);
  3060. n.Font.addKerning(39, 74, -7);
  3061. n.Font.addKerning(39, 99, -2);
  3062. n.Font.addKerning(39, 100, -7);
  3063. n.Font.addKerning(39, 106, -6);
  3064. n.Font.addKerning(39, 111, -2);
  3065. n.Font.addKerning(39,
  3066. 115, -1);
  3067. n.Font.addKerning(40, 35, -2);
  3068. n.Font.addKerning(40, 45, -4);
  3069. n.Font.addKerning(40, 49, -2);
  3070. n.Font.addKerning(40, 52, -2);
  3071. n.Font.addKerning(40, 102, -3);
  3072. n.Font.addKerning(40, 113, -2);
  3073. n.Font.addKerning(41, 39, -2);
  3074. n.Font.addKerning(41, 41, -2);
  3075. n.Font.addKerning(41, 44, -2);
  3076. n.Font.addKerning(41, 46, -2);
  3077. n.Font.addKerning(41, 49, -3);
  3078. n.Font.addKerning(41, 51, -2);
  3079. n.Font.addKerning(41, 58, -2);
  3080. n.Font.addKerning(41, 59, -2);
  3081. n.Font.addKerning(44, 34, -6);
  3082. n.Font.addKerning(44, 35, -2);
  3083. n.Font.addKerning(44, 39, -8);
  3084. n.Font.addKerning(44,
  3085. 45, -6);
  3086. n.Font.addKerning(44, 49, -4);
  3087. n.Font.addKerning(44, 52, -2);
  3088. n.Font.addKerning(44, 55, -3);
  3089. n.Font.addKerning(44, 63, -3);
  3090. n.Font.addKerning(44, 84, -3);
  3091. n.Font.addKerning(44, 89, -2);
  3092. n.Font.addKerning(44, 92, -6);
  3093. n.Font.addKerning(44, 102, -3);
  3094. n.Font.addKerning(44, 113, -3);
  3095. n.Font.addKerning(44, 116, -3);
  3096. n.Font.addKerning(45, 39, -3);
  3097. n.Font.addKerning(45, 41, -5);
  3098. n.Font.addKerning(45, 44, -8);
  3099. n.Font.addKerning(45, 46, -8);
  3100. n.Font.addKerning(45, 47, -2);
  3101. n.Font.addKerning(45, 49, -4);
  3102. n.Font.addKerning(45, 50, -3);
  3103. n.Font.addKerning(45,
  3104. 51, -2);
  3105. n.Font.addKerning(45, 55, -2);
  3106. n.Font.addKerning(45, 57, -2);
  3107. n.Font.addKerning(45, 58, -3);
  3108. n.Font.addKerning(45, 59, -3);
  3109. n.Font.addKerning(45, 63, -4);
  3110. n.Font.addKerning(45, 74, -2);
  3111. n.Font.addKerning(45, 84, -3);
  3112. n.Font.addKerning(45, 88, -2);
  3113. n.Font.addKerning(45, 92, -2);
  3114. n.Font.addKerning(45, 93, -5);
  3115. n.Font.addKerning(45, 106, -6);
  3116. n.Font.addKerning(46, 34, -7);
  3117. n.Font.addKerning(46, 35, -2);
  3118. n.Font.addKerning(46, 39, -8);
  3119. n.Font.addKerning(46, 45, -7);
  3120. n.Font.addKerning(46, 49, -4);
  3121. n.Font.addKerning(46, 52, -2);
  3122. n.Font.addKerning(46,
  3123. 55, -3);
  3124. n.Font.addKerning(46, 63, -3);
  3125. n.Font.addKerning(46, 84, -3);
  3126. n.Font.addKerning(46, 89, -3);
  3127. n.Font.addKerning(46, 92, -7);
  3128. n.Font.addKerning(46, 102, -3);
  3129. n.Font.addKerning(46, 113, -3);
  3130. n.Font.addKerning(46, 116, -3);
  3131. n.Font.addKerning(47, 44, -5);
  3132. n.Font.addKerning(47, 45, -2);
  3133. n.Font.addKerning(47, 46, -5);
  3134. n.Font.addKerning(47, 47, -4);
  3135. n.Font.addKerning(47, 49, -2);
  3136. n.Font.addKerning(47, 52, -2);
  3137. n.Font.addKerning(47, 58, -2);
  3138. n.Font.addKerning(47, 59, -2);
  3139. n.Font.addKerning(47, 74, -3);
  3140. n.Font.addKerning(47, 99, -2);
  3141. n.Font.addKerning(47,
  3142. 100, -3);
  3143. n.Font.addKerning(47, 106, -4);
  3144. n.Font.addKerning(48, 39, -2);
  3145. n.Font.addKerning(48, 44, -2);
  3146. n.Font.addKerning(48, 46, -2);
  3147. n.Font.addKerning(49, 39, -3);
  3148. n.Font.addKerning(49, 40, -2);
  3149. n.Font.addKerning(49, 41, -2);
  3150. n.Font.addKerning(49, 44, -3);
  3151. n.Font.addKerning(49, 46, -3);
  3152. n.Font.addKerning(49, 47, -2);
  3153. n.Font.addKerning(49, 58, -3);
  3154. n.Font.addKerning(49, 59, -3);
  3155. n.Font.addKerning(49, 63, -2);
  3156. n.Font.addKerning(49, 74, -2);
  3157. n.Font.addKerning(49, 92, -2);
  3158. n.Font.addKerning(49, 93, -2);
  3159. n.Font.addKerning(49, 106, -2);
  3160. n.Font.addKerning(50,
  3161. 39, -2);
  3162. n.Font.addKerning(51, 39, -2);
  3163. n.Font.addKerning(51, 46, -2);
  3164. n.Font.addKerning(51, 58, -2);
  3165. n.Font.addKerning(51, 59, -2);
  3166. n.Font.addKerning(52, 34, -2);
  3167. n.Font.addKerning(52, 39, -3);
  3168. n.Font.addKerning(52, 41, -2);
  3169. n.Font.addKerning(52, 44, -2);
  3170. n.Font.addKerning(52, 46, -2);
  3171. n.Font.addKerning(52, 58, -2);
  3172. n.Font.addKerning(52, 59, -2);
  3173. n.Font.addKerning(52, 63, -2);
  3174. n.Font.addKerning(52, 92, -2);
  3175. n.Font.addKerning(53, 39, -2);
  3176. n.Font.addKerning(53, 58, -2);
  3177. n.Font.addKerning(53, 59, -2);
  3178. n.Font.addKerning(54, 39, -2);
  3179. n.Font.addKerning(54,
  3180. 59, -2);
  3181. n.Font.addKerning(55, 44, -3);
  3182. n.Font.addKerning(55, 46, -3);
  3183. n.Font.addKerning(55, 47, -2);
  3184. n.Font.addKerning(55, 106, -2);
  3185. n.Font.addKerning(56, 39, -2);
  3186. n.Font.addKerning(57, 39, -2);
  3187. n.Font.addKerning(57, 44, -2);
  3188. n.Font.addKerning(57, 46, -2);
  3189. n.Font.addKerning(57, 58, -2);
  3190. n.Font.addKerning(57, 59, -2);
  3191. n.Font.addKerning(58, 45, -2);
  3192. n.Font.addKerning(58, 49, -3);
  3193. n.Font.addKerning(59, 45, -2);
  3194. n.Font.addKerning(59, 49, -3);
  3195. n.Font.addKerning(63, 44, -4);
  3196. n.Font.addKerning(63, 46, -4);
  3197. n.Font.addKerning(63, 47, -3);
  3198. n.Font.addKerning(63,
  3199. 49, -3);
  3200. n.Font.addKerning(63, 74, -3);
  3201. n.Font.addKerning(63, 100, -2);
  3202. n.Font.addKerning(63, 106, -3);
  3203. n.Font.addKerning(64, 39, -2);
  3204. n.Font.addKerning(64, 49, -3);
  3205. n.Font.addKerning(65, 39, -3);
  3206. n.Font.addKerning(65, 49, -4);
  3207. n.Font.addKerning(65, 55, -2);
  3208. n.Font.addKerning(65, 63, -2);
  3209. n.Font.addKerning(65, 84, -1);
  3210. n.Font.addKerning(65, 86, -1);
  3211. n.Font.addKerning(65, 89, -1);
  3212. n.Font.addKerning(65, 92, -2);
  3213. n.Font.addKerning(66, 39, -2);
  3214. n.Font.addKerning(66, 49, -3);
  3215. n.Font.addKerning(66, 55, -2);
  3216. n.Font.addKerning(67, 35, -2);
  3217. n.Font.addKerning(67,
  3218. 39, -2);
  3219. n.Font.addKerning(67, 45, -6);
  3220. n.Font.addKerning(67, 49, -3);
  3221. n.Font.addKerning(67, 55, -2);
  3222. n.Font.addKerning(67, 63, -2);
  3223. n.Font.addKerning(67, 102, -3);
  3224. n.Font.addKerning(68, 39, -2);
  3225. n.Font.addKerning(68, 44, -2);
  3226. n.Font.addKerning(68, 46, -2);
  3227. n.Font.addKerning(68, 49, -3);
  3228. n.Font.addKerning(68, 51, -2);
  3229. n.Font.addKerning(68, 58, -2);
  3230. n.Font.addKerning(68, 59, -2);
  3231. n.Font.addKerning(69, 39, -2);
  3232. n.Font.addKerning(69, 49, -3);
  3233. n.Font.addKerning(70, 36, -2);
  3234. n.Font.addKerning(70, 44, -5);
  3235. n.Font.addKerning(70, 46, -5);
  3236. n.Font.addKerning(70,
  3237. 47, -2);
  3238. n.Font.addKerning(70, 49, -2);
  3239. n.Font.addKerning(70, 74, -2);
  3240. n.Font.addKerning(70, 106, -4);
  3241. n.Font.addKerning(71, 39, -3);
  3242. n.Font.addKerning(71, 49, -4);
  3243. n.Font.addKerning(71, 55, -2);
  3244. n.Font.addKerning(71, 58, -2);
  3245. n.Font.addKerning(71, 59, -2);
  3246. n.Font.addKerning(71, 63, -2);
  3247. n.Font.addKerning(71, 92, -2);
  3248. n.Font.addKerning(71, 116, -2);
  3249. n.Font.addKerning(72, 49, -3);
  3250. n.Font.addKerning(73, 49, -2);
  3251. n.Font.addKerning(74, 39, -2);
  3252. n.Font.addKerning(74, 44, -2);
  3253. n.Font.addKerning(74, 46, -2);
  3254. n.Font.addKerning(74, 49, -3);
  3255. n.Font.addKerning(74,
  3256. 58, -2);
  3257. n.Font.addKerning(74, 59, -2);
  3258. n.Font.addKerning(75, 45, -2);
  3259. n.Font.addKerning(75, 49, -2);
  3260. n.Font.addKerning(76, 34, -5);
  3261. n.Font.addKerning(76, 35, -2);
  3262. n.Font.addKerning(76, 39, -6);
  3263. n.Font.addKerning(76, 45, -6);
  3264. n.Font.addKerning(76, 49, -4);
  3265. n.Font.addKerning(76, 55, -3);
  3266. n.Font.addKerning(76, 63, -3);
  3267. n.Font.addKerning(76, 84, -2);
  3268. n.Font.addKerning(76, 86, -1);
  3269. n.Font.addKerning(76, 89, -2);
  3270. n.Font.addKerning(76, 92, -4);
  3271. n.Font.addKerning(76, 102, -3);
  3272. n.Font.addKerning(76, 113, -2);
  3273. n.Font.addKerning(76, 116, -2);
  3274. n.Font.addKerning(77,
  3275. 39, -2);
  3276. n.Font.addKerning(77, 49, -3);
  3277. n.Font.addKerning(77, 78, 1);
  3278. n.Font.addKerning(78, 46, -2);
  3279. n.Font.addKerning(78, 49, -3);
  3280. n.Font.addKerning(79, 39, -2);
  3281. n.Font.addKerning(79, 44, -2);
  3282. n.Font.addKerning(79, 46, -2);
  3283. n.Font.addKerning(79, 49, -3);
  3284. n.Font.addKerning(79, 58, -2);
  3285. n.Font.addKerning(79, 59, -2);
  3286. n.Font.addKerning(79, 92, -2);
  3287. n.Font.addKerning(80, 34, -8);
  3288. n.Font.addKerning(80, 35, -3);
  3289. n.Font.addKerning(80, 36, -8);
  3290. n.Font.addKerning(80, 37, -5);
  3291. n.Font.addKerning(80, 44, -6);
  3292. n.Font.addKerning(80, 46, -6);
  3293. n.Font.addKerning(80,
  3294. 47, -3);
  3295. n.Font.addKerning(80, 49, -3);
  3296. n.Font.addKerning(80, 74, -2);
  3297. n.Font.addKerning(80, 106, -5);
  3298. n.Font.addKerning(81, 32, -3);
  3299. n.Font.addKerning(81, 39, -3);
  3300. n.Font.addKerning(81, 49, -4);
  3301. n.Font.addKerning(81, 55, -2);
  3302. n.Font.addKerning(81, 63, -2);
  3303. n.Font.addKerning(81, 92, -2);
  3304. n.Font.addKerning(82, 39, -2);
  3305. n.Font.addKerning(82, 49, -3);
  3306. n.Font.addKerning(83, 34, -5);
  3307. n.Font.addKerning(83, 39, -2);
  3308. n.Font.addKerning(83, 49, -3);
  3309. n.Font.addKerning(84, 44, -4);
  3310. n.Font.addKerning(84, 45, -3);
  3311. n.Font.addKerning(84, 46, -4);
  3312. n.Font.addKerning(84,
  3313. 47, -3);
  3314. n.Font.addKerning(84, 49, -2);
  3315. n.Font.addKerning(84, 52, -2);
  3316. n.Font.addKerning(84, 58, -2);
  3317. n.Font.addKerning(84, 59, -2);
  3318. n.Font.addKerning(84, 65, -1);
  3319. n.Font.addKerning(84, 74, -3);
  3320. n.Font.addKerning(84, 99, -2);
  3321. n.Font.addKerning(84, 100, -3);
  3322. n.Font.addKerning(84, 101, -1);
  3323. n.Font.addKerning(84, 106, -3);
  3324. n.Font.addKerning(84, 111, -1);
  3325. n.Font.addKerning(84, 115, -1);
  3326. n.Font.addKerning(85, 44, -2);
  3327. n.Font.addKerning(85, 46, -2);
  3328. n.Font.addKerning(85, 49, -3);
  3329. n.Font.addKerning(86, 36, -5);
  3330. n.Font.addKerning(86, 44, -3);
  3331. n.Font.addKerning(86,
  3332. 46, -3);
  3333. n.Font.addKerning(86, 47, -2);
  3334. n.Font.addKerning(86, 49, -2);
  3335. n.Font.addKerning(86, 58, -1);
  3336. n.Font.addKerning(86, 59, -1);
  3337. n.Font.addKerning(87, 44, -2);
  3338. n.Font.addKerning(87, 46, -2);
  3339. n.Font.addKerning(87, 49, -2);
  3340. n.Font.addKerning(87, 58, -1);
  3341. n.Font.addKerning(87, 59, -1);
  3342. n.Font.addKerning(88, 45, -2);
  3343. n.Font.addKerning(88, 49, -2);
  3344. n.Font.addKerning(89, 44, -4);
  3345. n.Font.addKerning(89, 45, -1);
  3346. n.Font.addKerning(89, 46, -4);
  3347. n.Font.addKerning(89, 47, -3);
  3348. n.Font.addKerning(89, 49, -2);
  3349. n.Font.addKerning(89, 52, -2);
  3350. n.Font.addKerning(89,
  3351. 58, -2);
  3352. n.Font.addKerning(89, 59, -2);
  3353. n.Font.addKerning(89, 65, -1);
  3354. n.Font.addKerning(89, 74, -3);
  3355. n.Font.addKerning(89, 100, -2);
  3356. n.Font.addKerning(89, 101, -1);
  3357. n.Font.addKerning(89, 106, -3);
  3358. n.Font.addKerning(89, 111, -1);
  3359. n.Font.addKerning(90, 34, -4);
  3360. n.Font.addKerning(90, 36, -4);
  3361. n.Font.addKerning(90, 37, -2);
  3362. n.Font.addKerning(90, 49, -2);
  3363. n.Font.addKerning(91, 38, -2);
  3364. n.Font.addKerning(92, 34, -3);
  3365. n.Font.addKerning(92, 39, -5);
  3366. n.Font.addKerning(92, 49, -4);
  3367. n.Font.addKerning(92, 55, -3);
  3368. n.Font.addKerning(92, 63, -3);
  3369. n.Font.addKerning(92,
  3370. 84, -2);
  3371. n.Font.addKerning(92, 89, -2);
  3372. n.Font.addKerning(92, 92, -4);
  3373. n.Font.addKerning(92, 102, -2);
  3374. n.Font.addKerning(92, 116, -2);
  3375. n.Font.addKerning(93, 39, -2);
  3376. n.Font.addKerning(93, 44, -2);
  3377. n.Font.addKerning(93, 46, -2);
  3378. n.Font.addKerning(93, 49, -3);
  3379. n.Font.addKerning(93, 58, -2);
  3380. n.Font.addKerning(93, 59, -2);
  3381. n.Font.addKerning(95, 33, -2);
  3382. n.Font.addKerning(96, 36, -3);
  3383. n.Font.addKerning(97, 39, -2);
  3384. n.Font.addKerning(97, 49, -3);
  3385. n.Font.addKerning(97, 58, -2);
  3386. n.Font.addKerning(97, 59, -2);
  3387. n.Font.addKerning(98, 34, -3);
  3388. n.Font.addKerning(98,
  3389. 39, -4);
  3390. n.Font.addKerning(98, 49, -4);
  3391. n.Font.addKerning(98, 55, -3);
  3392. n.Font.addKerning(98, 58, -2);
  3393. n.Font.addKerning(98, 59, -2);
  3394. n.Font.addKerning(98, 63, -3);
  3395. n.Font.addKerning(98, 92, -3);
  3396. n.Font.addKerning(98, 116, -3);
  3397. n.Font.addKerning(99, 39, -3);
  3398. n.Font.addKerning(99, 45, -5);
  3399. n.Font.addKerning(99, 49, -4);
  3400. n.Font.addKerning(99, 55, -2);
  3401. n.Font.addKerning(99, 63, -2);
  3402. n.Font.addKerning(99, 92, -2);
  3403. n.Font.addKerning(100, 39, -2);
  3404. n.Font.addKerning(100, 44, -2);
  3405. n.Font.addKerning(100, 46, -2);
  3406. n.Font.addKerning(100, 49, -3);
  3407. n.Font.addKerning(100,
  3408. 58, -2);
  3409. n.Font.addKerning(100, 59, -2);
  3410. n.Font.addKerning(101, 39, -2);
  3411. n.Font.addKerning(101, 49, -4);
  3412. n.Font.addKerning(101, 92, -2);
  3413. n.Font.addKerning(102, 34, -1);
  3414. n.Font.addKerning(102, 39, -2);
  3415. n.Font.addKerning(102, 41, -2);
  3416. n.Font.addKerning(102, 44, -4);
  3417. n.Font.addKerning(102, 46, -4);
  3418. n.Font.addKerning(102, 47, -2);
  3419. n.Font.addKerning(102, 49, -4);
  3420. n.Font.addKerning(102, 51, -2);
  3421. n.Font.addKerning(102, 58, -2);
  3422. n.Font.addKerning(102, 59, -2);
  3423. n.Font.addKerning(102, 63, -2);
  3424. n.Font.addKerning(102, 93, -2);
  3425. n.Font.addKerning(102, 106, -3);
  3426. n.Font.addKerning(103, 39, -2);
  3427. n.Font.addKerning(103, 44, -2);
  3428. n.Font.addKerning(103, 46, -2);
  3429. n.Font.addKerning(103, 49, -4);
  3430. n.Font.addKerning(103, 58, -2);
  3431. n.Font.addKerning(103, 59, -2);
  3432. n.Font.addKerning(103, 92, -2);
  3433. n.Font.addKerning(104, 34, -3);
  3434. n.Font.addKerning(104, 39, -4);
  3435. n.Font.addKerning(104, 49, -4);
  3436. n.Font.addKerning(104, 55, -3);
  3437. n.Font.addKerning(104, 63, -3);
  3438. n.Font.addKerning(104, 92, -3);
  3439. n.Font.addKerning(104, 116, -2);
  3440. n.Font.addKerning(105, 49, -2);
  3441. n.Font.addKerning(106, 39, -2);
  3442. n.Font.addKerning(106, 49, -3);
  3443. n.Font.addKerning(106,
  3444. 55, -2);
  3445. n.Font.addKerning(107, 39, -2);
  3446. n.Font.addKerning(107, 49, -3);
  3447. n.Font.addKerning(108, 34, -2);
  3448. n.Font.addKerning(108, 35, -2);
  3449. n.Font.addKerning(108, 39, -3);
  3450. n.Font.addKerning(108, 45, -2);
  3451. n.Font.addKerning(108, 49, -4);
  3452. n.Font.addKerning(108, 55, -3);
  3453. n.Font.addKerning(108, 63, -3);
  3454. n.Font.addKerning(108, 92, -2);
  3455. n.Font.addKerning(108, 102, -2);
  3456. n.Font.addKerning(108, 113, -2);
  3457. n.Font.addKerning(108, 116, -2);
  3458. n.Font.addKerning(109, 39, -2);
  3459. n.Font.addKerning(109, 46, -2);
  3460. n.Font.addKerning(109, 49, -3);
  3461. n.Font.addKerning(109, 58, -2);
  3462. n.Font.addKerning(109, 59, -2);
  3463. n.Font.addKerning(110, 39, -2);
  3464. n.Font.addKerning(110, 49, -4);
  3465. n.Font.addKerning(110, 58, -2);
  3466. n.Font.addKerning(110, 59, -2);
  3467. n.Font.addKerning(111, 39, -3);
  3468. n.Font.addKerning(111, 46, -2);
  3469. n.Font.addKerning(111, 49, -4);
  3470. n.Font.addKerning(111, 55, -2);
  3471. n.Font.addKerning(111, 58, -2);
  3472. n.Font.addKerning(111, 59, -2);
  3473. n.Font.addKerning(111, 63, -2);
  3474. n.Font.addKerning(111, 92, -2);
  3475. n.Font.addKerning(112, 39, -2);
  3476. n.Font.addKerning(112, 41, -2);
  3477. n.Font.addKerning(112, 44, -4);
  3478. n.Font.addKerning(112, 46, -4);
  3479. n.Font.addKerning(112,
  3480. 47, -2);
  3481. n.Font.addKerning(112, 49, -4);
  3482. n.Font.addKerning(112, 51, -2);
  3483. n.Font.addKerning(112, 58, -2);
  3484. n.Font.addKerning(112, 59, -2);
  3485. n.Font.addKerning(112, 93, -2);
  3486. n.Font.addKerning(112, 106, -5);
  3487. n.Font.addKerning(113, 39, -2);
  3488. n.Font.addKerning(113, 49, -3);
  3489. n.Font.addKerning(114, 41, -2);
  3490. n.Font.addKerning(114, 44, -6);
  3491. n.Font.addKerning(114, 45, -1);
  3492. n.Font.addKerning(114, 46, -6);
  3493. n.Font.addKerning(114, 47, -3);
  3494. n.Font.addKerning(114, 49, -4);
  3495. n.Font.addKerning(114, 99, -1);
  3496. n.Font.addKerning(114, 100, -2);
  3497. n.Font.addKerning(114, 106, -5);
  3498. n.Font.addKerning(114, 111, -1);
  3499. n.Font.addKerning(115, 39, -2);
  3500. n.Font.addKerning(115, 49, -4);
  3501. n.Font.addKerning(116, 49, -3);
  3502. n.Font.addKerning(117, 39, -2);
  3503. n.Font.addKerning(117, 44, -2);
  3504. n.Font.addKerning(117, 46, -2);
  3505. n.Font.addKerning(117, 49, -3);
  3506. n.Font.addKerning(117, 58, -2);
  3507. n.Font.addKerning(117, 59, -2);
  3508. n.Font.addKerning(118, 44, -2);
  3509. n.Font.addKerning(118, 46, -3);
  3510. n.Font.addKerning(118, 49, -2);
  3511. n.Font.addKerning(119, 44, -2);
  3512. n.Font.addKerning(119, 46, -2);
  3513. n.Font.addKerning(119, 49, -3);
  3514. n.Font.addKerning(120, 49, -3);
  3515. n.Font.addKerning(120,
  3516. 52, -2);
  3517. n.Font.addKerning(121, 44, -4);
  3518. n.Font.addKerning(121, 46, -4);
  3519. n.Font.addKerning(121, 47, -3);
  3520. n.Font.addKerning(121, 49, -2);
  3521. n.Font.addKerning(121, 106, -3);
  3522. n.Font.addKerning(122, 39, -2);
  3523. n.Font.RegisterCharacters()
  3524. };
  3525. var T = function () {};
  3526. s.Globals = T;
  3527. T.__name__ = ["Globals"];
  3528. T.Init = function () {
  3529. T.levelsXML = O.parse(y.Resource.getString("levels")).firstElement();
  3530. T.levelsXMLLoaded = !0;
  3531. T.definitionsXML = O.parse(y.Resource.getString("definitions")).firstElement();
  3532. T.definitionsXMLLoaded = !0;
  3533. T.load()
  3534. };
  3535. T.load = function () {
  3536. T.so =
  3537. k.net.SharedObject.getLocal("we_save_it3");
  3538. if (null == T.so.data || null == T.so.data.levelScores) {
  3539. T.so.data.edit_data = "<level/>";
  3540. T.so.data.levelScores = [];
  3541. for (var a = 0, b = T.NUMLEVELS; a < b;) {
  3542. var d = a++;
  3543. T.so.data.levelScores[d] = -1
  3544. }
  3545. }
  3546. T.edit_data = O.parse(F.Boot.__cast(T.so.data.edit_data, String)).firstElement();
  3547. T.levelScores = T.so.data.levelScores
  3548. };
  3549. T.save = function () {
  3550. T.so.data.edit_data = T.edit_data.toString();
  3551. T.so.data.levelScores = T.levelScores;
  3552. var a = null;
  3553. try {
  3554. a = F.Boot.__cast(T.so.flush(), String)
  3555. } catch (b) {
  3556. y.Log.trace("couldnt write...", {
  3557. fileName: "Globals.hx",
  3558. lineNumber: 74,
  3559. className: "Globals",
  3560. methodName: "save"
  3561. })
  3562. }
  3563. null != a && (a == F.Boot.__cast(k.net.SharedObjectFlushStatus.PENDING, String) && y.Log.trace("requesting permission to save", {
  3564. fileName: "Globals.hx",
  3565. lineNumber: 88,
  3566. className: "Globals",
  3567. methodName: "save"
  3568. }), a == F.Boot.__cast(k.net.SharedObjectFlushStatus.FLUSHED, String) && y.Log.trace("value saved", {
  3569. fileName: "Globals.hx",
  3570. lineNumber: 91,
  3571. className: "Globals",
  3572. methodName: "save"
  3573. }))
  3574. };
  3575. T.moreGames = function (a) {
  3576. // Play68.goHome();
  3577. };
  3578. var S = function () {};
  3579. s.HxOverrides = S;
  3580. S.__name__ = ["HxOverrides"];
  3581. S.dateStr = function (a) {
  3582. var b = a.getMonth() + 1,
  3583. d = a.getDate(),
  3584. c = a.getHours(),
  3585. e = a.getMinutes(),
  3586. f = a.getSeconds();
  3587. return a.getFullYear() + "-" + (10 > b ? "0" + b : "" + b) + "-" + (10 > d ? "0" + d : "" + d) + " " + (10 > c ? "0" + c : "" + c) + ":" + (10 > e ? "0" + e : "" + e) + ":" + (10 > f ? "0" + f : "" + f)
  3588. };
  3589. S.strDate = function (a) {
  3590. switch (a.length) {
  3591. case 8:
  3592. a = a.split(":");
  3593. var b = new Date;
  3594. b.setTime(0);
  3595. b.setUTCHours(a[0]);
  3596. b.setUTCMinutes(a[1]);
  3597. b.setUTCSeconds(a[2]);
  3598. return b;
  3599. case 10:
  3600. return a = a.split("-"), new Date(a[0],
  3601. a[1] - 1, a[2], 0, 0, 0);
  3602. case 19:
  3603. return a = a.split(" "), b = a[0].split("-"), a = a[1].split(":"), new Date(b[0], b[1] - 1, b[2], a[0], a[1], a[2]);
  3604. default:
  3605. throw "Invalid date format : " + a;
  3606. }
  3607. };
  3608. S.cca = function (a, b) {
  3609. var d = a.charCodeAt(b);
  3610. return d != d ? void 0 : d
  3611. };
  3612. S.substr = function (a, b, d) {
  3613. if (null != b && 0 != b && null != d && 0 > d) return "";
  3614. null == d && (d = a.length);
  3615. 0 > b ? (b = a.length + b, 0 > b && (b = 0)) : 0 > d && (d = a.length + d - b);
  3616. return a.substr(b, d)
  3617. };
  3618. S.remove = function (a, b) {
  3619. for (var d = 0, c = a.length; d < c;) {
  3620. if (a[d] == b) return a.splice(d, 1), !0;
  3621. d++
  3622. }
  3623. return !1
  3624. };
  3625. S.iter =
  3626. function (a) {
  3627. return {
  3628. cur: 0,
  3629. arr: a,
  3630. hasNext: function () {
  3631. return this.cur < this.arr.length
  3632. },
  3633. next: function () {
  3634. return this.arr[this.cur++]
  3635. }
  3636. }
  3637. };
  3638. var D = function () {};
  3639. s.Input = D;
  3640. D.__name__ = ["Input"];
  3641. D.key = function (a) {
  3642. return S.cca(a, 0)
  3643. };
  3644. D.init = function (a) {
  3645. D.mouseWheelDelta = 0;
  3646. D.mctrl = !1;
  3647. D.mshift = !1;
  3648. D.kctrl = !1;
  3649. D.kshift = !1;
  3650. D.down = [];
  3651. D.kproc = [];
  3652. for (var b = 0; 256 > b;) b++, D.down.push(!1), D.kproc.push(!1);
  3653. D.hasFocus = !0;
  3654. D.iDoc = a;
  3655. D.iStage = a.get_stage();
  3656. a.get_stage().addEventListener("keydown", D.keyDownHandler);
  3657. a.get_stage().addEventListener("keyup",
  3658. D.keyUpHandler);
  3659. a.get_stage().addEventListener("mousemove", D.mouseMoveHandler);
  3660. a.get_stage().addEventListener("mousedown", D.mouseDownHandler);
  3661. a.get_stage().addEventListener("mouseup", D.mouseUpHandler);
  3662. a.get_stage().addEventListener("mousewheel", D.mouseWheelHandler);
  3663. a.get_stage().addEventListener("focusOut", D.focusOutHandler);
  3664. a.get_stage().addEventListener("focusIn", D.focusInHandler)
  3665. };
  3666. D.reFocus = function (a) {
  3667. D.iStage.focus != D.iStage && (D.iStage.focus = D.iStage)
  3668. };
  3669. D.keyDownHandler = function (a) {
  3670. D.down[a.keyCode %
  3671. 256] = !0;
  3672. D.kshift = a.shiftKey;
  3673. D.kctrl = a.ctrlKey
  3674. };
  3675. D.keyUpHandler = function (a) {
  3676. a = a.keyCode;
  3677. D.down[a % 256] = !1;
  3678. D.kproc[a % 256] = !1
  3679. };
  3680. D.mouseMoveHandler = function (a) {
  3681. D.mx = a.get_stageX() - D.mOffsetX;
  3682. D.my = a.get_stageY() - D.mOffsetY;
  3683. D.mx -= Z.PlatformHTML5.offsetX;
  3684. D.my -= Z.PlatformHTML5.offsetY;
  3685. D.mx /= R.instance.scaleX;
  3686. D.my /= R.instance.scaleY
  3687. };
  3688. D.mouseWheelHandler = function (a) {
  3689. D.mouseWheelDelta = a.get_delta()
  3690. };
  3691. D.mouseDownHandler = function (a) {
  3692. D.mx = a.get_stageX() - D.mOffsetX;
  3693. D.my = a.get_stageY() - D.mOffsetY;
  3694. D.mx -= Z.PlatformHTML5.offsetX;
  3695. D.my -= Z.PlatformHTML5.offsetY;
  3696. D.mx /= R.instance.scaleX;
  3697. D.my /= R.instance.scaleY;
  3698. D.clicked = !0;
  3699. var b = q.OzSprite.GetSpriteAtPoint(R.instance.doc, D.mx, D.my);
  3700. null != b && null != b.eventListeners && b.eventListeners.exists(2) ? b.eventListeners.get(2)(new q.OzEvent(b)) : null != b && null != b.eventListeners && b.eventListeners.exists(1) || (D.mdown = !0);
  3701. D.mup = !1;
  3702. D.mctrl = a.ctrlKey;
  3703. D.mshift = a.shiftKey
  3704. };
  3705. D.mouseUpHandler = function (a) {
  3706. D.mdown = !1;
  3707. D.mup = !0
  3708. };
  3709. D.touchMoveHandler = function (a) {
  3710. D.mx = a.stageX - D.mOffsetX;
  3711. D.my = a.stageY - D.mOffsetY;
  3712. D.mx -= Z.PlatformHTML5.offsetX;
  3713. D.my -= Z.PlatformHTML5.offsetY;
  3714. D.mx /= R.instance.scaleX;
  3715. D.my /= R.instance.scaleY
  3716. };
  3717. D.touchDownHandler = function (a) {
  3718. D.mx = a.stageX - D.mOffsetX;
  3719. D.my = a.stageY - D.mOffsetY;
  3720. D.mx -= Z.PlatformHTML5.offsetX;
  3721. D.my -= Z.PlatformHTML5.offsetY;
  3722. D.mx /= R.instance.scaleX;
  3723. D.my /= R.instance.scaleY;
  3724. D.clicked = !0;
  3725. var b = q.OzSprite.GetSpriteAtPoint(R.instance.doc, D.mx, D.my);
  3726. null != b && null != b.eventListeners && b.eventListeners.exists(2) ? b.eventListeners.get(2)(new q.OzEvent(b)) : null != b && null != b.eventListeners &&
  3727. b.eventListeners.exists(1) || (D.mdown = !0);
  3728. D.mup = !1;
  3729. D.mctrl = a.ctrlKey;
  3730. D.mshift = a.shiftKey
  3731. };
  3732. D.touchUpHandler = function (a) {
  3733. D.mdown = !1;
  3734. D.mup = !0
  3735. };
  3736. D.focusOutHandler = function (a) {
  3737. D.hasFocus = !1;
  3738. for (a = 0; 256 > a;) a++
  3739. };
  3740. D.focusInHandler = function (a) {
  3741. D.hasFocus = !0
  3742. };
  3743. var la = function () {
  3744. this.length = 0
  3745. };
  3746. s.List = la;
  3747. la.__name__ = ["List"];
  3748. la.prototype = {
  3749. iterator: function () {
  3750. return {
  3751. h: this.h,
  3752. hasNext: function () {
  3753. return null != this.h
  3754. },
  3755. next: function () {
  3756. if (null == this.h) return null;
  3757. var a = this.h[0];
  3758. this.h = this.h[1];
  3759. return a
  3760. }
  3761. }
  3762. },
  3763. add: function (a) {
  3764. a = [a];
  3765. null == this.h ? this.h = a : this.q[1] = a;
  3766. this.q = a;
  3767. this.length++
  3768. },
  3769. __class__: la
  3770. };
  3771. var ca = function () {};
  3772. s.IMap = ca;
  3773. ca.__name__ = ["IMap"];
  3774. var ga = function () {
  3775. k.display.Sprite.call(this);
  3776. var a = this.getBackgroundColor(),
  3777. b = 0;
  3778. 70 > 0.299 * (a >> 16 & 255) + 0.587 * (a >> 8 & 255) + 0.114 * (a & 255) && (b = 16777215);
  3779. var a = this.getHeight() / 2 - 4.5,
  3780. d = this.getWidth() - 60;
  3781. this.outline = new k.display.Sprite;
  3782. this.outline.get_graphics().lineStyle(1, b, 0.15, !0);
  3783. this.outline.get_graphics().drawRoundRect(0, 0, d, 9, 6, 6);
  3784. this.outline.set_x(30);
  3785. this.outline.set_y(a);
  3786. this.addChild(this.outline);
  3787. this.progress = new k.display.Sprite;
  3788. this.progress.get_graphics().beginFill(b, 0.35);
  3789. this.progress.get_graphics().drawRect(0, 0, d - 6, 3);
  3790. this.progress.set_x(33);
  3791. this.progress.set_y(a + 3);
  3792. this.progress.set_scaleX(0);
  3793. this.addChild(this.progress)
  3794. };
  3795. s.NMEPreloader = ga;
  3796. ga.__name__ = ["NMEPreloader"];
  3797. ga.__super__ = k.display.Sprite;
  3798. ga.prototype = I(k.display.Sprite.prototype, {
  3799. onUpdate: function (a, b) {
  3800. var d = a / b;
  3801. 1 < d && 1 == d;
  3802. this.progress.set_scaleX(d)
  3803. },
  3804. onLoaded: function () {
  3805. this.dispatchEvent(new k.events.Event("complete"))
  3806. },
  3807. onInit: function () {},
  3808. getWidth: function () {
  3809. return k.Lib.get_current().get_stage().get_stageWidth()
  3810. },
  3811. getHeight: function () {
  3812. return k.Lib.get_current().get_stage().get_stageHeight()
  3813. },
  3814. getBackgroundColor: function () {
  3815. return 0
  3816. },
  3817. __class__: ga
  3818. });
  3819. var E = function () {};
  3820. s.Objects = E;
  3821. E.__name__ = ["Objects"];
  3822. E.Register = function () {
  3823. E.MovieClips = [E.bmpBrick, E.btnBack, E.btnCredits, E.btnIconPlay, E.btnLevels, E.btnMoreGames, E.btnNext, E.btnPause, E.btnPlay, E.btnRestart, E.cmcBG, E.cmcBGGGG, E.cmcBlock12x1, E.cmcBlock1x1, E.cmcBlock1x12,
  3824. E.cmcBlock2x2, E.cmcBlock4x4, E.cmcCircle2x2, E.cmcCircle4x4, E.cmcClockArrow, E.cmcClockBG, E.cmcCreditsText, E.cmcDialogBG, E.cmcGGGBig, E.cmcHooda, E.cmcInstructions, E.cmcLevelSelectButton, E.cmcNext, E.cmcPausedText, E.cmcSelectALevel, E.cmcStaticBlock2x2, E.cmcSuperHoodaTitle, E.cmcTriangle2x2, E.cmcTriangle4x4, E.cmcYouLoseText, E.cmcYouWinText, E.hoodaGameObject, E.sponsorGGG
  3825. ];
  3826. q.OzSprite.RegisterTilesheet(E.BitmapName, E.MovieClips, E.Frames)
  3827. };
  3828. var ba = function () {};
  3829. s.ObjectsLayouts = ba;
  3830. ba.__name__ = ["ObjectsLayouts"];
  3831. ba.cmcGGG = function (a) {
  3832. var b;
  3833. b = new q.OzSprite(E.cmcBGGGG);
  3834. a.addChild(b);
  3835. b.name = "bg";
  3836. b.x = -2;
  3837. b.y = 0;
  3838. b.rotation = 0;
  3839. b.scaleX = 10;
  3840. b.scaleY = 10;
  3841. b.alpha = 1;
  3842. b = new q.OzSprite(E.cmcGGGBig);
  3843. a.addChild(b);
  3844. b.name = "sponsor";
  3845. b.x = 0;
  3846. b.y = 4.05;
  3847. b.rotation = 0;
  3848. b.scaleX = 1;
  3849. b.scaleY = 1;
  3850. b.alpha = 1
  3851. };
  3852. ba.cmcClock = function (a) {
  3853. var b;
  3854. b = new q.OzSprite(E.cmcClockBG);
  3855. a.addChild(b);
  3856. b.name = "";
  3857. b.x = 0;
  3858. b.y = 0;
  3859. b.rotation = 0;
  3860. b.scaleX = 1;
  3861. b.scaleY = 1;
  3862. b.alpha = 1;
  3863. b = new q.OzSprite(E.cmcClockArrow);
  3864. a.addChild(b);
  3865. b.name = "arrow";
  3866. b.x = 0.25;
  3867. b.y = 0.35;
  3868. b.rotation = 0;
  3869. b.scaleX = 1;
  3870. b.scaleY = 1;
  3871. b.alpha = 1
  3872. };
  3873. ba.cmcCredits = function (a) {
  3874. var b;
  3875. b = new q.OzSprite(E.cmcBG);
  3876. a.addChild(b);
  3877. b.name = "";
  3878. b.x = 0;
  3879. b.y = 0;
  3880. b.rotation = 0;
  3881. b.scaleX = 1;
  3882. b.scaleY = 1;
  3883. b.alpha = 1;
  3884. b = new q.OzSprite(E.btnBack);
  3885. a.addChild(b);
  3886. b.name = "btnBack";
  3887. b.x = 296;
  3888. b.y = 492.9;
  3889. b.rotation = 0;
  3890. b.scaleX = 1;
  3891. b.scaleY = 1;
  3892. b.alpha = 1;
  3893. b = new q.OzSprite(E.cmcCreditsText);
  3894. a.addChild(b);
  3895. b.name = "";
  3896. b.x = 113;
  3897. b.y = 101.05;
  3898. b.rotation = 0;
  3899. b.scaleX = 1;
  3900. b.scaleY = 1;
  3901. b.alpha = 1;
  3902. b = new q.OzSprite(E.sponsorGGG);
  3903. a.addChild(b);
  3904. b.name = "sponsor";
  3905. b.x = 229.95;
  3906. b.y = 380.45;
  3907. b.rotation = 0;
  3908. b.scaleX = 1;
  3909. b.scaleY = 1;
  3910. b.alpha = 1
  3911. };
  3912. ba.cmcLevels = function (a) {
  3913. var b;
  3914. b = new q.OzSprite(E.cmcBG);
  3915. a.addChild(b);
  3916. b.name = "";
  3917. b.x = 0;
  3918. b.y = 0;
  3919. b.rotation = 0;
  3920. b.scaleX = 1;
  3921. b.scaleY = 1;
  3922. b.alpha = 1;
  3923. b = new q.OzSprite(E.btnBack);
  3924. a.addChild(b);
  3925. b.name = "btnBack";
  3926. b.x = 159.95;
  3927. b.y = 554.9;
  3928. b.rotation = 0;
  3929. b.scaleX = 1;
  3930. b.scaleY = 1;
  3931. b.alpha = 1;
  3932. b = new q.OzSprite(E.cmcSelectALevel);
  3933. a.addChild(b);
  3934. b.name = "";
  3935. b.x = 241.6;
  3936. b.y = 42.85;
  3937. b.rotation = 0;
  3938. b.scaleX = 1;
  3939. b.scaleY = 1;
  3940. b.alpha = 1;
  3941. b = new q.OzSprite(E.sponsorGGG);
  3942. a.addChild(b);
  3943. b.name = "sponsor";
  3944. b.x = 328.7;
  3945. b.y = 558.4;
  3946. b.rotation = 0;
  3947. b.scaleX = 0.8950958251953125;
  3948. b.scaleY = 0.8950958251953125;
  3949. b.alpha = 1
  3950. };
  3951. ba.cmcMenu = function (a) {
  3952. var b;
  3953. b = new q.OzSprite(E.cmcBG);
  3954. a.addChild(b);
  3955. b.name = "";
  3956. b.x = 0;
  3957. b.y = 0;
  3958. b.rotation = 0;
  3959. b.scaleX = 1;
  3960. b.scaleY = 1;
  3961. b.alpha = 1;
  3962. b = new q.OzSprite(E.sponsorGGG);
  3963. a.addChild(b);
  3964. b.name = "sponsor";
  3965. b.x = 243;
  3966. b.y = 569.4;
  3967. b.rotation = 0;
  3968. b.scaleX = 1;
  3969. b.scaleY = 1;
  3970. b.alpha = 1;
  3971. b = new q.OzSprite(E.cmcSuperHoodaTitle);
  3972. a.addChild(b);
  3973. b.name = "";
  3974. b.x = 241;
  3975. b.y = 90.4;
  3976. b.rotation = 0;
  3977. b.scaleX = 1.1876220703125;
  3978. b.scaleY = 1.1876220703125;
  3979. b.alpha =
  3980. 1;
  3981. b = new q.OzSprite(E.btnPlay);
  3982. a.addChild(b);
  3983. b.name = "btnPlay";
  3984. b.x = 325.6;
  3985. b.y = 382.4;
  3986. b.rotation = 0;
  3987. b.scaleX = 1;
  3988. b.scaleY = 1;
  3989. b.alpha = 1;
  3990. b = new q.OzSprite(E.btnCredits);
  3991. a.addChild(b);
  3992. b.name = "btnCredits";
  3993. b.x = 325.55;
  3994. b.y = 514.25;
  3995. b.rotation = 0;
  3996. b.scaleX = 1;
  3997. b.scaleY = 1;
  3998. b.alpha = 1;
  3999. b = new q.OzSprite(E.btnMoreGames);
  4000. a.addChild(b);
  4001. b.name = "btnMore";
  4002. b.x = 335.8;
  4003. b.y = 449.15;
  4004. b.rotation = 0;
  4005. b.scaleX = 1;
  4006. b.scaleY = 1;
  4007. b.alpha = 1
  4008. };
  4009. ba.cmcPaused = function (a) {
  4010. var b;
  4011. b = new q.OzSprite(E.cmcDialogBG);
  4012. a.addChild(b);
  4013. b.name = "";
  4014. b.x = 0;
  4015. b.y = 0;
  4016. b.rotation = 0;
  4017. b.scaleX = 10;
  4018. b.scaleY = 10;
  4019. b.alpha = 1;
  4020. b = new q.OzSprite(E.btnRestart);
  4021. a.addChild(b);
  4022. b.name = "btnRestart";
  4023. b.x = 122.9;
  4024. b.y = 17.7;
  4025. b.rotation = 0;
  4026. b.scaleX = 1;
  4027. b.scaleY = 1;
  4028. b.alpha = 1;
  4029. b = new q.OzSprite(E.btnLevels);
  4030. a.addChild(b);
  4031. b.name = "btnLevels";
  4032. b.x = 0.2;
  4033. b.y = 17.7;
  4034. b.rotation = 0;
  4035. b.scaleX = 1;
  4036. b.scaleY = 1;
  4037. b.alpha = 1;
  4038. b = new q.OzSprite(E.cmcPausedText);
  4039. a.addChild(b);
  4040. b.name = "";
  4041. b.x = -0.35;
  4042. b.y = -85.15;
  4043. b.rotation = 0;
  4044. b.scaleX = 1;
  4045. b.scaleY = 1;
  4046. b.alpha = 1;
  4047. b = new q.OzSprite(E.btnIconPlay);
  4048. a.addChild(b);
  4049. b.name = "btnPlay";
  4050. b.x = -127.95;
  4051. b.y = 23.5;
  4052. b.rotation =
  4053. 0;
  4054. b.scaleX = 1;
  4055. b.scaleY = 1;
  4056. b.alpha = 1;
  4057. b = new q.OzSprite(E.btnMoreGames);
  4058. a.addChild(b);
  4059. b.name = "btnMore";
  4060. b.x = 101.45;
  4061. b.y = 136.95;
  4062. b.rotation = 0;
  4063. b.scaleX = 1;
  4064. b.scaleY = 1;
  4065. b.alpha = 1
  4066. };
  4067. ba.cmcPlay = function (a) {
  4068. var b;
  4069. b = new q.OzSprite(E.cmcBG);
  4070. a.addChild(b);
  4071. b.name = "";
  4072. b.x = 0;
  4073. b.y = 0;
  4074. b.rotation = 0;
  4075. b.scaleX = 1;
  4076. b.scaleY = 1;
  4077. b.alpha = 1;
  4078. b = new q.OzSprite(E.cmcNext);
  4079. a.addChild(b);
  4080. b.name = "";
  4081. b.x = 240;
  4082. b.y = 22.05;
  4083. b.rotation = 0;
  4084. b.scaleX = 1;
  4085. b.scaleY = 1;
  4086. b.alpha = 1;
  4087. b = new q.OzSprite(E.btnPause);
  4088. a.addChild(b);
  4089. b.name = "btnPause";
  4090. b.x = 443.35;
  4091. b.y = 568.25;
  4092. b.rotation =
  4093. 0;
  4094. b.scaleX = 1;
  4095. b.scaleY = 1;
  4096. b.alpha = 1;
  4097. b = new q.OzSprite(E.cmcInstructions);
  4098. a.addChild(b);
  4099. b.name = "instructions";
  4100. b.x = 112;
  4101. b.y = 278.45;
  4102. b.rotation = 0;
  4103. b.scaleX = 1;
  4104. b.scaleY = 1;
  4105. b.alpha = 1;
  4106. b = new q.OzSprite(E.sponsorGGG);
  4107. a.addChild(b);
  4108. b.name = "sponsor";
  4109. b.x = 128.45;
  4110. b.y = 572.7;
  4111. b.rotation = 0;
  4112. b.scaleX = 1;
  4113. b.scaleY = 1;
  4114. b.alpha = 1
  4115. };
  4116. ba.cmcYouLose = function (a) {
  4117. var b;
  4118. b = new q.OzSprite(E.cmcDialogBG);
  4119. a.addChild(b);
  4120. b.name = "";
  4121. b.x = 0;
  4122. b.y = 0.05;
  4123. b.rotation = 0;
  4124. b.scaleX = 10;
  4125. b.scaleY = 10;
  4126. b.alpha = 1;
  4127. b = new q.OzSprite(E.cmcYouLoseText);
  4128. a.addChild(b);
  4129. b.name =
  4130. "";
  4131. b.x = 4.8;
  4132. b.y = -111.15;
  4133. b.rotation = 0;
  4134. b.scaleX = 1;
  4135. b.scaleY = 1;
  4136. b.alpha = 1;
  4137. b = new q.OzSprite(E.btnRestart);
  4138. a.addChild(b);
  4139. b.name = "btnRestart";
  4140. b.x = 66.9;
  4141. b.y = 2.9;
  4142. b.rotation = 0;
  4143. b.scaleX = 1;
  4144. b.scaleY = 1;
  4145. b.alpha = 1;
  4146. b = new q.OzSprite(E.btnLevels);
  4147. a.addChild(b);
  4148. b.name = "btnLevels";
  4149. b.x = -60.8;
  4150. b.y = 2.9;
  4151. b.rotation = 0;
  4152. b.scaleX = 1;
  4153. b.scaleY = 1;
  4154. b.alpha = 1;
  4155. b = new q.OzSprite(E.btnMoreGames);
  4156. a.addChild(b);
  4157. b.name = "btnMore";
  4158. b.x = 96.45;
  4159. b.y = 116.95;
  4160. b.rotation = 0;
  4161. b.scaleX = 1;
  4162. b.scaleY = 1;
  4163. b.alpha = 1
  4164. };
  4165. ba.cmcYouWin = function (a) {
  4166. var b;
  4167. b = new q.OzSprite(E.cmcDialogBG);
  4168. a.addChild(b);
  4169. b.name = "";
  4170. b.x = 0;
  4171. b.y = 0;
  4172. b.rotation = 0;
  4173. b.scaleX = 10;
  4174. b.scaleY = 10;
  4175. b.alpha = 1;
  4176. b = new q.OzSprite(E.cmcYouWinText);
  4177. a.addChild(b);
  4178. b.name = "";
  4179. b.x = -2.25;
  4180. b.y = -115.1;
  4181. b.rotation = 0;
  4182. b.scaleX = 1;
  4183. b.scaleY = 1;
  4184. b.alpha = 1;
  4185. b = new q.OzSprite(E.btnRestart);
  4186. a.addChild(b);
  4187. b.name = "btnRestart";
  4188. b.x = 0.75;
  4189. b.y = 1.95;
  4190. b.rotation = 0;
  4191. b.scaleX = 1;
  4192. b.scaleY = 1;
  4193. b.alpha = 1;
  4194. b = new q.OzSprite(E.btnLevels);
  4195. a.addChild(b);
  4196. b.name = "btnLevels";
  4197. b.x = -126.95;
  4198. b.y = 1.95;
  4199. b.rotation = 0;
  4200. b.scaleX = 1;
  4201. b.scaleY = 1;
  4202. b.alpha = 1;
  4203. b = new q.OzSprite(E.btnNext);
  4204. a.addChild(b);
  4205. b.name = "btnNext";
  4206. b.x = 128.05;
  4207. b.y = 1.95;
  4208. b.rotation = 0;
  4209. b.scaleX = 1;
  4210. b.scaleY = 1;
  4211. b.alpha = 1;
  4212. b = new q.OzSprite(E.btnMoreGames);
  4213. a.addChild(b);
  4214. b.name = "btnMore";
  4215. b.x = 107.45;
  4216. b.y = 125.9;
  4217. b.rotation = 0;
  4218. b.scaleX = 1;
  4219. b.scaleY = 1;
  4220. b.alpha = 1
  4221. };
  4222. var ja = function () {
  4223. this._painted = !1;
  4224. ga.call(this);
  4225. this.set_visible(!1)
  4226. };
  4227. s.Preloader = ja;
  4228. ja.__name__ = ["Preloader"];
  4229. ja.__super__ = ga;
  4230. ja.prototype = I(ga.prototype, {
  4231. putBitmap: function (a) {
  4232. y.Log.trace("adding bitmap!", {
  4233. fileName: "Preloader.hx",
  4234. lineNumber: 39,
  4235. className: "Preloader",
  4236. methodName: "putBitmap",
  4237. customParams: [a.component.width, a.component.height]
  4238. });
  4239. this.set_visible(!0);
  4240. a = new k.display.Bitmap(a);
  4241. this.addChildAt(a, 0);
  4242. a.set_scaleX(a.set_scaleY(this.getWidth() / a.bitmapData.component.width));
  4243. a.addEventListener("click", T.moreGames)
  4244. },
  4245. onUpdate: function (a, b) {
  4246. ga.prototype.onUpdate.call(this, a, b);
  4247. if (!this._painted) try {
  4248. var d = J.Assets.getBitmapData("assets/ggg.png");
  4249. this.putBitmap(d);
  4250. this._painted = !0
  4251. } catch (c) {}
  4252. },
  4253. __class__: ja
  4254. });
  4255. var W = function () {};
  4256. s.Reflect = W;
  4257. W.__name__ = ["Reflect"];
  4258. W.hasField = function (a,
  4259. b) {
  4260. return Object.prototype.hasOwnProperty.call(a, b)
  4261. };
  4262. W.field = function (a, b) {
  4263. var d = null;
  4264. try {
  4265. d = a[b]
  4266. } catch (c) {}
  4267. return d
  4268. };
  4269. W.fields = function (a) {
  4270. var b = [];
  4271. if (null != a) {
  4272. var d = Object.prototype.hasOwnProperty,
  4273. c;
  4274. for (c in a) "__id__" != c && "hx__closures__" != c && d.call(a, c) && b.push(c)
  4275. }
  4276. return b
  4277. };
  4278. W.isFunction = function (a) {
  4279. return "function" == typeof a && !(a.__name__ || a.__ename__)
  4280. };
  4281. W.compareMethods = function (a, b) {
  4282. return a == b ? !0 : W.isFunction(a) && W.isFunction(b) ? a.scope == b.scope && a.method == b.method && null != a.method : !1
  4283. };
  4284. W.deleteField =
  4285. function (a, b) {
  4286. if (!W.hasField(a, b)) return !1;
  4287. delete a[b];
  4288. return !0
  4289. };
  4290. W.copy = function (a) {
  4291. for (var b = {}, d = 0, c = W.fields(a); d < c.length;) {
  4292. var e = c[d];
  4293. ++d;
  4294. b[e] = W.field(a, e)
  4295. }
  4296. return b
  4297. };
  4298. var K = function () {};
  4299. s.Std = K;
  4300. K.__name__ = ["Std"];
  4301. K.string = function (a) {
  4302. return F.Boot.__string_rec(a, "")
  4303. };
  4304. K.parseInt = function (a) {
  4305. var b = parseInt(a, 10);
  4306. 0 != b || 120 != S.cca(a, 1) && 88 != S.cca(a, 1) || (b = parseInt(a));
  4307. return isNaN(b) ? null : b
  4308. };
  4309. K.parseFloat = function (a) {
  4310. return parseFloat(a)
  4311. };
  4312. var fa = function () {
  4313. this.b = ""
  4314. };
  4315. s.StringBuf = fa;
  4316. fa.__name__ = ["StringBuf"];
  4317. fa.prototype = {
  4318. addSub: function (a, b, d) {
  4319. this.b += null == d ? S.substr(a, b, null) : S.substr(a, b, d)
  4320. },
  4321. __class__: fa
  4322. };
  4323. var $ = function () {};
  4324. s.StringTools = $;
  4325. $.__name__ = ["StringTools"];
  4326. $.urlEncode = function (a) {
  4327. return encodeURIComponent(a)
  4328. };
  4329. $.urlDecode = function (a) {
  4330. return decodeURIComponent(a.split("+").join(" "))
  4331. };
  4332. $.htmlEscape = function (a, b) {
  4333. a = a.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
  4334. return b ? a.split('"').join("&quot;").split("'").join("&#039;") : a
  4335. };
  4336. $.startsWith = function (a, b) {
  4337. return a.length >=
  4338. b.length && S.substr(a, 0, b.length) == b
  4339. };
  4340. $.replace = function (a, b, d) {
  4341. return a.split(b).join(d)
  4342. };
  4343. $.hex = function (a, b) {
  4344. var d = "";
  4345. do d = "0123456789ABCDEF".charAt(a & 15) + d, a >>>= 4; while (0 < a);
  4346. if (null != b)
  4347. for (; d.length < b;) d = "0" + d;
  4348. return d
  4349. };
  4350. var U = s.ValueType = {
  4351. __ename__: ["ValueType"],
  4352. __constructs__: "TNull TInt TFloat TBool TObject TFunction TClass TEnum TUnknown".split(" ")
  4353. };
  4354. U.TNull = ["TNull", 0];
  4355. U.TNull.toString = N;
  4356. U.TNull.__enum__ = U;
  4357. U.TInt = ["TInt", 1];
  4358. U.TInt.toString = N;
  4359. U.TInt.__enum__ = U;
  4360. U.TFloat = ["TFloat", 2];
  4361. U.TFloat.toString =
  4362. N;
  4363. U.TFloat.__enum__ = U;
  4364. U.TBool = ["TBool", 3];
  4365. U.TBool.toString = N;
  4366. U.TBool.__enum__ = U;
  4367. U.TObject = ["TObject", 4];
  4368. U.TObject.toString = N;
  4369. U.TObject.__enum__ = U;
  4370. U.TFunction = ["TFunction", 5];
  4371. U.TFunction.toString = N;
  4372. U.TFunction.__enum__ = U;
  4373. U.TClass = function (a) {
  4374. a = ["TClass", 6, a];
  4375. a.__enum__ = U;
  4376. a.toString = N;
  4377. return a
  4378. };
  4379. U.TEnum = function (a) {
  4380. a = ["TEnum", 7, a];
  4381. a.__enum__ = U;
  4382. a.toString = N;
  4383. return a
  4384. };
  4385. U.TUnknown = ["TUnknown", 8];
  4386. U.TUnknown.toString = N;
  4387. U.TUnknown.__enum__ = U;
  4388. var Y = function () {};
  4389. s.Type = Y;
  4390. Y.__name__ = ["Type"];
  4391. Y.getClass = function (a) {
  4392. return null ==
  4393. a ? null : a.__class__
  4394. };
  4395. Y.getClassName = function (a) {
  4396. return a.__name__.join(".")
  4397. };
  4398. Y.getEnumName = function (a) {
  4399. return a.__ename__.join(".")
  4400. };
  4401. Y.resolveClass = function (a) {
  4402. a = s[a];
  4403. return null != a && a.__name__ ? a : null
  4404. };
  4405. Y.resolveEnum = function (a) {
  4406. a = s[a];
  4407. return null != a && a.__ename__ ? a : null
  4408. };
  4409. Y.createInstance = function (a, b) {
  4410. switch (b.length) {
  4411. case 0:
  4412. return new a;
  4413. case 1:
  4414. return new a(b[0]);
  4415. case 2:
  4416. return new a(b[0], b[1]);
  4417. case 3:
  4418. return new a(b[0], b[1], b[2]);
  4419. case 4:
  4420. return new a(b[0], b[1], b[2], b[3]);
  4421. case 5:
  4422. return new a(b[0], b[1],
  4423. b[2], b[3], b[4]);
  4424. case 6:
  4425. return new a(b[0], b[1], b[2], b[3], b[4], b[5]);
  4426. case 7:
  4427. return new a(b[0], b[1], b[2], b[3], b[4], b[5], b[6]);
  4428. case 8:
  4429. return new a(b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
  4430. default:
  4431. throw "Too many arguments";
  4432. }
  4433. };
  4434. Y.createEmptyInstance = function (a) {
  4435. function b() {}
  4436. b.prototype = a.prototype;
  4437. return new b
  4438. };
  4439. Y.createEnum = function (a, b, d) {
  4440. var c = W.field(a, b);
  4441. if (null == c) throw "No such constructor " + b;
  4442. if (W.isFunction(c)) {
  4443. if (null == d) throw "Constructor " + b + " need parameters";
  4444. return c.apply(a, d)
  4445. }
  4446. if (null != d && 0 !=
  4447. d.length) throw "Constructor " + b + " does not need parameters";
  4448. return c
  4449. };
  4450. Y.getEnumConstructs = function (a) {
  4451. return a.__constructs__.slice()
  4452. };
  4453. Y["typeof"] = function (a) {
  4454. switch (typeof a) {
  4455. case "boolean":
  4456. return U.TBool;
  4457. case "string":
  4458. return U.TClass(String);
  4459. case "number":
  4460. return Math.ceil(a) == a % 2147483648 ? U.TInt : U.TFloat;
  4461. case "object":
  4462. if (null == a) return U.TNull;
  4463. var b = a.__enum__;
  4464. if (null != b) return U.TEnum(b);
  4465. a = a.__class__;
  4466. return null != a ? U.TClass(a) : U.TObject;
  4467. case "function":
  4468. return a.__name__ || a.__ename__ ? U.TObject :
  4469. U.TFunction;
  4470. case "undefined":
  4471. return U.TNull;
  4472. default:
  4473. return U.TUnknown
  4474. }
  4475. };
  4476. s.XmlType = {
  4477. __ename__: ["XmlType"],
  4478. __constructs__: []
  4479. };
  4480. var O = function () {};
  4481. s.Xml = O;
  4482. O.__name__ = ["Xml"];
  4483. O.parse = function (a) {
  4484. return y.xml.Parser.parse(a)
  4485. };
  4486. O.createElement = function (a) {
  4487. var b = new O;
  4488. b.nodeType = O.Element;
  4489. b._children = [];
  4490. b._attributes = new y.ds.StringMap;
  4491. b.set_nodeName(a);
  4492. return b
  4493. };
  4494. O.createPCData = function (a) {
  4495. var b = new O;
  4496. b.nodeType = O.PCData;
  4497. b.set_nodeValue(a);
  4498. return b
  4499. };
  4500. O.createCData = function (a) {
  4501. var b = new O;
  4502. b.nodeType = O.CData;
  4503. b.set_nodeValue(a);
  4504. return b
  4505. };
  4506. O.createComment = function (a) {
  4507. var b = new O;
  4508. b.nodeType = O.Comment;
  4509. b.set_nodeValue(a);
  4510. return b
  4511. };
  4512. O.createDocType = function (a) {
  4513. var b = new O;
  4514. b.nodeType = O.DocType;
  4515. b.set_nodeValue(a);
  4516. return b
  4517. };
  4518. O.createProcessingInstruction = function (a) {
  4519. var b = new O;
  4520. b.nodeType = O.ProcessingInstruction;
  4521. b.set_nodeValue(a);
  4522. return b
  4523. };
  4524. O.createDocument = function () {
  4525. var a = new O;
  4526. a.nodeType = O.Document;
  4527. a._children = [];
  4528. return a
  4529. };
  4530. O.prototype = {
  4531. toString: function () {
  4532. if (this.nodeType == O.PCData) return $.htmlEscape(this._nodeValue);
  4533. if (this.nodeType == O.CData) return "<![CDATA[" + this._nodeValue + "]]\x3e";
  4534. if (this.nodeType == O.Comment) return "\x3c!--" + this._nodeValue + "--\x3e";
  4535. if (this.nodeType == O.DocType) return "<!DOCTYPE " + this._nodeValue + ">";
  4536. if (this.nodeType == O.ProcessingInstruction) return "<?" + this._nodeValue + "?>";
  4537. var a = new fa;
  4538. if (this.nodeType == O.Element) {
  4539. a.b += "<";
  4540. a.b += K.string(this._nodeName);
  4541. for (var b = this._attributes.keys(); b.hasNext();) {
  4542. var d = b.next();
  4543. a.b += " ";
  4544. a.b += K.string(d);
  4545. a.b += '="';
  4546. a.b += K.string(this._attributes.get(d));
  4547. a.b +=
  4548. '"'
  4549. }
  4550. if (0 == this._children.length) return a.b += "/>", a.b;
  4551. a.b += ">"
  4552. }
  4553. for (b = this.iterator(); b.hasNext();) d = b.next(), a.b += K.string(d.toString());
  4554. this.nodeType == O.Element && (a.b += "</", a.b += K.string(this._nodeName), a.b += ">");
  4555. return a.b
  4556. },
  4557. removeChild: function (a) {
  4558. if (null == this._children) throw "bad nodetype";
  4559. var b = S.remove(this._children, a);
  4560. b && (a._parent = null);
  4561. return b
  4562. },
  4563. addChild: function (a) {
  4564. if (null == this._children) throw "bad nodetype";
  4565. null != a._parent && S.remove(a._parent._children, a);
  4566. a._parent = this;
  4567. this._children.push(a)
  4568. },
  4569. firstElement: function () {
  4570. if (null == this._children) throw "bad nodetype";
  4571. for (var a = 0, b = this._children.length; a < b;) {
  4572. var d = this._children[a];
  4573. if (d.nodeType == O.Element) return d;
  4574. a++
  4575. }
  4576. return null
  4577. },
  4578. elementsNamed: function (a) {
  4579. if (null == this._children) throw "bad nodetype";
  4580. return {
  4581. cur: 0,
  4582. x: this._children,
  4583. hasNext: function () {
  4584. for (var b = this.cur, d = this.x.length; b < d;) {
  4585. var c = this.x[b];
  4586. if (c.nodeType == O.Element && c._nodeName == a) break;
  4587. b++
  4588. }
  4589. this.cur = b;
  4590. return b < d
  4591. },
  4592. next: function () {
  4593. for (var b = this.cur, d = this.x.length; b < d;) {
  4594. var c = this.x[b];
  4595. b++;
  4596. if (c.nodeType == O.Element && c._nodeName == a) return this.cur = b, c
  4597. }
  4598. return null
  4599. }
  4600. }
  4601. },
  4602. iterator: function () {
  4603. if (null == this._children) throw "bad nodetype";
  4604. return {
  4605. cur: 0,
  4606. x: this._children,
  4607. hasNext: function () {
  4608. return this.cur < this.x.length
  4609. },
  4610. next: function () {
  4611. return this.x[this.cur++]
  4612. }
  4613. }
  4614. },
  4615. exists: function (a) {
  4616. if (this.nodeType != O.Element) throw "bad nodeType";
  4617. return this._attributes.exists(a)
  4618. },
  4619. set: function (a, b) {
  4620. if (this.nodeType != O.Element) throw "bad nodeType";
  4621. this._attributes.set(a, b)
  4622. },
  4623. get: function (a) {
  4624. if (this.nodeType != O.Element) throw "bad nodeType";
  4625. return this._attributes.get(a)
  4626. },
  4627. set_nodeValue: function (a) {
  4628. if (this.nodeType == O.Element || this.nodeType == O.Document) throw "bad nodeType";
  4629. return this._nodeValue = a
  4630. },
  4631. set_nodeName: function (a) {
  4632. if (this.nodeType != O.Element) throw "bad nodeType";
  4633. return this._nodeName = a
  4634. },
  4635. get_nodeName: function () {
  4636. if (this.nodeType != O.Element) throw "bad nodeType";
  4637. return this._nodeName
  4638. },
  4639. __class__: O
  4640. };
  4641. k.Lib = function () {};
  4642. s["flash.Lib"] = k.Lib;
  4643. k.Lib.__name__ = ["flash", "Lib"];
  4644. k.Lib.getTimer = function () {
  4645. return~~ (Date.now() - k.Lib.qTimeStamp)
  4646. };
  4647. k.Lib.getURL = function (a, b) {
  4648. F.Browser.window.open(a.url, b)
  4649. };
  4650. k.Lib.jsNode = function (a) {
  4651. a = F.Browser.document.createElement(a);
  4652. a.style.position = "absolute";
  4653. return a
  4654. };
  4655. k.Lib.jsDiv = function () {
  4656. return k.Lib.jsNode("div")
  4657. };
  4658. k.Lib.jsCanvas = function () {
  4659. return k.Lib.jsNode("canvas")
  4660. };
  4661. k.Lib.jsHelper = function () {
  4662. if (null == k.Lib.qHelper) {
  4663. var a = k.Lib.jsDiv();
  4664. k.Lib.get_stage().component.appendChild(a);
  4665. a.style.visibility = "hidden";
  4666. a.appendChild(k.Lib.qHelper = k.Lib.jsDiv())
  4667. }
  4668. return k.Lib.qHelper
  4669. };
  4670. k.Lib.get_current = function () {
  4671. null ==
  4672. k.Lib.qCurrent && k.Lib.get_stage().addChild(k.Lib.qCurrent = new k.display.MovieClip);
  4673. return k.Lib.qCurrent
  4674. };
  4675. k.Lib.get_stage = function () {
  4676. null == k.Lib.qStage && F.Browser.document.body.appendChild((k.Lib.qStage = new k.display.Stage).component);
  4677. return k.Lib.qStage
  4678. };
  4679. k.Lib.requestAnimationFrame = function (a) {
  4680. window.reqAnimFrame(a)
  4681. };
  4682. k.Lib.schedule = function (a) {
  4683. k.Lib.schList[k.Lib.schLength++] = a
  4684. };
  4685. k.Lib.rgba = function (a) {
  4686. return "rgba(" + (a >> 16 & 255) + "," + (a >> 8 & 255) + "," + (a & 255) + "," + ((a >> 24 & 255) / 255).toFixed(4) + ")"
  4687. };
  4688. k.Lib.rgbf =
  4689. function (a, b) {
  4690. return "rgba(" + (a >> 16 & 255) + "," + (a >> 8 & 255) + "," + (a & 255) + "," + b.toFixed(4) + ")"
  4691. };
  4692. k.display.Bitmap = function (a, b, d) {
  4693. this.smoothing = !1;
  4694. k.display.DisplayObject.call(this);
  4695. this.set_bitmapData(a)
  4696. };
  4697. s["flash.display.Bitmap"] = k.display.Bitmap;
  4698. k.display.Bitmap.__name__ = ["flash", "display", "Bitmap"];
  4699. k.display.Bitmap.__interfaces__ = [k.display.IBitmapDrawable];
  4700. k.display.Bitmap.__super__ = k.display.DisplayObject;
  4701. k.display.Bitmap.prototype = I(k.display.DisplayObject.prototype, {
  4702. drawToSurface: function (a, b, d,
  4703. c, e, f, l) {
  4704. this.bitmapData.drawToSurface(a, b, d, c, e, f, l)
  4705. },
  4706. get_height: function () {
  4707. return null != this.qHeight ? this.qHeight : null != this.bitmapData ? this.bitmapData.component.height : 0
  4708. },
  4709. get_width: function () {
  4710. return null != this.qWidth ? this.qWidth : null != this.bitmapData ? this.bitmapData.component.width : 0
  4711. },
  4712. set_smoothing: function (a) {
  4713. var b = this.bitmapData.qContext;
  4714. return b.imageSmoothingEnabled = b.oImageSmoothingEnabled = b.msImageSmoothingEnabled = b.webkitImageSmoothingEnabled = b.mozImageSmoothingEnabled = a
  4715. },
  4716. set_bitmapData: function (a) {
  4717. null !=
  4718. this.bitmapData && this.component.removeChild(this.bitmapData.component);
  4719. null != a && this.component.appendChild(a.handle());
  4720. return this.bitmapData = a
  4721. },
  4722. __class__: k.display.Bitmap
  4723. });
  4724. k.display.ImageDataLease = function () {};
  4725. s["flash.display.ImageDataLease"] = k.display.ImageDataLease;
  4726. k.display.ImageDataLease.__name__ = ["flash", "display", "ImageDataLease"];
  4727. k.display.ImageDataLease.prototype = {
  4728. clone: function () {
  4729. var a = new k.display.ImageDataLease;
  4730. a.seed = this.seed;
  4731. a.time = this.time;
  4732. return a
  4733. },
  4734. set: function (a, b) {
  4735. this.seed =
  4736. a;
  4737. this.time = b
  4738. },
  4739. __class__: k.display.ImageDataLease
  4740. };
  4741. k.display.BitmapData = function (a, b, d, c) {
  4742. null == d && (d = !0);
  4743. this.qSync = 1;
  4744. this.qTransparent = d;
  4745. this.qTick = 0;
  4746. this.qTime = (new Date).getTime();
  4747. this.rect = new k.geom.Rectangle(0, 0, a, b);
  4748. this.component = k.Lib.jsCanvas();
  4749. this.component.width = a;
  4750. this.component.height = b;
  4751. this.qContext = this.component.getContext("2d");
  4752. k.display.BitmapData.setSmoothing(this.qContext, !0);
  4753. this.qPixel = this.qContext.createImageData(1, 1);
  4754. null == c && (c = -1);
  4755. d || (c |= -16777216);
  4756. 0 != (c & -16777216) && this.fillRect(this.rect,
  4757. c)
  4758. };
  4759. s["flash.display.BitmapData"] = k.display.BitmapData;
  4760. k.display.BitmapData.__name__ = ["flash", "display", "BitmapData"];
  4761. k.display.BitmapData.__interfaces__ = [k.display.IBitmapDrawable];
  4762. k.display.BitmapData.setSmoothing = function (a, b) {
  4763. a.imageSmoothingEnabled = a.oImageSmoothingEnabled = a.msImageSmoothingEnabled = a.webkitImageSmoothingEnabled = a.mozImageSmoothingEnabled = b
  4764. };
  4765. k.display.BitmapData.makeColor = function (a) {
  4766. return "rgba(" + (a >> 16 & 255) + "," + (a >> 8 & 255) + "," + (a & 255) + "," + ((a >> 24 & 255) / 255).toFixed(4) + ")"
  4767. };
  4768. k.display.BitmapData.loadFromBytes =
  4769. function (a, b, d) {
  4770. var c = new k.display.BitmapData(0, 0);
  4771. c.nmeLoadFromBytes(a, b, d);
  4772. return c
  4773. };
  4774. k.display.BitmapData.nmeBase64Encode = function (a) {
  4775. var b = "";
  4776. for (a.position = 0; a.position < a.length;) {
  4777. var d = 0,
  4778. c = 0,
  4779. e = 0,
  4780. d = a.data.getUint8(a.position++);
  4781. a.position < a.length && (c = a.data.getUint8(a.position++));
  4782. a.position < a.length && (e = a.data.getUint8(a.position++));
  4783. var f = 0,
  4784. l = 0,
  4785. m = 0,
  4786. h = 0,
  4787. f = d >> 2,
  4788. l = (d & 3) << 4 | c >> 4,
  4789. m = (c & 15) << 2 | e >> 6,
  4790. h = e & 63,
  4791. b = b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f),
  4792. b = b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l),
  4793. b = a.position < a.length ? b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m) : b + "=",
  4794. b = a.position < a.length ? b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h) : b + "="
  4795. }
  4796. return b
  4797. };
  4798. k.display.BitmapData.nmeIsPNG = function (a) {
  4799. a.position = 0;
  4800. return 137 == a.data.getUint8(a.position++) && 80 == a.data.getUint8(a.position++) && 78 == a.data.getUint8(a.position++) && 71 == a.data.getUint8(a.position++) && 13 == a.data.getUint8(a.position++) && 10 == a.data.getUint8(a.position++) && 26 ==
  4801. a.data.getUint8(a.position++) && 10 == a.data.getUint8(a.position++)
  4802. };
  4803. k.display.BitmapData.nmeIsJPG = function (a) {
  4804. a.position = 0;
  4805. return 255 == a.data.getUint8(a.position++) && 216 == a.data.getUint8(a.position++)
  4806. };
  4807. k.display.BitmapData.loadFromBase64String = function (a, b) {
  4808. var d = F.Browser.document.createElement("img"),
  4809. c = new k.display.BitmapData(0, 0),
  4810. e = c.component;
  4811. d.addEventListener("load", function (a) {
  4812. e.width = d.width;
  4813. e.height = d.height;
  4814. e.getContext("2d").drawImage(d, 0, 0);
  4815. b(c)
  4816. }, !1);
  4817. d.src = "data:image/png;base64," + a
  4818. };
  4819. k.display.BitmapData.prototype = {
  4820. nmeLoadFromBytes: function (a, b, d) {
  4821. var c = this,
  4822. e = "";
  4823. if (k.display.BitmapData.nmeIsPNG(a)) e = "image/png";
  4824. else if (k.display.BitmapData.nmeIsJPG(a)) e = "image/jpeg";
  4825. else throw new k.errors.IOError("BitmapData tried to read a PNG/JPG ByteArray, but found an invalid header.");
  4826. var f = F.Browser.document.createElement("img"),
  4827. l = this.component;
  4828. f.addEventListener("load", function (a) {
  4829. l.width = f.width;
  4830. l.height = f.height;
  4831. a = l.getContext("2d");
  4832. a.drawImage(f, 0, 0);
  4833. if (null != b) {
  4834. for (var e = a.getImageData(0, 0, f.width, f.height), h =
  4835. 0, C = b.length; h < C;) {
  4836. var r = h++;
  4837. e.data[4 * r + 3] = b.data.getUint8(b.position++)
  4838. }
  4839. a.putImageData(e, 0, 0)
  4840. }
  4841. c.rect = new k.geom.Rectangle(0, 0, l.width, l.height);
  4842. null != d && d(c)
  4843. }, !1);
  4844. f.src = "data:" + e + ";base64," + k.display.BitmapData.nmeBase64Encode(a)
  4845. },
  4846. syncData: function () {
  4847. 1 == (this.qSync & 3) && (this.qImageData = this.qContext.getImageData(0, 0, this.component.width, this.component.height), this.qSync &= -4)
  4848. },
  4849. syncCanvas: function () {
  4850. 2 == (this.qSync & 3) && (this.qContext.putImageData(this.qImageData, 0, 0), this.qSync &= -4)
  4851. },
  4852. nmeLoadFromFile: function (a,
  4853. b) {
  4854. var d = this,
  4855. c = F.Browser.document.createElement("img");
  4856. if (null != b) {
  4857. var e = {
  4858. image: c,
  4859. texture: this.component,
  4860. inLoader: b,
  4861. bitmapData: this
  4862. };
  4863. c.addEventListener("load", function (a, b) {
  4864. return function (d) {
  4865. return a(b, d)
  4866. }
  4867. }(A(this, this.jeashOnLoad), e), !1);
  4868. c.addEventListener("error", function (a) {
  4869. c.complete || d.jeashOnLoad(e, a)
  4870. }, !1)
  4871. }
  4872. c.src = a
  4873. },
  4874. jeashOnLoad: function (a, b) {
  4875. var d = a.texture,
  4876. c = a.image.width,
  4877. e = a.image.height;
  4878. d.width = c;
  4879. d.height = e;
  4880. d.getContext("2d").drawImage(a.image, 0, 0, c, e);
  4881. a.bitmapData.width = c;
  4882. a.bitmapData.height =
  4883. e;
  4884. a.bitmapData.rect = new k.geom.Rectangle(0, 0, c, e);
  4885. null != a.inLoader && (d = new k.events.Event("complete"), d.set_target(a.inLoader), a.inLoader.dispatchEvent(d))
  4886. },
  4887. applyFilter: function (a, b, d, c) {},
  4888. copyChannel: function (a, b, d, c, e) {
  4889. var f = ~~a.x,
  4890. l = ~~d.x,
  4891. m = ~~a.y,
  4892. h = ~~d.y;
  4893. d = ~~b.width;
  4894. var p = ~~b.height;
  4895. b = a.component.width;
  4896. var C = a.component.height,
  4897. r = this.component.width,
  4898. k = this.component.height,
  4899. w, t, n = e;
  4900. 0 > l && (d += l, l = 0);
  4901. 0 > h && (p += h, h = 0);
  4902. 0 > f && (d += f, f = 0);
  4903. 0 > m && (p += m, m = 0);
  4904. f + d > b && (d = b - f);
  4905. m + p > C && (p = C - m);
  4906. l + d > r && (d = r - l);
  4907. h + p > k &&
  4908. (p = k - h);
  4909. if (!(0 >= d || 0 >= p))
  4910. if (8 == c && 8 == n) {
  4911. b = this.qContext.globalCompositeOperation;
  4912. r = this.qContext.fillStyle;
  4913. this.qContext.globalCompositeOperation = "darker";
  4914. for (e = 0; 8 > e++;) this.qContext.drawImage(this.component, l, h, d, p, l, h, d, p);
  4915. this.qContext.globalCompositeOperation = "destination-over";
  4916. this.qContext.fillStyle = "black";
  4917. this.qContext.fillRect(f, m, d, p);
  4918. this.qContext.globalCompositeOperation = "destination-atop";
  4919. this.qContext.drawImage(a.handle(), f, m, d, p, l, h, d, p);
  4920. this.qContext.globalCompositeOperation = b;
  4921. this.qContext.fillStyle =
  4922. r
  4923. } else if (C = 2 != (this.qSync & 3), this.lock(), k = this.qImageData.data, a.lock(), a = a.qImageData.data, c = 8 == c ? 3 : 4 == c ? 2 : 2 == c ? 1 : 1 == c ? 0 : -1, n = 8 == n ? 3 : 4 == n ? 2 : 2 == n ? 1 : 1 == n ? 0 : -1, !(0 > c || 0 > n)) {
  4924. h += p;
  4925. for (w = m + p; --w >= m;)
  4926. for (--h, t = d, e = 4 * (l + r * h) + n, p = 4 * (f + b * w) + c; 0 < t--;) k[p] = a[e], e += 4, p += 4;
  4927. this.qSync |= 6;
  4928. C && this.unlock()
  4929. }
  4930. },
  4931. colorTransform: function (a, b) {
  4932. var d = ~~a.x,
  4933. c = ~~a.y,
  4934. e = ~~a.width,
  4935. f = ~~a.height,
  4936. l = this.component.width,
  4937. m = this.component.height,
  4938. h = this.qContext.globalCompositeOperation,
  4939. p = this.qContext.globalAlpha;
  4940. 0 > d && (e += d, d = 0);
  4941. 0 > c && (f += c, c = 0);
  4942. d + e > l && (e = l - d);
  4943. c + f > m && (f = m - c);
  4944. if (!(0 >= e || 0 >= f)) {
  4945. if (b.isAlphaMultiplier()) this.syncCanvas(), this.qContext.globalCompositeOperation = "copy", this.qContext.globalAlpha *= b.alphaMultiplier, this.qContext.drawImage(this.component, d, c, e, f, d, c, e, f), this.qSync |= 5;
  4946. else if (b.isColorSetter()) l = this.qContext.fillStyle, 0 != b.alphaMultiplier ? (this.qContext.globalCompositeOperation = "source-in", this.qContext.fillStyle = "rgb(" + ~~b.redOffset + "," + ~~b.greenOffset + "," + ~~b.blueOffset + ")", this.qContext.fillRect(d,
  4947. c, e, f), this.qContext.globalCompositeOperation = "copy", this.qContext.globalAlpha = b.alphaMultiplier, this.qContext.drawImage(this.component, d, c, e, f, d, c, e, f)) : (this.qContext.globalCompositeOperation = "copy", this.qContext.fillStyle = "rgba(" + ~~b.redOffset + "," + ~~b.greenOffset + "," + ~~b.blueOffset + "," + ~~b.alphaOffset + ")", this.qContext.fillRect(d, c, e, f)), this.qContext.fillStyle = l;
  4948. else {
  4949. var C = 2 != (this.qSync & 3);
  4950. this.lock();
  4951. var r = this.qImageData.data,
  4952. k = 4 * l * m,
  4953. w, t = b.redMultiplier,
  4954. n = b.greenMultiplier,
  4955. q = b.blueMultiplier,
  4956. s = b.alphaMultiplier,
  4957. z = b.redOffset,
  4958. x = b.greenOffset,
  4959. B = b.blueOffset,
  4960. v = b.alphaOffset;
  4961. if (0 == d && 0 == c && e == l && f == m)
  4962. for (; 0 <= (k -= 4);) 0 < (w = r[k + 3]) && (r[k + 3] = 0 > (w = w * s + v) ? 0 : 255 < w ? 255 : ~~w), r[k + 2] = 0 > (w = r[k + 2] * q + B) ? 0 : 255 < w ? 255 : ~~w, r[k + 1] = 0 > (w = r[k + 1] * n + x) ? 0 : 255 < w ? 255 : ~~w, r[k] = 0 > (w = r[k] * t + z) ? 0 : 255 < w ? 255 : ~~w;
  4963. else
  4964. for (m = c - 1, c += f; ++m < c;)
  4965. for (k = l * m + d - 1 << 2, f = k + 4 * e;
  4966. (k += 4) < f;) 0 < (w = r[k + 3]) && (r[k + 3] = 0 > (w = w * s + v) ? 0 : 255 < w ? 255 : ~~w), r[k + 2] = 0 > (w = r[k + 2] * q + B) ? 0 : 255 < w ? 255 : ~~w, r[k + 1] = 0 > (w = r[k + 1] * n + x) ? 0 : 255 < w ? 255 : ~~w, r[k] = 0 > (w = r[k] * t + z) ?
  4967. 0 : 255 < w ? 255 : ~~w;
  4968. this.qSync |= 6;
  4969. C && this.unlock()
  4970. }
  4971. this.qContext.globalCompositeOperation = h;
  4972. this.qContext.globalAlpha = p
  4973. }
  4974. },
  4975. floodFill: function (a, b, d) {
  4976. var c = 1 == (this.qSync & 3);
  4977. this.lock();
  4978. var e = [a | b << 16],
  4979. f = 1,
  4980. l = this.qImageData.data,
  4981. m, h, p, C, r, k, w, t, n = [],
  4982. q = this.component.width,
  4983. s = this.component.height;
  4984. t = b * this.component.width + a << 4;
  4985. a = l[t];
  4986. b = l[t + 1];
  4987. m = l[t + 2];
  4988. h = l[t + 3];
  4989. r = d >>> 24;
  4990. p = d >> 16 & 255;
  4991. C = d >> 8 & 255;
  4992. d &= 255;
  4993. for (w = -1; ++w < s;)
  4994. for (n.push(t = []), k = 0; k < q;) t.push(0), k += 32;
  4995. for (; 0 < f;) t = e[--f], k = t & 65535, w = t >>> 16, 0 > k || 0 > w || k >=
  4996. q || w >= s || 0 != (n[w][k >> 5] >> (k & 31) & 1) || (n[w][k >> 5] |= 1 << (k & 31), t = w * this.component.width + k << 2, l[t] == a && l[t + 1] == b && l[t + 2] == m && l[t + 3] == h && (l[t] = p, l[t + 1] = C, l[t + 2] = d, l[t + 3] = r, (t = k + 1) < q && 0 == (n[w][t >> 5] >> (t & 31) & 1) && (e[f++] = w << 16 | t), 0 < k && 0 == (n[w][(t = k - 1) >> 5] >> (t & 31) & 1) && (e[f++] = w << 16 | t), (t = w + 1) < s && 0 == (n[t][k >> 5] >> (k & 31) & 1) && (e[f++] = t << 16 | k), 0 < w && 0 == (n[t = w - 1][k >> 5] >> (k & 31) & 1) && (e[f++] = t << 16 | k)));
  4997. this.qSync |= 6;
  4998. c && this.unlock()
  4999. },
  5000. getColorBoundsRect: function (a, b, d) {
  5001. null == d && (d = !0);
  5002. this.syncData();
  5003. a = this.qImageData.data;
  5004. var c = this.component.width,
  5005. e = this.component.height,
  5006. f = 0,
  5007. l = 0,
  5008. m = a.length,
  5009. h, p, C;
  5010. for (h = 0; h < m;) p = (this.qTransparent ? a[h + 3] << 24 : -16777216) | (a[h] & 255) << 16 | (a[h + 1] & 255) << 8 | a[h + 2] & 255, p == b == d && (p = Math.floor((h >> 2) % this.component.width), C = Math.floor((h >> 2) / this.component.width), p < c && (c = p), p > f && (f = p), C < e && (e = C), C > l && (l = C)), h += 4;
  5011. return c <= f && e <= l ? new k.geom.Rectangle(c, e, f - c + 1, l - e + 1) : d ? new k.geom.Rectangle(0, 0, 0, 0) : new k.geom.Rectangle(0, 0, this.component.width, this.component.height)
  5012. },
  5013. setPixel32: function (a, b, d) {
  5014. 0 >
  5015. a || 0 > b || a >= this.component.width || b >= this.component.height || (2 != (this.qSync & 3) ? (this.qPixel.data[0] = d >>> 16 & 255, this.qPixel.data[1] = d >>> 8 & 255, this.qPixel.data[2] = d & 255, this.qPixel.data[3] = d >>> 24 & 255, this.qContext.putImageData(this.qPixel, a, b), this.qSync |= 5) : (a = b * this.component.width + a << 2, this.qImageData.data[a] = d >>> 16 & 255, this.qImageData.data[a + 1] = d >>> 8 & 255, this.qImageData.data[a + 2] = d & 255, this.qImageData.data[a + 3] = d >>> 24 & 255, this.qSync |= 6))
  5016. },
  5017. setPixel: function (a, b, d) {
  5018. 0 > a || 0 > b || a >= this.component.width ||
  5019. b >= this.component.height || (2 != (this.qSync & 3) ? (this.qPixel.data[0] = d >>> 16 & 255, this.qPixel.data[1] = d >>> 8 & 255, this.qPixel.data[2] = d & 255, this.qPixel.data[3] = 255, this.qContext.putImageData(this.qPixel, a, b), this.qSync |= 5) : (a = b * this.component.width + a << 2, this.qImageData.data[a] = d >>> 16 & 255, this.qImageData.data[a + 1] = d >>> 8 & 255, this.qImageData.data[a + 2] = d & 255, this.qImageData.data[a + 3] = 255, this.qSync |= 6))
  5020. },
  5021. getPixel32: function (a, b) {
  5022. if (0 > a || 0 > b || a >= this.component.width || b >= this.component.height) return 0;
  5023. if (1 == (this.qSync &
  5024. 3)) {
  5025. var d = this.qContext.getImageData(a, b, 1, 1).data;
  5026. return (this.qTransparent ? d[3] << 24 : -16777216) | d[0] << 16 | d[1] << 8 | d[2]
  5027. }
  5028. d = b * this.component.width + a << 2;
  5029. return (this.qTransparent ? this.qImageData.data[d + 3] << 24 : -16777216) | this.qImageData.data[d] << 16 | this.qImageData.data[d + 1] << 8 | this.qImageData.data[d + 2]
  5030. },
  5031. getPixel: function (a, b) {
  5032. if (0 > a || 0 > b || a >= this.component.width || b >= this.component.height) return 0;
  5033. if (1 == (this.qSync & 3)) {
  5034. var d = this.qContext.getImageData(a, b, 1, 1).data;
  5035. return d[0] << 16 | d[1] << 8 | d[2]
  5036. }
  5037. d = b * this.component.width +
  5038. a << 2;
  5039. return this.qImageData.data[d] << 16 | this.qImageData.data[d + 1] << 8 | this.qImageData.data[d + 2]
  5040. },
  5041. unlock: function () {
  5042. this.syncCanvas()
  5043. },
  5044. lock: function () {
  5045. this.syncData()
  5046. },
  5047. draw: function (a, b, d, c, e, f) {
  5048. this.syncCanvas();
  5049. var l = 0,
  5050. m = 0;
  5051. null != d && (l = d.alphaMultiplier, d.alphaMultiplier = 1, m = this.qContext.globalAlpha, this.qContext.globalAlpha *= l);
  5052. null != f && k.display.BitmapData.setSmoothing(this.qContext, f);
  5053. a.drawToSurface(this.handle(), this.qContext, b, d, c, e, null);
  5054. null != d && (d.alphaMultiplier = l, this.qContext.globalAlpha =
  5055. m);
  5056. this.qSync |= 5
  5057. },
  5058. copyPixels: function (a, b, d, c, e, f) {
  5059. null == f && (f = !1);
  5060. this.syncCanvas();
  5061. if (null != c) throw "alphaBitmapData is not supported yet.";
  5062. a = a.handle();
  5063. var l, m;
  5064. c = this.component.width;
  5065. e = this.component.height;
  5066. if (!(null == a || 0 >= (l = a.width) || 0 >= (m = a.height))) {
  5067. var h = ~~d.x;
  5068. d = ~~d.y;
  5069. var p, C, r;
  5070. null != b ? (p = b.x, C = b.y, r = b.width, b = b.height, 0 > p && (r += p, p = 0), 0 > C && (b += C, C = 0), p + r > l && (r = l - p), C + b > m && (b = m - C)) : (p = C = 0, r = l, b = m);
  5071. 0 > h && (r += h, p -= h, h = 0);
  5072. 0 > d && (b += d, C -= d, d = 0);
  5073. h + r > c && (r = c - h);
  5074. d + b > e && (b = e - d);
  5075. 0 >= r || 0 >= b || (this.qTransparent &&
  5076. !f && this.qContext.clearRect(h, d, r, b), this.qContext.drawImage(a, p, C, r, b, h, d, r, b), this.qSync |= 5)
  5077. }
  5078. },
  5079. drawToSurface: function (a, b, d, c, e, f, l) {
  5080. b.save();
  5081. null != l && b.imageSmoothingEnabled != l && k.display.BitmapData.setSmoothing(b, l);
  5082. null != d && (1 == d.a && 0 == d.b && 0 == d.c && 1 == d.d ? b.translate(d.tx, d.ty) : b.setTransform(d.a, d.b, d.c, d.d, d.tx, d.ty));
  5083. b.drawImage(this.handle(), 0, 0);
  5084. b.restore()
  5085. },
  5086. getTick: function () {
  5087. return this.qTick
  5088. },
  5089. getTime: function () {
  5090. return this.qTime
  5091. },
  5092. handle: function () {
  5093. this.syncCanvas();
  5094. 0 != (this.qSync & 4) &&
  5095. (this.qTick++, this.qTime = (new Date).getTime(), this.qSync &= -5);
  5096. return this.component
  5097. },
  5098. dispose: function () {
  5099. this.component.width = this.component.height = 1;
  5100. this.qImageData = null;
  5101. this.qSync = 5
  5102. },
  5103. clone: function () {
  5104. this.syncCanvas();
  5105. var a = new k.display.BitmapData(this.component.width, this.component.height, this.qTransparent, 0);
  5106. a.qContext.drawImage(this.component, 0, 0);
  5107. a.qSync |= 5;
  5108. return a
  5109. },
  5110. fillRect: function (a, b) {
  5111. null == a || 0 >= a.width || 0 >= a.height || (a.equals(this.rect) && this.qTransparent && 0 == (b & -16777216) ? this.component.width =
  5112. this.component.width : (this.qTransparent ? -16777216 != (b & -16777216) && this.qContext.clearRect(a.x, a.y, a.width, a.height) : b |= -16777216, 0 != (b & -16777216) && (this.qContext.fillStyle = k.display.BitmapData.makeColor(b), this.qContext.fillRect(a.x, a.y, a.width, a.height)), this.qSync |= 5))
  5113. },
  5114. __class__: k.display.BitmapData
  5115. };
  5116. k.display.BitmapDataChannel = function () {};
  5117. s["flash.display.BitmapDataChannel"] = k.display.BitmapDataChannel;
  5118. k.display.BitmapDataChannel.__name__ = ["flash", "display", "BitmapDataChannel"];
  5119. k.display.BlendMode =
  5120. s["flash.display.BlendMode"] = {
  5121. __ename__: ["flash", "display", "BlendMode"],
  5122. __constructs__: "ADD ALPHA DARKEN DIFFERENCE ERASE HARDLIGHT INVERT LAYER LIGHTEN MULTIPLY NORMAL OVERLAY SCREEN SUBTRACT".split(" ")
  5123. };
  5124. k.display.BlendMode.ADD = ["ADD", 0];
  5125. k.display.BlendMode.ADD.toString = N;
  5126. k.display.BlendMode.ADD.__enum__ = k.display.BlendMode;
  5127. k.display.BlendMode.ALPHA = ["ALPHA", 1];
  5128. k.display.BlendMode.ALPHA.toString = N;
  5129. k.display.BlendMode.ALPHA.__enum__ = k.display.BlendMode;
  5130. k.display.BlendMode.DARKEN = ["DARKEN", 2];
  5131. k.display.BlendMode.DARKEN.toString =
  5132. N;
  5133. k.display.BlendMode.DARKEN.__enum__ = k.display.BlendMode;
  5134. k.display.BlendMode.DIFFERENCE = ["DIFFERENCE", 3];
  5135. k.display.BlendMode.DIFFERENCE.toString = N;
  5136. k.display.BlendMode.DIFFERENCE.__enum__ = k.display.BlendMode;
  5137. k.display.BlendMode.ERASE = ["ERASE", 4];
  5138. k.display.BlendMode.ERASE.toString = N;
  5139. k.display.BlendMode.ERASE.__enum__ = k.display.BlendMode;
  5140. k.display.BlendMode.HARDLIGHT = ["HARDLIGHT", 5];
  5141. k.display.BlendMode.HARDLIGHT.toString = N;
  5142. k.display.BlendMode.HARDLIGHT.__enum__ = k.display.BlendMode;
  5143. k.display.BlendMode.INVERT = ["INVERT", 6];
  5144. k.display.BlendMode.INVERT.toString = N;
  5145. k.display.BlendMode.INVERT.__enum__ = k.display.BlendMode;
  5146. k.display.BlendMode.LAYER = ["LAYER", 7];
  5147. k.display.BlendMode.LAYER.toString = N;
  5148. k.display.BlendMode.LAYER.__enum__ = k.display.BlendMode;
  5149. k.display.BlendMode.LIGHTEN = ["LIGHTEN", 8];
  5150. k.display.BlendMode.LIGHTEN.toString = N;
  5151. k.display.BlendMode.LIGHTEN.__enum__ = k.display.BlendMode;
  5152. k.display.BlendMode.MULTIPLY = ["MULTIPLY", 9];
  5153. k.display.BlendMode.MULTIPLY.toString = N;
  5154. k.display.BlendMode.MULTIPLY.__enum__ = k.display.BlendMode;
  5155. k.display.BlendMode.NORMAL = ["NORMAL", 10];
  5156. k.display.BlendMode.NORMAL.toString = N;
  5157. k.display.BlendMode.NORMAL.__enum__ = k.display.BlendMode;
  5158. k.display.BlendMode.OVERLAY = ["OVERLAY", 11];
  5159. k.display.BlendMode.OVERLAY.toString = N;
  5160. k.display.BlendMode.OVERLAY.__enum__ = k.display.BlendMode;
  5161. k.display.BlendMode.SCREEN = ["SCREEN", 12];
  5162. k.display.BlendMode.SCREEN.toString = N;
  5163. k.display.BlendMode.SCREEN.__enum__ = k.display.BlendMode;
  5164. k.display.BlendMode.SUBTRACT = ["SUBTRACT", 13];
  5165. k.display.BlendMode.SUBTRACT.toString = N;
  5166. k.display.BlendMode.SUBTRACT.__enum__ =
  5167. k.display.BlendMode;
  5168. k.display.Graphics = function () {
  5169. this.rgPending = !1;
  5170. this.synced = !0;
  5171. this.component = k.Lib.jsCanvas();
  5172. this.context = this.component.getContext("2d");
  5173. this.context.save();
  5174. this.bounds = new k.geom.Rectangle;
  5175. this.resetBounds();
  5176. this.rec = [];
  5177. this.len = 0
  5178. };
  5179. s["flash.display.Graphics"] = k.display.Graphics;
  5180. k.display.Graphics.__name__ = ["flash", "display", "Graphics"];
  5181. k.display.Graphics.__interfaces__ = [k.display.IBitmapDrawable];
  5182. k.display.Graphics.prototype = {
  5183. render: function (a, b) {
  5184. var d = 0,
  5185. c = -1,
  5186. e, f = this._drawMatrix,
  5187. l = 0,
  5188. m = null;
  5189. null == f && (this._drawMatrix = f = new k.geom.Matrix);
  5190. try {
  5191. for (; ++c < this.len;) switch (e = this.rec[c]) {
  5192. case 0:
  5193. throw "__break__";
  5194. case 1:
  5195. 0 < l && (d = this._closePath(a, b, d, f, m));
  5196. b.lineWidth = e = this.rec[++c];
  5197. 0 < e ? (d |= 2, b.strokeStyle = this.rec[++c]) : (d &= -3, b.strokeStyle = null);
  5198. break;
  5199. case 2:
  5200. case 3:
  5201. 0 < l && (d = this._closePath(a, b, d, f, m));
  5202. d |= 1;
  5203. if (3 == e) {
  5204. var m = this.rec[++c].handle(),
  5205. h = this.rec[++c];
  5206. this.rec[++c] ? (d = h ? d | 8 : d & -9, f.a = this.rec[++c], f.b = this.rec[++c], f.c = this.rec[++c], f.d = this.rec[++c], f.tx = this.rec[++c], f.ty =
  5207. this.rec[++c], d |= 4) : (b.fillStyle = b.createPattern(m, h ? "repeat" : "no-repeat"), d &= -5)
  5208. } else b.fillStyle = this.rec[++c], d &= -5;
  5209. b.beginPath();
  5210. l = 0;
  5211. break;
  5212. case 9:
  5213. 0 < l && (d = this._closePath(a, b, d, f, m), l = 0);
  5214. break;
  5215. case 10:
  5216. b.moveTo(this.rec[++c], this.rec[++c]);
  5217. l++;
  5218. break;
  5219. case 11:
  5220. b.lineTo(this.rec[++c], this.rec[++c]);
  5221. l++;
  5222. break;
  5223. case 12:
  5224. b.quadraticCurveTo(this.rec[++c], this.rec[++c], this.rec[++c], this.rec[++c]);
  5225. l++;
  5226. break;
  5227. case 13:
  5228. var p = this.rec[++c],
  5229. C = this.rec[++c],
  5230. r = this.rec[++c],
  5231. Q = this.rec[++c];
  5232. b.rect(p, C, r, Q);
  5233. l++;
  5234. break;
  5235. case 14:
  5236. b.arc(this.rec[++c], this.rec[++c], this.rec[++c], 0, 2 * Math.PI, !0);
  5237. l++;
  5238. break;
  5239. case 15:
  5240. var p = this.rec[++c],
  5241. C = this.rec[++c],
  5242. r = this.rec[++c],
  5243. Q = this.rec[++c],
  5244. w = this.rec[++c],
  5245. t = this.rec[++c];
  5246. null == t || null == A(b, b.quadraticCurveTo) ? (b.moveTo(p + w, C + Q), b.arcTo(p + r - w, C + Q - w, p + r, C + Q - w, w), b.arcTo(p + r, C + w, p + r - w, C, w), b.arcTo(p + w, C, p, C + w, w), b.arcTo(p + w, C + Q - w, p + w, C + Q, w)) : (b.moveTo(p + w, C + Q), b.lineTo(p + r - w, C + Q), b.quadraticCurveTo(p + r, C + Q, p + r, C + Q - t), b.lineTo(p + r, C + t), b.quadraticCurveTo(p + r, C, p + r - w, C), b.lineTo(p +
  5247. w, C), b.quadraticCurveTo(p, C, p, C + t), b.lineTo(p, C + Q - t), b.quadraticCurveTo(p, C + Q, p + w, C + Q));
  5248. l++;
  5249. break;
  5250. case 16:
  5251. var n = this.rec[++c].handle(),
  5252. q = this.rec[++c],
  5253. s = 0 != (q & 1),
  5254. z = 0 != (q & 2),
  5255. x = 0 != (q & 4),
  5256. B = 0 != (q & 8),
  5257. v = 0 != (q & 16),
  5258. H = this.rec[++c] - 1,
  5259. y, D, pa, qa, L, aa, ma, na;
  5260. b.save();
  5261. for (b.globalCompositeOperation = 0 != (q & 65536) ? "lighter" : "source-over"; c < H;) y = this.rec[++c], D = this.rec[++c], pa = this.rec[++c], qa = this.rec[++c], L = this.rec[++c], aa = this.rec[++c], ma = this.rec[++c], na = this.rec[++c], b.save(), v ? b.transform(this.rec[++c], this.rec[++c],
  5262. this.rec[++c], this.rec[++c], y, D) : (b.translate(y, D), s && b.scale(e = this.rec[++c], e), z && b.rotate(this.rec[++c])), x && (c += 3), B && (b.globalAlpha = this.rec[++c]), b.drawImage(n, L, aa, ma, na, -pa, -qa, ma, na), b.restore();
  5263. b.restore();
  5264. break;
  5265. default:
  5266. throw "__break__";
  5267. }
  5268. } catch (ra) {
  5269. if ("__break__" != ra) throw ra;
  5270. }
  5271. 0 < l && this._closePath(a, b, d, f, m)
  5272. },
  5273. _closePath: function (a, b, d, c, e) {
  5274. b.closePath();
  5275. d & 2 && b.stroke();
  5276. d & 1 && (d & 4 ? (b.save(), b.transform(c.a, c.b, c.c, c.d, c.tx, c.ty), b.fillStyle = b.createPattern(e, d & 8 ? "repeat" : "no-repeat"), b.fill(),
  5277. b.restore()) : b.fill());
  5278. return d
  5279. },
  5280. drawToSurface: function (a, b, d, c, e, f, l) {
  5281. b.save();
  5282. null != d && b.transform(d.a, d.b, d.c, d.d, d.tx, d.ty);
  5283. this.render(a, b);
  5284. b.restore()
  5285. },
  5286. rgba: function (a, b) {
  5287. return "rgba(" + (a >> 16 & 255) + ", " + (a >> 8 & 255) + ", " + (a & 255) + ", " + b.toFixed(4) + ")"
  5288. },
  5289. drawCircle: function (a, b, d) {
  5290. this.rec[this.len++] = 14;
  5291. this.rec[this.len++] = a;
  5292. this.rec[this.len++] = b;
  5293. this.rec[this.len++] = d;
  5294. this.grab(a - d, b - d, a + d, b + d)
  5295. },
  5296. drawRoundRect: function (a, b, d, c, e, f) {
  5297. this.rec[this.len++] = 15;
  5298. this.rec[this.len++] = a;
  5299. this.rec[this.len++] =
  5300. b;
  5301. this.rec[this.len++] = d;
  5302. this.rec[this.len++] = c;
  5303. this.rec[this.len++] = e;
  5304. this.rec[this.len++] = f;
  5305. this.grab(a, b, a + d, b + c)
  5306. },
  5307. drawRect: function (a, b, d, c) {
  5308. this.rec[this.len++] = 13;
  5309. this.rec[this.len++] = a;
  5310. this.rec[this.len++] = b;
  5311. this.rec[this.len++] = d;
  5312. this.rec[this.len++] = c;
  5313. this.grab(a, b, a + d, b + c)
  5314. },
  5315. curveTo: function (a, b, d, c) {
  5316. this.rec[this.len++] = 12;
  5317. this.rec[this.len++] = a;
  5318. this.rec[this.len++] = b;
  5319. this.rec[this.len++] = d;
  5320. this.rec[this.len++] = c;
  5321. a = this.lineWidth;
  5322. this.grab(d - a, c - a, d + a, c + a)
  5323. },
  5324. lineTo: function (a, b) {
  5325. this.rec[this.len++] =
  5326. 11;
  5327. this.rec[this.len++] = a;
  5328. this.rec[this.len++] = b;
  5329. var d = this.lineWidth;
  5330. this.grab(a - d, b - d, a + d, b + d)
  5331. },
  5332. moveTo: function (a, b) {
  5333. this.rec[this.len++] = 10;
  5334. this.rec[this.len++] = a;
  5335. this.rec[this.len++] = b;
  5336. var d = this.lineWidth;
  5337. this.grab(a - d, b - d, a + d, b + d)
  5338. },
  5339. endFill: function () {
  5340. this.rec[this.len++] = 9;
  5341. this.invalidate()
  5342. },
  5343. beginBitmapFill: function (a, b, d, c) {
  5344. this.rec[this.len++] = 3;
  5345. this.rec[this.len++] = a;
  5346. this.rec[this.len++] = null != d ? d : !0;
  5347. if (this.rec[this.len++] = null != b) this.rec[this.len++] = b.a, this.rec[this.len++] = b.b, this.rec[this.len++] =
  5348. b.c, this.rec[this.len++] = b.d, this.rec[this.len++] = b.tx, this.rec[this.len++] = b.ty
  5349. },
  5350. beginFill: function (a, b) {
  5351. null == b && (b = 1);
  5352. null == a && (a = 0);
  5353. this.rec[this.len++] = 2;
  5354. this.rec[this.len++] = k.Lib.rgbf(a, b)
  5355. },
  5356. lineStyle: function (a, b, d, c, e) {
  5357. null == d && (d = 1);
  5358. null == b && (b = 0);
  5359. this.rec[this.len++] = 1;
  5360. this.rec[this.len++] = this.lineWidth = null != a && 0 < a ? a : 0;
  5361. 0 < a && (this.rec[this.len++] = k.Lib.rgbf(b, d))
  5362. },
  5363. clear: function () {
  5364. for (var a = 0; a < this.len;) this.rec[a++] = 0;
  5365. this.len = 0;
  5366. this.resetBounds();
  5367. this.invalidate()
  5368. },
  5369. invalidate: function () {
  5370. this.synced &&
  5371. (this.synced = !1, this.rgPending || null == this.displayObject || null == this.displayObject.get_stage() || (k.Lib.schedule(A(this, this.regenerate)), this.rgPending = !0))
  5372. },
  5373. grab: function (a, b, d, c) {
  5374. var e;
  5375. a < (e = this.bounds.x) && (e -= a, this.bounds.x -= e, this.bounds.width += e);
  5376. b < (e = this.bounds.y) && (e -= b, this.bounds.y -= e, this.bounds.height += e);
  5377. d > (e = this.bounds.get_right()) && (this.bounds.width += d - e);
  5378. c > (e = this.bounds.get_bottom()) && (this.bounds.height += c - e);
  5379. this.invalidate()
  5380. },
  5381. resetBounds: function () {
  5382. this.bounds.setVoid();
  5383. this.invalidate()
  5384. },
  5385. set_displayObject: function (a) {
  5386. this.displayObject != a && (this.displayObject = a, this.synced || k.Lib.schedule(A(this, this.regenerate)));
  5387. return a
  5388. },
  5389. regenerate: function () {
  5390. var a = this.component,
  5391. b = this.component.style,
  5392. d = this.context,
  5393. c = this.bounds,
  5394. e = ~~ (c.x - 2),
  5395. f = ~~ (c.y - 2),
  5396. l = Math.ceil(c.width + 4),
  5397. m = Math.ceil(c.height + 4);
  5398. this.synced = !0;
  5399. this.rgPending = !1;
  5400. if (0 >= c.width || 0 >= c.height) a.width = a.height = 1, b.top = b.left = "0";
  5401. else {
  5402. if (this.compX != e || this.compY != f) b.left = e + "px", b.top = f + "px";
  5403. l != a.width || m != a.height ? (a.width = l, a.height =
  5404. m) : d.clearRect(0, 0, a.width, a.height);
  5405. d.save();
  5406. d.translate(-e, -f);
  5407. this.render(a, d);
  5408. d.restore()
  5409. }
  5410. },
  5411. __class__: k.display.Graphics
  5412. };
  5413. k.display.Loader = function () {
  5414. k.display.Sprite.call(this);
  5415. this.contentLoaderInfo = k.display.LoaderInfo.create(this)
  5416. };
  5417. s["flash.display.Loader"] = k.display.Loader;
  5418. k.display.Loader.__name__ = ["flash", "display", "Loader"];
  5419. k.display.Loader.__super__ = k.display.Sprite;
  5420. k.display.Loader.prototype = I(k.display.Sprite.prototype, {
  5421. handleLoad: function (a) {
  5422. a.set_currentTarget(this);
  5423. this.contentLoaderInfo.removeEventListener("complete",
  5424. A(this, this.handleLoad))
  5425. },
  5426. loadBytes: function (a) {
  5427. var b = this;
  5428. try {
  5429. this.contentLoaderInfo.addEventListener("complete", A(this, this.handleLoad), !1), k.display.BitmapData.loadFromBytes(a, null, function (a) {
  5430. b.content = new k.display.Bitmap(a);
  5431. b.contentLoaderInfo.content = b.content;
  5432. b.addChild(b.content);
  5433. a = new k.events.Event("complete");
  5434. a.set_currentTarget(b);
  5435. b.contentLoaderInfo.dispatchEvent(a)
  5436. })
  5437. } catch (d) {
  5438. y.Log.trace("Error " + K.string(d), {
  5439. fileName: "Loader.hx",
  5440. lineNumber: 96,
  5441. className: "flash.display.Loader",
  5442. methodName: "loadBytes"
  5443. }),
  5444. a = new k.events.IOErrorEvent("ioError"), a.set_currentTarget(this), this.contentLoaderInfo.dispatchEvent(a)
  5445. }
  5446. },
  5447. load: function (a, b) {
  5448. var d = "",
  5449. c = a.url.split(".");
  5450. 0 < c.length && (d = c[c.length - 1].toLowerCase());
  5451. c = !0;
  5452. this.contentLoaderInfo.url = a.url;
  5453. var e = this.contentLoaderInfo;
  5454. switch (d) {
  5455. case "swf":
  5456. d = "application/x-shockwave-flash";
  5457. break;
  5458. case "jpg":
  5459. case "jpeg":
  5460. c = !1;
  5461. d = "image/jpeg";
  5462. break;
  5463. case "png":
  5464. d = "image/png";
  5465. break;
  5466. case "gif":
  5467. d = "image/gif";
  5468. break;
  5469. default:
  5470. throw "Unrecognized file " + a.url;
  5471. }
  5472. e.contentType = d;
  5473. this.mImage =
  5474. new k.display.BitmapData(0, 0, c);
  5475. try {
  5476. this.contentLoaderInfo.addEventListener("complete", A(this, this.handleLoad), !1), this.mImage.nmeLoadFromFile(a.url, this.contentLoaderInfo), this.content = new k.display.Bitmap(this.mImage), this.contentLoaderInfo.content = this.content, this.addChild(this.content)
  5477. } catch (f) {
  5478. y.Log.trace("Error " + K.string(f), {
  5479. fileName: "Loader.hx",
  5480. lineNumber: 60,
  5481. className: "flash.display.Loader",
  5482. methodName: "load"
  5483. });
  5484. d = new k.events.IOErrorEvent("ioError");
  5485. d.set_currentTarget(this);
  5486. this.contentLoaderInfo.dispatchEvent(d);
  5487. return
  5488. }
  5489. null == this.mShape && (this.mShape = new k.display.Shape, this.addChild(this.mShape))
  5490. },
  5491. __class__: k.display.Loader
  5492. });
  5493. k.display.LoaderInfo = function () {
  5494. k.events.EventDispatcher.call(this);
  5495. this.bytesLoaded = this.bytesTotal = 0;
  5496. this.childAllowsParent = !0;
  5497. this.parameters = {}
  5498. };
  5499. s["flash.display.LoaderInfo"] = k.display.LoaderInfo;
  5500. k.display.LoaderInfo.__name__ = ["flash", "display", "LoaderInfo"];
  5501. k.display.LoaderInfo.create = function (a) {
  5502. var b = new k.display.LoaderInfo;
  5503. null != a ? b.loader = a : b.url = "";
  5504. return b
  5505. };
  5506. k.display.LoaderInfo.__super__ =
  5507. k.events.EventDispatcher;
  5508. k.display.LoaderInfo.prototype = I(k.events.EventDispatcher.prototype, {
  5509. __class__: k.display.LoaderInfo
  5510. });
  5511. k.display.MovieClip = function () {
  5512. k.display.Sprite.call(this);
  5513. this.enabled = !0;
  5514. this.qIndex = this.qTotal = 0;
  5515. this.loaderInfo = k.display.LoaderInfo.create()
  5516. };
  5517. s["flash.display.MovieClip"] = k.display.MovieClip;
  5518. k.display.MovieClip.__name__ = ["flash", "display", "MovieClip"];
  5519. k.display.MovieClip.__super__ = k.display.Sprite;
  5520. k.display.MovieClip.prototype = I(k.display.Sprite.prototype, {
  5521. get_totalFrames: function () {
  5522. return this.qTotal
  5523. },
  5524. get_framesLoaded: function () {
  5525. return this.qTotal
  5526. },
  5527. get_currentFrame: function () {
  5528. return this.qIndex
  5529. },
  5530. stop: function () {},
  5531. prevFrame: function () {},
  5532. play: function () {},
  5533. nextFrame: function () {},
  5534. gotoAndStop: function (a, b) {},
  5535. gotoAndPlay: function (a, b) {},
  5536. __class__: k.display.MovieClip
  5537. });
  5538. k.display.PixelSnapping = s["flash.display.PixelSnapping"] = {
  5539. __ename__: ["flash", "display", "PixelSnapping"],
  5540. __constructs__: ["ALWAYS", "AUTO", "NEVER"]
  5541. };
  5542. k.display.PixelSnapping.ALWAYS = ["ALWAYS", 0];
  5543. k.display.PixelSnapping.ALWAYS.toString = N;
  5544. k.display.PixelSnapping.ALWAYS.__enum__ =
  5545. k.display.PixelSnapping;
  5546. k.display.PixelSnapping.AUTO = ["AUTO", 1];
  5547. k.display.PixelSnapping.AUTO.toString = N;
  5548. k.display.PixelSnapping.AUTO.__enum__ = k.display.PixelSnapping;
  5549. k.display.PixelSnapping.NEVER = ["NEVER", 2];
  5550. k.display.PixelSnapping.NEVER.toString = N;
  5551. k.display.PixelSnapping.NEVER.__enum__ = k.display.PixelSnapping;
  5552. k.display.Shape = function () {
  5553. (this.graphics = new k.display.Graphics).set_displayObject(this);
  5554. this.component = this.graphics.component;
  5555. k.display.DisplayObject.call(this)
  5556. };
  5557. s["flash.display.Shape"] =
  5558. k.display.Shape;
  5559. k.display.Shape.__name__ = ["flash", "display", "Shape"];
  5560. k.display.Shape.__interfaces__ = [k.display.IBitmapDrawable];
  5561. k.display.Shape.__super__ = k.display.DisplayObject;
  5562. k.display.Shape.prototype = I(k.display.DisplayObject.prototype, {
  5563. set_stage: function (a) {
  5564. var b = null == this.get_stage() && null != a;
  5565. a = k.display.DisplayObject.prototype.set_stage.call(this, a);
  5566. b && this.graphics.invalidate();
  5567. return a
  5568. },
  5569. drawToSurface: function (a, b, d, c, e, f, l) {
  5570. this.graphics.drawToSurface(a, b, d, c, e, f, l)
  5571. },
  5572. __class__: k.display.Shape
  5573. });
  5574. k.display.Stage = function () {
  5575. this.isTouchScreen = !1;
  5576. this.frameRate = 0;
  5577. k.display.DisplayObjectContainer.call(this);
  5578. var a = this.component.style;
  5579. a.position = "absolute";
  5580. //a.position = "relative";
  5581. //a.left = ((F.Browser.window.innerWidth - R.WIDTH) / 2) + "px";
  5582. this.component.id = "gameDiv";
  5583. a.overflow = "hidden";
  5584. a.width = a.height = "100%";
  5585. this.qTimeStamp = k.Lib.getTimer();
  5586. k.Lib.requestAnimationFrame(A(this, this.onAnimationFrame));
  5587. this.mousePos = new k.geom.Point;
  5588. a = F.Browser.window;
  5589. a.addEventListener("mousemove", A(this, this.onMouseMove));
  5590. a.addEventListener("touchstart", A(this, this.onTouch));
  5591. a.addEventListener("touchend", A(this, this.onTouch));
  5592. a.addEventListener("touchmove", A(this, this.onTouch))
  5593. };
  5594. s["flash.display.Stage"] = k.display.Stage;
  5595. k.display.Stage.__name__ = ["flash", "display", "Stage"];
  5596. k.display.Stage.__super__ = k.display.DisplayObjectContainer;
  5597. k.display.Stage.prototype = I(k.display.DisplayObjectContainer.prototype, {
  5598. onAnimationFrame: function () {
  5599. for (var a = k.Lib.getTimer(), b = -1; ++b < k.Lib.schLength;) k.Lib.schList[b](), k.Lib.schList[b] = null;
  5600. k.Lib.schLength = 0;
  5601. if (0 >= this.frameRate || a - this.qTimeStamp >= 1E3 / this.frameRate) this.qTimeStamp = a, a = new k.events.Event("enterFrame"),
  5602. this.broadcastEvent(a);
  5603. k.Lib.requestAnimationFrame(A(this, this.onAnimationFrame))
  5604. },
  5605. get_stage: function () {
  5606. return this
  5607. },
  5608. get_stageHeight: function () {
  5609. return F.Browser.window.innerHeight
  5610. },
  5611. get_stageWidth: function () {
  5612. return F.Browser.window.innerWidth
  5613. },
  5614. removeEventListener: function (a, b, d, c, e) {
  5615. null == e && (e = !1);
  5616. null == c && (c = 0);
  5617. null == d && (d = !1);
  5618. var f = this.component;
  5619. this.component = window;
  5620. k.display.DisplayObjectContainer.prototype.removeEventListener.call(this, a, b, d, c, e);
  5621. this.component = f
  5622. },
  5623. addEventListener: function (a,
  5624. b, d, c, e) {
  5625. null == e && (e = !1);
  5626. null == c && (c = 0);
  5627. null == d && (d = !1);
  5628. var f = this.component;
  5629. this.component = window;
  5630. k.display.DisplayObjectContainer.prototype.addEventListener.call(this, a, b, d, c, e);
  5631. this.component = f
  5632. },
  5633. onMouseMove: function (a) {
  5634. this.isTouchScreen || (this.mousePos.x = a.pageX, this.mousePos.y = a.pageY)
  5635. },
  5636. onTouch: function (a) {
  5637. this.isTouchScreen = !0;
  5638. 0 < a.targetTouches.length && (this.mousePos.x = a.targetTouches[0].pageX, this.mousePos.y = a.targetTouches[0].pageY);
  5639. a.preventDefault()
  5640. },
  5641. __class__: k.display.Stage
  5642. });
  5643. k.display.StageAlign =
  5644. s["flash.display.StageAlign"] = {
  5645. __ename__: ["flash", "display", "StageAlign"],
  5646. __constructs__: "TOP_RIGHT TOP_LEFT TOP RIGHT LEFT BOTTOM_RIGHT BOTTOM_LEFT BOTTOM".split(" ")
  5647. };
  5648. k.display.StageAlign.TOP_RIGHT = ["TOP_RIGHT", 0];
  5649. k.display.StageAlign.TOP_RIGHT.toString = N;
  5650. k.display.StageAlign.TOP_RIGHT.__enum__ = k.display.StageAlign;
  5651. k.display.StageAlign.TOP_LEFT = ["TOP_LEFT", 1];
  5652. k.display.StageAlign.TOP_LEFT.toString = N;
  5653. k.display.StageAlign.TOP_LEFT.__enum__ = k.display.StageAlign;
  5654. k.display.StageAlign.TOP = ["TOP", 2];
  5655. k.display.StageAlign.TOP.toString =
  5656. N;
  5657. k.display.StageAlign.TOP.__enum__ = k.display.StageAlign;
  5658. k.display.StageAlign.RIGHT = ["RIGHT", 3];
  5659. k.display.StageAlign.RIGHT.toString = N;
  5660. k.display.StageAlign.RIGHT.__enum__ = k.display.StageAlign;
  5661. k.display.StageAlign.LEFT = ["LEFT", 4];
  5662. k.display.StageAlign.LEFT.toString = N;
  5663. k.display.StageAlign.LEFT.__enum__ = k.display.StageAlign;
  5664. k.display.StageAlign.BOTTOM_RIGHT = ["BOTTOM_RIGHT", 5];
  5665. k.display.StageAlign.BOTTOM_RIGHT.toString = N;
  5666. k.display.StageAlign.BOTTOM_RIGHT.__enum__ = k.display.StageAlign;
  5667. k.display.StageAlign.BOTTOM_LEFT = ["BOTTOM_LEFT", 6];
  5668. k.display.StageAlign.BOTTOM_LEFT.toString = N;
  5669. k.display.StageAlign.BOTTOM_LEFT.__enum__ = k.display.StageAlign;
  5670. k.display.StageAlign.BOTTOM = ["BOTTOM", 7];
  5671. k.display.StageAlign.BOTTOM.toString = N;
  5672. k.display.StageAlign.BOTTOM.__enum__ = k.display.StageAlign;
  5673. k.display.StageDisplayState = s["flash.display.StageDisplayState"] = {
  5674. __ename__: ["flash", "display", "StageDisplayState"],
  5675. __constructs__: ["FULL_SCREEN", "FULL_SCREEN_INTERACTIVE", "NORMAL"]
  5676. };
  5677. k.display.StageDisplayState.FULL_SCREEN = ["FULL_SCREEN",
  5678. 0
  5679. ];
  5680. k.display.StageDisplayState.FULL_SCREEN.toString = N;
  5681. k.display.StageDisplayState.FULL_SCREEN.__enum__ = k.display.StageDisplayState;
  5682. k.display.StageDisplayState.FULL_SCREEN_INTERACTIVE = ["FULL_SCREEN_INTERACTIVE", 1];
  5683. k.display.StageDisplayState.FULL_SCREEN_INTERACTIVE.toString = N;
  5684. k.display.StageDisplayState.FULL_SCREEN_INTERACTIVE.__enum__ = k.display.StageDisplayState;
  5685. k.display.StageDisplayState.NORMAL = ["NORMAL", 2];
  5686. k.display.StageDisplayState.NORMAL.toString = N;
  5687. k.display.StageDisplayState.NORMAL.__enum__ =
  5688. k.display.StageDisplayState;
  5689. k.display.StageScaleMode = s["flash.display.StageScaleMode"] = {
  5690. __ename__: ["flash", "display", "StageScaleMode"],
  5691. __constructs__: ["SHOW_ALL", "NO_SCALE", "NO_BORDER", "EXACT_FIT"]
  5692. };
  5693. k.display.StageScaleMode.SHOW_ALL = ["SHOW_ALL", 0];
  5694. k.display.StageScaleMode.SHOW_ALL.toString = N;
  5695. k.display.StageScaleMode.SHOW_ALL.__enum__ = k.display.StageScaleMode;
  5696. k.display.StageScaleMode.NO_SCALE = ["NO_SCALE", 1];
  5697. k.display.StageScaleMode.NO_SCALE.toString = N;
  5698. k.display.StageScaleMode.NO_SCALE.__enum__ = k.display.StageScaleMode;
  5699. k.display.StageScaleMode.NO_BORDER = ["NO_BORDER", 2];
  5700. k.display.StageScaleMode.NO_BORDER.toString = N;
  5701. k.display.StageScaleMode.NO_BORDER.__enum__ = k.display.StageScaleMode;
  5702. k.display.StageScaleMode.EXACT_FIT = ["EXACT_FIT", 3];
  5703. k.display.StageScaleMode.EXACT_FIT.toString = N;
  5704. k.display.StageScaleMode.EXACT_FIT.__enum__ = k.display.StageScaleMode;
  5705. k.errors = {};
  5706. k.errors.Error = function (a, b) {
  5707. null == b && (b = 0);
  5708. null == a && (a = "");
  5709. this.message = a;
  5710. this.errorID = b
  5711. };
  5712. s["flash.errors.Error"] = k.errors.Error;
  5713. k.errors.Error.__name__ = ["flash",
  5714. "errors", "Error"
  5715. ];
  5716. k.errors.Error.prototype = {
  5717. toString: function () {
  5718. return null != this.message ? this.message : "Error"
  5719. },
  5720. getStackTrace: function () {
  5721. return y.CallStack.toString(y.CallStack.exceptionStack())
  5722. },
  5723. __class__: k.errors.Error
  5724. };
  5725. k.errors.IOError = function (a) {
  5726. null == a && (a = "");
  5727. k.errors.Error.call(this, a)
  5728. };
  5729. s["flash.errors.IOError"] = k.errors.IOError;
  5730. k.errors.IOError.__name__ = ["flash", "errors", "IOError"];
  5731. k.errors.IOError.__super__ = k.errors.Error;
  5732. k.errors.IOError.prototype = I(k.errors.Error.prototype, {
  5733. __class__: k.errors.IOError
  5734. });
  5735. k.events.Event = function (a, b, d) {
  5736. null == d && (d = !1);
  5737. null == b && (b = !1);
  5738. this.type = a;
  5739. this.bubbles = b;
  5740. this.cancelable = d
  5741. };
  5742. s["flash.events.Event"] = k.events.Event;
  5743. k.events.Event.__name__ = ["flash", "events", "Event"];
  5744. k.events.Event.prototype = {
  5745. clone: function () {
  5746. return new k.events.Event(this.type, this.bubbles, this.cancelable)
  5747. },
  5748. isDefaultPrevented: function () {
  5749. return this.defaultPrevented
  5750. },
  5751. set_currentTarget: function (a) {
  5752. return this._current = a
  5753. },
  5754. get_currentTarget: function () {
  5755. return this._current || this.currentTarget
  5756. },
  5757. set_target: function (a) {
  5758. return this._target =
  5759. a
  5760. },
  5761. get_target: function () {
  5762. return this._target || this.target
  5763. },
  5764. __class__: k.events.Event
  5765. };
  5766. k.events.TextEvent = function (a, b, d, c) {
  5767. null == c && (c = "");
  5768. null == d && (d = !1);
  5769. null == b && (b = !1);
  5770. k.events.Event.call(this, a, b, d);
  5771. this.text = c
  5772. };
  5773. s["flash.events.TextEvent"] = k.events.TextEvent;
  5774. k.events.TextEvent.__name__ = ["flash", "events", "TextEvent"];
  5775. k.events.TextEvent.__super__ = k.events.Event;
  5776. k.events.TextEvent.prototype = I(k.events.Event.prototype, {
  5777. __class__: k.events.TextEvent
  5778. });
  5779. k.events.ErrorEvent = function (a, b, d, c) {
  5780. k.events.TextEvent.call(this,
  5781. a, b, d);
  5782. this.text = c
  5783. };
  5784. s["flash.events.ErrorEvent"] = k.events.ErrorEvent;
  5785. k.events.ErrorEvent.__name__ = ["flash", "events", "ErrorEvent"];
  5786. k.events.ErrorEvent.__super__ = k.events.TextEvent;
  5787. k.events.ErrorEvent.prototype = I(k.events.TextEvent.prototype, {
  5788. __class__: k.events.ErrorEvent
  5789. });
  5790. k.events.FocusEvent = function (a, b, d, c, e, f) {
  5791. null == f && (f = 0);
  5792. null == e && (e = !1);
  5793. null == d && (d = !1);
  5794. null == b && (b = !1);
  5795. k.events.Event.call(this, a, b, d);
  5796. this.keyCode = f;
  5797. this.shiftKey = !0 == e;
  5798. this.set_target(c)
  5799. };
  5800. s["flash.events.FocusEvent"] = k.events.FocusEvent;
  5801. k.events.FocusEvent.__name__ = ["flash", "events", "FocusEvent"];
  5802. k.events.FocusEvent.__super__ = k.events.Event;
  5803. k.events.FocusEvent.prototype = I(k.events.Event.prototype, {
  5804. __class__: k.events.FocusEvent
  5805. });
  5806. k.events.HTTPStatusEvent = function (a, b, d, c) {
  5807. null == c && (c = 0);
  5808. null == d && (d = !1);
  5809. null == b && (b = !1);
  5810. this.status = c;
  5811. k.events.Event.call(this, a, b, d)
  5812. };
  5813. s["flash.events.HTTPStatusEvent"] = k.events.HTTPStatusEvent;
  5814. k.events.HTTPStatusEvent.__name__ = ["flash", "events", "HTTPStatusEvent"];
  5815. k.events.HTTPStatusEvent.__super__ = k.events.Event;
  5816. k.events.HTTPStatusEvent.prototype = I(k.events.Event.prototype, {
  5817. __class__: k.events.HTTPStatusEvent
  5818. });
  5819. k.events.IOErrorEvent = function (a, b, d, c) {
  5820. null == c && (c = "");
  5821. null == d && (d = !1);
  5822. null == b && (b = !1);
  5823. k.events.Event.call(this, a, b, d);
  5824. this.text = c
  5825. };
  5826. s["flash.events.IOErrorEvent"] = k.events.IOErrorEvent;
  5827. k.events.IOErrorEvent.__name__ = ["flash", "events", "IOErrorEvent"];
  5828. k.events.IOErrorEvent.__super__ = k.events.Event;
  5829. k.events.IOErrorEvent.prototype = I(k.events.Event.prototype, {
  5830. __class__: k.events.IOErrorEvent
  5831. });
  5832. k.events.KeyboardEvent =
  5833. function (a, b, d, c, e) {
  5834. null == e && (e = 0);
  5835. null == c && (c = 0);
  5836. null == d && (d = !1);
  5837. null == b && (b = !0);
  5838. k.events.Event.call(this, a, b, d);
  5839. this.keyCode = e;
  5840. this.charCode = c
  5841. };
  5842. s["flash.events.KeyboardEvent"] = k.events.KeyboardEvent;
  5843. k.events.KeyboardEvent.__name__ = ["flash", "events", "KeyboardEvent"];
  5844. k.events.KeyboardEvent.__super__ = k.events.Event;
  5845. k.events.KeyboardEvent.prototype = I(k.events.Event.prototype, {
  5846. __class__: k.events.KeyboardEvent
  5847. });
  5848. k.events.MouseEvent = function (a, b, d, c, e, f, l, m, h, p, C) {
  5849. null == C && (C = 0);
  5850. null == p && (p = !1);
  5851. null ==
  5852. h && (h = !1);
  5853. null == m && (m = !1);
  5854. null == l && (l = !1);
  5855. null == d && (d = !1);
  5856. null == b && (b = !0);
  5857. k.events.Event.call(this, a, b, d);
  5858. this.ctrlKey = l;
  5859. this.altKey = m;
  5860. this.shiftKey = h;
  5861. this.relatedObject = f;
  5862. this.button = p ? 0 : 1;
  5863. this.wheelDelta = C
  5864. };
  5865. s["flash.events.MouseEvent"] = k.events.MouseEvent;
  5866. k.events.MouseEvent.__name__ = ["flash", "events", "MouseEvent"];
  5867. k.events.MouseEvent.__super__ = k.events.Event;
  5868. k.events.MouseEvent.prototype = I(k.events.Event.prototype, {
  5869. updateAfterEvent: function () {},
  5870. get_localY: function () {
  5871. return this.get_localPoint().y
  5872. },
  5873. get_localX: function () {
  5874. return this.get_localPoint().x
  5875. },
  5876. get_localPoint: function () {
  5877. var a = k.events.MouseEvent.convPoint;
  5878. null == a && (k.events.MouseEvent.convPoint = a = new k.geom.Point);
  5879. a.x = this.pageX;
  5880. a.y = this.pageY;
  5881. return null != this.relatedObject ? this.relatedObject.globalToLocal(a, a) : a
  5882. },
  5883. get_stageY: function () {
  5884. return this.pageY
  5885. },
  5886. get_stageX: function () {
  5887. return this.pageX
  5888. },
  5889. get_delta: function () {
  5890. return this.wheelDelta
  5891. },
  5892. get_buttonDown: function () {
  5893. return 0 == this.button
  5894. },
  5895. __class__: k.events.MouseEvent
  5896. });
  5897. k.events.ProgressEvent =
  5898. function (a, b, d, c, e) {
  5899. null == e && (e = 0);
  5900. null == c && (c = 0);
  5901. null == d && (d = !1);
  5902. null == b && (b = !1);
  5903. k.events.Event.call(this, a, b, d);
  5904. this.bytesLoaded = c;
  5905. this.bytesTotal = e
  5906. };
  5907. s["flash.events.ProgressEvent"] = k.events.ProgressEvent;
  5908. k.events.ProgressEvent.__name__ = ["flash", "events", "ProgressEvent"];
  5909. k.events.ProgressEvent.__super__ = k.events.Event;
  5910. k.events.ProgressEvent.prototype = I(k.events.Event.prototype, {
  5911. __class__: k.events.ProgressEvent
  5912. });
  5913. k.events.SecurityErrorEvent = function (a, b, d, c) {
  5914. null == c && (c = "");
  5915. null == d && (d = !1);
  5916. null ==
  5917. b && (b = !1);
  5918. k.events.ErrorEvent.call(this, a, b, d);
  5919. this.text = c
  5920. };
  5921. s["flash.events.SecurityErrorEvent"] = k.events.SecurityErrorEvent;
  5922. k.events.SecurityErrorEvent.__name__ = ["flash", "events", "SecurityErrorEvent"];
  5923. k.events.SecurityErrorEvent.__super__ = k.events.ErrorEvent;
  5924. k.events.SecurityErrorEvent.prototype = I(k.events.ErrorEvent.prototype, {
  5925. __class__: k.events.SecurityErrorEvent
  5926. });
  5927. k.events.TouchEvent = function (a, b, d, c, e, f, l, m, h, p, C, r, Q, w) {
  5928. null == w && (w = !1);
  5929. null == Q && (Q = !1);
  5930. null == r && (r = !1);
  5931. null == d && (d = !1);
  5932. null == b &&
  5933. (b = !0);
  5934. k.events.Event.call(this, a, b, d);
  5935. this.altKey = Q;
  5936. this.shiftKey = w;
  5937. this.ctrlKey = r
  5938. };
  5939. s["flash.events.TouchEvent"] = k.events.TouchEvent;
  5940. k.events.TouchEvent.__name__ = ["flash", "events", "TouchEvent"];
  5941. k.events.TouchEvent.__super__ = k.events.Event;
  5942. k.events.TouchEvent.prototype = I(k.events.Event.prototype, {
  5943. __class__: k.events.TouchEvent
  5944. });
  5945. k.filters = {};
  5946. k.filters.BitmapFilter = function (a) {
  5947. this._mType = a
  5948. };
  5949. s["flash.filters.BitmapFilter"] = k.filters.BitmapFilter;
  5950. k.filters.BitmapFilter.__name__ = ["flash", "filters", "BitmapFilter"];
  5951. k.filters.BitmapFilter.prototype = {
  5952. nmeApplyFilter: function (a, b, d) {},
  5953. nmePreFilter: function (a) {},
  5954. clone: function () {
  5955. throw "Implement in subclass. BitmapFilter::clone";
  5956. },
  5957. __class__: k.filters.BitmapFilter
  5958. };
  5959. k.geom = {};
  5960. k.geom.ColorTransform = function (a, b, d, c, e, f, l, m) {
  5961. null == m && (m = 0);
  5962. null == l && (l = 0);
  5963. null == f && (f = 0);
  5964. null == e && (e = 0);
  5965. null == c && (c = 1);
  5966. null == d && (d = 1);
  5967. null == b && (b = 1);
  5968. null == a && (a = 1);
  5969. this.redMultiplier = a;
  5970. this.greenMultiplier = b;
  5971. this.blueMultiplier = d;
  5972. this.alphaMultiplier = c;
  5973. this.redOffset = e;
  5974. this.greenOffset = f;
  5975. this.blueOffset =
  5976. l;
  5977. this.alphaOffset = m
  5978. };
  5979. s["flash.geom.ColorTransform"] = k.geom.ColorTransform;
  5980. k.geom.ColorTransform.__name__ = ["flash", "geom", "ColorTransform"];
  5981. k.geom.ColorTransform.prototype = {
  5982. set_color: function (a) {
  5983. this.redOffset = a >> 16 & 255;
  5984. this.greenOffset = a >> 8 & 255;
  5985. this.blueOffset = a & 255;
  5986. this.redMultiplier = this.greenMultiplier = this.blueMultiplier = 0;
  5987. return this.get_color()
  5988. },
  5989. get_color: function () {
  5990. return (this.redOffset | 0) << 16 | (this.greenOffset | 0) << 8 | this.blueOffset | 0
  5991. },
  5992. isAlphaMultiplier: function () {
  5993. return 1 == this.redMultiplier &&
  5994. 1 == this.greenMultiplier && 1 == this.blueMultiplier && 0 == this.redOffset && 0 == this.greenOffset && 0 == this.blueOffset && 0 == this.alphaOffset
  5995. },
  5996. isColorSetter: function () {
  5997. return 0 == this.redMultiplier && 0 == this.greenMultiplier && 0 == this.blueMultiplier && (0 == this.alphaMultiplier || 0 == this.alphaOffset)
  5998. },
  5999. concat: function (a) {
  6000. this.redMultiplier += a.redMultiplier;
  6001. this.greenMultiplier += a.greenMultiplier;
  6002. this.blueMultiplier += a.blueMultiplier;
  6003. this.alphaMultiplier += a.alphaMultiplier
  6004. },
  6005. __class__: k.geom.ColorTransform
  6006. };
  6007. k.geom.Matrix =
  6008. function (a, b, d, c, e, f) {
  6009. this.a = null == a ? 1 : a;
  6010. this.b = null == b ? 0 : b;
  6011. this.c = null == d ? 0 : d;
  6012. this.d = null == c ? 1 : c;
  6013. this.tx = null == e ? 0 : e;
  6014. this.ty = null == f ? 0 : f
  6015. };
  6016. s["flash.geom.Matrix"] = k.geom.Matrix;
  6017. k.geom.Matrix.__name__ = ["flash", "geom", "Matrix"];
  6018. k.geom.Matrix.prototype = {
  6019. to3dString: function () {
  6020. return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)"
  6021. },
  6022. toString: function () {
  6023. return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")"
  6024. },
  6025. transformPoint: function (a) {
  6026. return new k.geom.Point(a.x * this.a + a.y * this.c + this.tx, a.x * this.b + a.y * this.d + this.ty)
  6027. },
  6028. concat: function (a) {
  6029. var b;
  6030. b = this.a * a.a + this.b * a.c;
  6031. this.b = this.a * a.b + this.b * a.d;
  6032. this.a = b;
  6033. b = this.c * a.a + this.d * a.c;
  6034. this.d = this.c * a.b + this.d * a.d;
  6035. this.c = b;
  6036. b = this.tx * a.a + this.ty * a.c + a.tx;
  6037. this.ty = this.tx * a.b + this.ty * a.d + a.ty;
  6038. this.tx = b
  6039. },
  6040. scale: function (a, b) {
  6041. this.a *= a;
  6042. this.b *= b;
  6043. this.c *= a;
  6044. this.d *= b;
  6045. this.tx *= a;
  6046. this.ty *= b
  6047. },
  6048. rotate: function (a) {
  6049. var b = Math.cos(a);
  6050. a = Math.sin(a);
  6051. var d;
  6052. d = this.a * b - this.b * a;
  6053. this.b = this.a * a + this.b * b;
  6054. this.a = d;
  6055. d = this.c * b - this.d * a;
  6056. this.d = this.c * a + this.d * b;
  6057. this.c = d;
  6058. d = this.tx * b - this.ty * a;
  6059. this.ty = this.tx * a + this.ty * b;
  6060. this.tx = d
  6061. },
  6062. translate: function (a, b) {
  6063. this.tx += a;
  6064. this.ty += b
  6065. },
  6066. invert: function () {
  6067. var a, b = this.a * this.d - this.b * this.c;
  6068. 0 == b ? (this.a = this.b = this.c = this.d = 0, this.tx = -this.tx, this.ty = -this.ty) : (b = 1 / b, a = this.d * b, this.d = this.a * b, this.a = a, this.b *= -b, this.c *= -b, a = -this.a * this.tx - this.c * this.ty, this.ty = -this.b * this.tx - this.d * this.ty, this.tx = a)
  6069. },
  6070. copy: function (a) {
  6071. this.a = a.a;
  6072. this.b =
  6073. a.b;
  6074. this.c = a.c;
  6075. this.d = a.d;
  6076. this.tx = a.tx;
  6077. this.ty = a.ty
  6078. },
  6079. isIdentity: function () {
  6080. return 1 == this.a && 1 == this.d && 0 == this.tx && 0 == this.ty && 0 == this.b && 0 == this.c
  6081. },
  6082. identity: function () {
  6083. this.a = this.d = 1;
  6084. this.b = this.c = this.tx = this.ty = 0
  6085. },
  6086. clone: function () {
  6087. return new k.geom.Matrix(this.a, this.b, this.c, this.d, this.tx, this.ty)
  6088. },
  6089. __class__: k.geom.Matrix
  6090. };
  6091. k.geom.Point = function (a, b) {
  6092. this.x = null == a ? 0 : a;
  6093. this.y = null == b ? 0 : b
  6094. };
  6095. s["flash.geom.Point"] = k.geom.Point;
  6096. k.geom.Point.__name__ = ["flash", "geom", "Point"];
  6097. k.geom.Point.interpolate =
  6098. function (a, b, d) {
  6099. return new k.geom.Point(a.x + d * (b.x - a.x), a.y + d * (b.y - a.y))
  6100. };
  6101. k.geom.Point.polar = function (a, b) {
  6102. return new k.geom.Point(Math.cos(b) * a, Math.sin(b) * a)
  6103. };
  6104. k.geom.Point.prototype = {
  6105. subtract: function (a) {
  6106. return new k.geom.Point(this.x - a.x, this.y - a.y)
  6107. },
  6108. add: function (a) {
  6109. return new k.geom.Point(this.x + a.x, this.y + a.y)
  6110. },
  6111. offset: function (a, b) {
  6112. this.x += a;
  6113. this.y += b
  6114. },
  6115. normalize: function (a) {
  6116. 0 == this.y ? this.x = 0 > this.x ? -a : a : 0 == this.x ? this.y = 0 > this.y ? -a : a : (a /= Math.sqrt(this.x * this.x + this.y * this.y), this.x *= a, this.y *=
  6117. a)
  6118. },
  6119. toString: function () {
  6120. return "point(" + this.x + ", " + this.y + ")"
  6121. },
  6122. get_length: function () {
  6123. return Math.sqrt(this.x * this.x + this.y * this.y)
  6124. },
  6125. equals: function (a) {
  6126. return this.x == a.x && this.y == a.y
  6127. },
  6128. clone: function () {
  6129. return new k.geom.Point(this.x, this.y)
  6130. },
  6131. __class__: k.geom.Point
  6132. };
  6133. k.geom.Rectangle = function (a, b, d, c) {
  6134. null == c && (c = 0);
  6135. null == d && (d = 0);
  6136. null == b && (b = 0);
  6137. null == a && (a = 0);
  6138. this.x = a;
  6139. this.y = b;
  6140. this.width = d;
  6141. this.height = c
  6142. };
  6143. s["flash.geom.Rectangle"] = k.geom.Rectangle;
  6144. k.geom.Rectangle.__name__ = ["flash", "geom", "Rectangle"];
  6145. k.geom.Rectangle.prototype = {
  6146. toString: function () {
  6147. return "Rectangle(" + this.x + ", " + this.y + ", " + this.width + ", " + this.height + ")"
  6148. },
  6149. transform: function (a) {
  6150. var b, d, c, e, f;
  6151. e = d = a.a * this.x + a.c * this.y;
  6152. f = c = a.b * this.x + a.d * this.y;
  6153. b = a.a * (this.x + this.width) + a.c * this.y;
  6154. b < d && (d = b);
  6155. b > e && (e = b);
  6156. b = a.b * (this.x + this.width) + a.d * this.y;
  6157. b < c && (c = b);
  6158. b > f && (f = b);
  6159. b = a.a * this.x + a.c * (this.y + this.height);
  6160. b < d && (d = b);
  6161. b > e && (e = b);
  6162. b = a.b * this.x + a.d * (this.y + this.height);
  6163. b < c && (c = b);
  6164. b > f && (f = b);
  6165. b = a.a * (this.x + this.width) + a.c * (this.y + this.height);
  6166. b < d && (d = b);
  6167. b > e && (e = b);
  6168. b = a.b * (this.x + this.width) + a.d * (this.y + this.height);
  6169. b < c && (c = b);
  6170. b > f && (f = b);
  6171. this.x = d + a.tx;
  6172. this.width = e - d;
  6173. this.y = c + a.ty;
  6174. this.height = f - c
  6175. },
  6176. offsetPoint: function (a) {
  6177. this.x += a.x;
  6178. this.y += a.y
  6179. },
  6180. offset: function (a, b) {
  6181. this.x += a;
  6182. this.y += b
  6183. },
  6184. inflatePoint: function (a) {
  6185. this.inflate(a.x, a.y)
  6186. },
  6187. inflate: function (a, b) {
  6188. this.x -= a;
  6189. this.y -= b;
  6190. this.width += 2 * a;
  6191. this.height += 2 * b
  6192. },
  6193. union: function (a) {
  6194. var b, d, c, e;
  6195. return new k.geom.Rectangle((b = this.x) < (c = a.x) ? b : c, (d = this.y) < (e = a.y) ? d : e, (b += this.width) > (c += a.width) ?
  6196. b : c, (d += this.height) > (e += a.height) ? d : e)
  6197. },
  6198. join: function (a) {
  6199. var b;
  6200. 0 > (b = a.x - this.x) && (this.x += b, this.width -= b);
  6201. 0 > (b = a.y - this.y) && (this.y += b, this.height -= b);
  6202. 0 < (b = a.x + a.width - (this.x + this.width)) && (this.width += b);
  6203. 0 < (b = a.y + a.height - (this.y + this.height)) && (this.height += b)
  6204. },
  6205. intersects: function (a) {
  6206. var b, d, c, e;
  6207. return (this.x < (b = a.x) ? b : this.x) <= (this.x + this.width > (d = a.x + a.width) ? d : this.x + this.width) ? !1 : (this.y < (c = a.y) ? c : this.y) <= (this.y + this.height > (e = a.y + a.height) ? e : this.y)
  6208. },
  6209. intersection: function (a) {
  6210. var b, d,
  6211. c, e, f, l;
  6212. return (b = (f = this.x) < (l = a.x) ? l : f) <= (d = (f += this.width) > (l += a.width) ? l : f) && (c = (f = this.y) < (l = a.y) ? l : f) <= (e = (f += this.height) > (l += a.height) ? l : f) ? new k.geom.Rectangle(b, c, d - b, e - c) : new k.geom.Rectangle
  6213. },
  6214. containsRect: function (a) {
  6215. return 0 >= a.width || 0 >= a.height ? a.x > this.x && a.y > this.y && a.x + a.width < this.x + this.width && a.y + a.height < this.y + this.height : a.x >= this.x && a.y >= this.y && a.x + a.width <= this.x + this.width && a.y + a.height <= this.y + this.height
  6216. },
  6217. containsPoint: function (a) {
  6218. return this.contains(a.x, a.y)
  6219. },
  6220. contains: function (a,
  6221. b) {
  6222. return 0 <= (a -= this.x) && 0 <= (b -= this.y) && a < this.width && b < this.height
  6223. },
  6224. set_bottomRight: function (a) {
  6225. this.width = a.x - this.x;
  6226. this.height = a.y - this.y;
  6227. return a.clone()
  6228. },
  6229. get_bottomRight: function () {
  6230. return new k.geom.Point(this.x + this.width, this.y + this.height)
  6231. },
  6232. set_topLeft: function (a) {
  6233. this.width = a.x;
  6234. this.height = a.y;
  6235. return a.clone()
  6236. },
  6237. get_topLeft: function () {
  6238. return new k.geom.Point(this.x, this.y)
  6239. },
  6240. set_size: function (a) {
  6241. this.width = a.x;
  6242. this.height = a.y;
  6243. return a.clone()
  6244. },
  6245. get_size: function () {
  6246. return new k.geom.Point(this.width,
  6247. this.height)
  6248. },
  6249. set_bottom: function (a) {
  6250. this.height = a - this.y;
  6251. return a
  6252. },
  6253. get_bottom: function () {
  6254. return this.y + this.height
  6255. },
  6256. set_right: function (a) {
  6257. this.width = a - this.x;
  6258. return a
  6259. },
  6260. get_right: function () {
  6261. return this.x + this.width
  6262. },
  6263. set_top: function (a) {
  6264. this.height -= a - this.y;
  6265. return this.y = a
  6266. },
  6267. get_top: function () {
  6268. return this.y
  6269. },
  6270. set_left: function (a) {
  6271. this.width -= a - this.x;
  6272. return this.x = a
  6273. },
  6274. get_left: function () {
  6275. return this.x
  6276. },
  6277. setVoid: function () {
  6278. this.width -= 2147483647 - this.x;
  6279. this.x = 2147483647;
  6280. this.width = -2147483648 - this.x; - 2147483648;
  6281. this.height -= 2147483647 - this.y;
  6282. this.y = 2147483647;
  6283. this.height = -2147483648 - this.y; - 2147483648
  6284. },
  6285. setTo: function (a, b, d, c) {
  6286. this.x = a;
  6287. this.y = b;
  6288. this.width = d;
  6289. this.height = c
  6290. },
  6291. copyFrom: function (a) {
  6292. this.x = a.x;
  6293. this.y = a.y;
  6294. this.width = a.width;
  6295. this.height = a.height
  6296. },
  6297. setEmpty: function () {
  6298. this.x = this.y = this.width = this.height = 0
  6299. },
  6300. isEmpty: function () {
  6301. return 0 >= this.width || 0 >= this.height
  6302. },
  6303. equals: function (a) {
  6304. return this.x == a.x && this.y == a.y && this.width == a.width && this.height == a.height
  6305. },
  6306. clone: function () {
  6307. return new k.geom.Rectangle(this.x,
  6308. this.y, this.width, this.height)
  6309. },
  6310. __class__: k.geom.Rectangle
  6311. };
  6312. k.geom.Transform = function (a) {
  6313. if (null == a) throw "Cannot create Transform with no DisplayObject.";
  6314. this._displayObject = a;
  6315. this._matrix = new k.geom.Matrix;
  6316. this._fullMatrix = new k.geom.Matrix;
  6317. this.set_colorTransform(new k.geom.ColorTransform)
  6318. };
  6319. s["flash.geom.Transform"] = k.geom.Transform;
  6320. k.geom.Transform.__name__ = ["flash", "geom", "Transform"];
  6321. k.geom.Transform.prototype = {
  6322. get_pixelBounds: function () {
  6323. return this._displayObject.getBounds(null)
  6324. },
  6325. set_matrix: function (a) {
  6326. this._matrix.copy(a);
  6327. this._displayObject.syncMtx();
  6328. return this._matrix
  6329. },
  6330. get_matrix: function () {
  6331. return this._matrix.clone()
  6332. },
  6333. get_concatenatedMatrix: function () {
  6334. return this.nmeGetFullMatrix(this._matrix)
  6335. },
  6336. set_colorTransform: function (a) {
  6337. return this.colorTransform = a
  6338. },
  6339. nmeSetMatrix: function (a) {
  6340. this._matrix.copy(a)
  6341. },
  6342. nmeSetFullMatrix: function (a) {
  6343. this._fullMatrix.copy(a);
  6344. return this._fullMatrix
  6345. },
  6346. nmeGetFullMatrix: function (a) {
  6347. var b;
  6348. null != a ? (b = new k.geom.Matrix(a.a, a.b, a.c, a.d, a.tx, a.ty)).concat(this._fullMatrix) : b = this._fullMatrix.clone();
  6349. return b
  6350. },
  6351. __class__: k.geom.Transform
  6352. };
  6353. k.media = {};
  6354. k.media.Sound = function (a, b) {
  6355. k.events.EventDispatcher.call(this);
  6356. null != a && this.load(a, b)
  6357. };
  6358. s["flash.media.Sound"] = k.media.Sound;
  6359. k.media.Sound.__name__ = ["flash", "media", "Sound"];
  6360. k.media.Sound.canPlayType = function (a) {
  6361. var b;
  6362. a = a.toLowerCase();
  6363. if (null != k.media.Sound.canPlayMap) {
  6364. if (k.media.Sound.canPlayMap.exists(a)) return k.media.Sound.canPlayMap.get(a)
  6365. } else k.media.Sound.canPlayMap = new y.ds.StringMap;
  6366. b = k.media.Sound.getFormatType(a);
  6367. b = "no" != (new Audio).canPlayType(b);
  6368. k.media.Sound.canPlayMap.set(a, b);
  6369. return b
  6370. };
  6371. k.media.Sound.getFormatType = function (a) {
  6372. return "mp3" == a ? "audio/mpeg;" : "ogg" == a ? 'audio/ogg; codecs="vorbis"' : null
  6373. };
  6374. k.media.Sound.__super__ = k.events.EventDispatcher;
  6375. k.media.Sound.prototype = I(k.events.EventDispatcher.prototype, {
  6376. get_length: function () {
  6377. return null != this.component ? 1E3 * this.component.duration : 0
  6378. },
  6379. play: function (a, b, d) {
  6380. null == b && (b = 0);
  6381. null == a && (a = 0);
  6382. var c;
  6383. if (0 == this.qCache.length)(c = new k.media.SoundChannel).init(this, this.component, b), this.component =
  6384. this.component.cloneNode(!0);
  6385. else {
  6386. c = this.qCache[0];
  6387. b = 0;
  6388. for (var e = this.qCache; b < e.length;) {
  6389. var f = e[b];
  6390. ++b;
  6391. if (f.get_position() == a) {
  6392. c = f;
  6393. break
  6394. }
  6395. }
  6396. S.remove(this.qCache, c)
  6397. }
  6398. c.set_soundTransform(d);
  6399. try {
  6400. c.play(a)
  6401. } catch (l) {
  6402. var m = null,
  6403. m = function (b) {
  6404. c.component.removeEventListener("canplaythrough", m);
  6405. c.play(a)
  6406. };
  6407. c.addEventListener("canplaythrough", m)
  6408. }
  6409. return c
  6410. },
  6411. load: function (a, b) {
  6412. var d = a.url;
  6413. k.media.Sound.library.exists(d) ? (this.component = k.media.Sound.library.get(d), k.media.Sound.library.set(d, this.component.cloneNode(!0))) :
  6414. this.component = new Audio(d);
  6415. this.qCache = []
  6416. },
  6417. close: function () {
  6418. if (null != this.component) this.component = null;
  6419. else throw new k.errors.IOError("Attempt to close unexisting stream.");
  6420. },
  6421. __class__: k.media.Sound
  6422. });
  6423. k.media.SoundChannel = function () {
  6424. this._loops = 1;
  6425. this._position = 0;
  6426. this.active = !1;
  6427. this.leftPeak = this.rightPeak = 1;
  6428. k.events.EventDispatcher.call(this)
  6429. };
  6430. s["flash.media.SoundChannel"] = k.media.SoundChannel;
  6431. k.media.SoundChannel.__name__ = ["flash", "media", "SoundChannel"];
  6432. k.media.SoundChannel.__super__ = k.events.EventDispatcher;
  6433. k.media.SoundChannel.prototype = I(k.events.EventDispatcher.prototype, {
  6434. onEnded: function (a) {
  6435. this.active && (this._loops--, 0 < this._loops ? this.component.play() : (this.stop(), this.component.currentTime = 0, this.dispatchEvent(new k.events.Event("soundComplete"))))
  6436. },
  6437. set_position: function (a) {
  6438. var b = !this.component.paused;
  6439. b && this.component.pause();
  6440. this.component.currentTime = a / 1E3;
  6441. b && this.component.play();
  6442. return a
  6443. },
  6444. get_position: function () {
  6445. return 1E3 * this.component.currentTime
  6446. },
  6447. set_soundTransform: function (a) {
  6448. this.soundTransform =
  6449. a;
  6450. this.component.volume = null != a ? a.volume : 1;
  6451. return a
  6452. },
  6453. stop: function () {
  6454. this.active && (this.active = !1, this.component.pause(), this.qSound.qCache.push(this))
  6455. },
  6456. play: function (a) {
  6457. this.active || (this.component.play(), this.set_position(a), this.active = !0)
  6458. },
  6459. init: function (a, b, d) {
  6460. null == d && (d = 1);
  6461. this.qSound = a;
  6462. this.component = b;
  6463. this._loops = d;
  6464. this.component.addEventListener("ended", A(this, this.onEnded))
  6465. },
  6466. __class__: k.media.SoundChannel
  6467. });
  6468. k.media.SoundLoaderContext = function (a, b) {
  6469. null == b && (b = !1);
  6470. null == a && (a = 0);
  6471. this.bufferTime =
  6472. a;
  6473. this.checkPolicyFile = b
  6474. };
  6475. s["flash.media.SoundLoaderContext"] = k.media.SoundLoaderContext;
  6476. k.media.SoundLoaderContext.__name__ = ["flash", "media", "SoundLoaderContext"];
  6477. k.media.SoundLoaderContext.prototype = {
  6478. __class__: k.media.SoundLoaderContext
  6479. };
  6480. k.media.SoundTransform = function (a, b) {
  6481. null == b && (b = 0);
  6482. null == a && (a = 1);
  6483. this.volume = a;
  6484. this.pan = b
  6485. };
  6486. s["flash.media.SoundTransform"] = k.media.SoundTransform;
  6487. k.media.SoundTransform.__name__ = ["flash", "media", "SoundTransform"];
  6488. k.media.SoundTransform.prototype = {
  6489. __class__: k.media.SoundTransform
  6490. };
  6491. k.net = {};
  6492. k.net.SharedObject = function () {
  6493. k.events.EventDispatcher.call(this)
  6494. };
  6495. s["flash.net.SharedObject"] = k.net.SharedObject;
  6496. k.net.SharedObject.__name__ = ["flash", "net", "SharedObject"];
  6497. k.net.SharedObject.getLocal = function (a, b, d) {
  6498. null == b && (b = F.Browser.window.location.href);
  6499. d = new k.net.SharedObject;
  6500. d.nmeKey = b + ":" + a;
  6501. a = null;
  6502. try {
  6503. a = k.net.SharedObject.nmeGetLocalStorage().getItem(d.nmeKey)
  6504. } catch (c) {}
  6505. d.data = {};
  6506. null != a && "" != a && (a = new y.Unserializer(a), a.setResolver({
  6507. resolveEnum: Y.resolveEnum,
  6508. resolveClass: k.net.SharedObject.resolveClass
  6509. }),
  6510. d.data = a.unserialize());
  6511. null == d.data && (d.data = {});
  6512. return d
  6513. };
  6514. k.net.SharedObject.nmeGetLocalStorage = function () {
  6515. var a = F.Browser.getLocalStorage();
  6516. if (null == a) throw new k.errors.Error("SharedObject not supported");
  6517. return a
  6518. };
  6519. k.net.SharedObject.resolveClass = function (a) {
  6520. return null != a ? Y.resolveClass($.replace($.replace(a, "jeash.", "flash."), "browser.", "flash.")) : null
  6521. };
  6522. k.net.SharedObject.__super__ = k.events.EventDispatcher;
  6523. k.net.SharedObject.prototype = I(k.events.EventDispatcher.prototype, {
  6524. get_size: function () {
  6525. return y.io.Bytes.ofString(y.Serializer.run(this.data)).length
  6526. },
  6527. setProperty: function (a, b) {
  6528. null != this.data && (this.data[a] = b)
  6529. },
  6530. flush: function () {
  6531. var a = y.Serializer.run(this.data);
  6532. try {
  6533. k.net.SharedObject.nmeGetLocalStorage().removeItem(this.nmeKey), k.net.SharedObject.nmeGetLocalStorage().setItem(this.nmeKey, a)
  6534. } catch (b) {
  6535. return k.net.SharedObjectFlushStatus.PENDING
  6536. }
  6537. return k.net.SharedObjectFlushStatus.FLUSHED
  6538. },
  6539. clear: function () {
  6540. this.data = {};
  6541. try {
  6542. k.net.SharedObject.nmeGetLocalStorage().removeItem(this.nmeKey)
  6543. } catch (a) {}
  6544. this.flush()
  6545. },
  6546. __class__: k.net.SharedObject
  6547. });
  6548. k.net.SharedObjectFlushStatus =
  6549. s["flash.net.SharedObjectFlushStatus"] = {
  6550. __ename__: ["flash", "net", "SharedObjectFlushStatus"],
  6551. __constructs__: ["FLUSHED", "PENDING"]
  6552. };
  6553. k.net.SharedObjectFlushStatus.FLUSHED = ["FLUSHED", 0];
  6554. k.net.SharedObjectFlushStatus.FLUSHED.toString = N;
  6555. k.net.SharedObjectFlushStatus.FLUSHED.__enum__ = k.net.SharedObjectFlushStatus;
  6556. k.net.SharedObjectFlushStatus.PENDING = ["PENDING", 1];
  6557. k.net.SharedObjectFlushStatus.PENDING.toString = N;
  6558. k.net.SharedObjectFlushStatus.PENDING.__enum__ = k.net.SharedObjectFlushStatus;
  6559. k.net.URLLoader =
  6560. function (a) {
  6561. k.events.EventDispatcher.call(this);
  6562. this.bytesTotal = this.bytesLoaded = 0;
  6563. this.set_dataFormat(k.net.URLLoaderDataFormat.TEXT);
  6564. null != a && this.load(a)
  6565. };
  6566. s["flash.net.URLLoader"] = k.net.URLLoader;
  6567. k.net.URLLoader.__name__ = ["flash", "net", "URLLoader"];
  6568. k.net.URLLoader.__super__ = k.events.EventDispatcher;
  6569. k.net.URLLoader.prototype = I(k.events.EventDispatcher.prototype, {
  6570. onStatus: function (a) {
  6571. a = new k.events.HTTPStatusEvent("httpStatus", !1, !1, a);
  6572. a.set_currentTarget(this);
  6573. this.dispatchEvent(a)
  6574. },
  6575. onSecurityError: function (a) {
  6576. var b =
  6577. new k.events.SecurityErrorEvent("securityError");
  6578. b.text = a;
  6579. b.set_currentTarget(this);
  6580. this.dispatchEvent(b)
  6581. },
  6582. onProgress: function (a) {
  6583. var b = new k.events.ProgressEvent("progress");
  6584. b.set_currentTarget(this);
  6585. b.bytesLoaded = a.loaded;
  6586. b.bytesTotal = a.total;
  6587. this.dispatchEvent(b)
  6588. },
  6589. onOpen: function () {
  6590. var a = new k.events.Event("open");
  6591. a.set_currentTarget(this);
  6592. this.dispatchEvent(a)
  6593. },
  6594. onError: function (a) {
  6595. var b = new k.events.IOErrorEvent("ioError");
  6596. b.text = a;
  6597. b.set_currentTarget(this);
  6598. this.dispatchEvent(b)
  6599. },
  6600. onData: function (a) {
  6601. a =
  6602. this.getData();
  6603. switch (this.dataFormat) {
  6604. case k.net.URLLoaderDataFormat.BINARY:
  6605. this.data = k.utils.ByteArray.nmeOfBuffer(a);
  6606. break;
  6607. default:
  6608. this.data = K.string(a)
  6609. }
  6610. a = new k.events.Event("complete");
  6611. a.set_currentTarget(this);
  6612. this.dispatchEvent(a)
  6613. },
  6614. requestUrl: function (a, b, d, c) {
  6615. var e = new XMLHttpRequest;
  6616. this.registerEvents(e);
  6617. var f = "";
  6618. if (F.Boot.__instanceof(d, k.utils.ByteArray)) {
  6619. var l = d;
  6620. switch (this.dataFormat) {
  6621. case k.net.URLLoaderDataFormat.BINARY:
  6622. f = l.data.buffer;
  6623. break;
  6624. default:
  6625. f = l.readUTFBytes(l.length)
  6626. }
  6627. } else if (F.Boot.__instanceof(d,
  6628. k.net.URLVariables)) {
  6629. l = d;
  6630. d = 0;
  6631. for (var m = W.fields(l); d < m.length;) {
  6632. var h = m[d];
  6633. ++d;
  6634. 0 != f.length && (f += "&");
  6635. f += $.urlEncode(h) + "=" + $.urlEncode(W.field(l, h))
  6636. }
  6637. } else null != d && (f = d.toString());
  6638. try {
  6639. if ("GET" == b && null != f && "" != f) {
  6640. var p = 1 >= a.split("?").length;
  6641. e.open(b, a + (p ? "?" : "&") + K.string(f), !0);
  6642. f = ""
  6643. } else e.open(b, a, !0)
  6644. } catch (C) {
  6645. this.onError(C.toString());
  6646. return
  6647. }
  6648. switch (this.dataFormat) {
  6649. case k.net.URLLoaderDataFormat.BINARY:
  6650. e.responseType = "arraybuffer"
  6651. }
  6652. for (d = 0; d < c.length;) a = c[d], ++d, e.setRequestHeader(a.name, a.value);
  6653. e.send(f);
  6654. this.onOpen();
  6655. this.getData = function () {
  6656. return null != e.response ? e.response : e.responseText
  6657. }
  6658. },
  6659. registerEvents: function (a) {
  6660. var b = this;
  6661. "undefined" != typeof XMLHttpRequestProgressEvent && a.addEventListener("progress", A(this, this.onProgress), !1);
  6662. a.onreadystatechange = function () {
  6663. if (4 == a.readyState) {
  6664. var d;
  6665. try {
  6666. d = a.status
  6667. } catch (c) {
  6668. d = null
  6669. }
  6670. void 0 == d && (d = null);
  6671. if (null != d) b.onStatus(d);
  6672. if (null != d && 200 <= d && 400 > d) b.onData(a.response);
  6673. else if (null == d) b.onError("Failed to connect or resolve host");
  6674. else if (12029 ==
  6675. d) b.onError("Failed to connect to host");
  6676. else if (12007 == d) b.onError("Unknown host");
  6677. else if (0 == d) b.onError("Unable to make request (may be blocked due to cross-domain permissions)"), b.onSecurityError("Unable to make request (may be blocked due to cross-domain permissions)");
  6678. else b.onError("Http Error #" + a.status)
  6679. }
  6680. }
  6681. },
  6682. load: function (a) {
  6683. this.requestUrl(a.url, a.method, a.data, a.formatRequestHeaders())
  6684. },
  6685. getData: function () {
  6686. return null
  6687. },
  6688. close: function () {},
  6689. set_dataFormat: function (a) {
  6690. a != k.net.URLLoaderDataFormat.BINARY ||
  6691. W.hasField(F.Browser.window, "ArrayBuffer") ? this.dataFormat = a : this.dataFormat = k.net.URLLoaderDataFormat.TEXT;
  6692. return this.dataFormat
  6693. },
  6694. __class__: k.net.URLLoader
  6695. });
  6696. k.net.URLLoaderDataFormat = s["flash.net.URLLoaderDataFormat"] = {
  6697. __ename__: ["flash", "net", "URLLoaderDataFormat"],
  6698. __constructs__: ["BINARY", "TEXT", "VARIABLES"]
  6699. };
  6700. k.net.URLLoaderDataFormat.BINARY = ["BINARY", 0];
  6701. k.net.URLLoaderDataFormat.BINARY.toString = N;
  6702. k.net.URLLoaderDataFormat.BINARY.__enum__ = k.net.URLLoaderDataFormat;
  6703. k.net.URLLoaderDataFormat.TEXT = ["TEXT", 1];
  6704. k.net.URLLoaderDataFormat.TEXT.toString = N;
  6705. k.net.URLLoaderDataFormat.TEXT.__enum__ = k.net.URLLoaderDataFormat;
  6706. k.net.URLLoaderDataFormat.VARIABLES = ["VARIABLES", 2];
  6707. k.net.URLLoaderDataFormat.VARIABLES.toString = N;
  6708. k.net.URLLoaderDataFormat.VARIABLES.__enum__ = k.net.URLLoaderDataFormat;
  6709. k.net.URLRequest = function (a) {
  6710. null != a && (this.url = a);
  6711. this.requestHeaders = [];
  6712. this.method = "GET";
  6713. this.contentType = null
  6714. };
  6715. s["flash.net.URLRequest"] = k.net.URLRequest;
  6716. k.net.URLRequest.__name__ = ["flash", "net", "URLRequest"];
  6717. k.net.URLRequest.prototype = {
  6718. formatRequestHeaders: function () {
  6719. var a = this.requestHeaders;
  6720. null == a && (a = []);
  6721. if ("GET" == this.method || null == this.data) return a;
  6722. (F.Boot.__instanceof(this.data, String) || F.Boot.__instanceof(this.data, k.utils.ByteArray)) && (a = a.slice()).push(new k.net.URLRequestHeader("Content-Type", null != this.contentType ? this.contentType : "application/x-www-form-urlencoded"));
  6723. return a
  6724. },
  6725. __class__: k.net.URLRequest
  6726. };
  6727. k.net.URLRequestHeader = function (a, b) {
  6728. null == b && (b = "");
  6729. null == a && (a = "");
  6730. this.name = a;
  6731. this.value =
  6732. b
  6733. };
  6734. s["flash.net.URLRequestHeader"] = k.net.URLRequestHeader;
  6735. k.net.URLRequestHeader.__name__ = ["flash", "net", "URLRequestHeader"];
  6736. k.net.URLRequestHeader.prototype = {
  6737. __class__: k.net.URLRequestHeader
  6738. };
  6739. k.net.URLRequestMethod = function () {};
  6740. s["flash.net.URLRequestMethod"] = k.net.URLRequestMethod;
  6741. k.net.URLRequestMethod.__name__ = ["flash", "net", "URLRequestMethod"];
  6742. k.net.URLVariables = function (a) {
  6743. null != a && this.decode(a)
  6744. };
  6745. s["flash.net.URLVariables"] = k.net.URLVariables;
  6746. k.net.URLVariables.__name__ = ["flash", "net", "URLVariables"];
  6747. k.net.URLVariables.prototype = {
  6748. toString: function () {
  6749. for (var a = "", b = W.fields(this), d = 0, c = 0; c < b.length;) {
  6750. var e = b[c];
  6751. ++c;
  6752. a += (0 != d++ ? "&" : "") + $.urlEncode(e) + "=" + $.urlEncode(W.field(this, e))
  6753. }
  6754. return a
  6755. },
  6756. decode: function (a) {
  6757. for (var b = W.fields(this), d = 0; d < b.length;) {
  6758. var c = b[d];
  6759. ++d;
  6760. W.deleteField(this, c)
  6761. }
  6762. a = a.split(";").join("&").split("&");
  6763. for (d = 0; d < a.length;) c = a[d], ++d, b = c.indexOf("="), 0 < b ? this[$.urlDecode(S.substr(c, 0, b))] = $.urlDecode(S.substr(c, b + 1, null)) : 0 != b && (this[$.urlDecode(c)] = "")
  6764. },
  6765. __class__: k.net.URLVariables
  6766. };
  6767. k.text = {};
  6768. k.text.Font = function () {};
  6769. s["flash.text.Font"] = k.text.Font;
  6770. k.text.Font.__name__ = ["flash", "text", "Font"];
  6771. k.text.Font.enumerateFonts = function (a) {
  6772. return []
  6773. };
  6774. k.text.Font.registerFont = function (a) {};
  6775. k.text.Font.prototype = {
  6776. hasGlyphs: function (a) {
  6777. return !1
  6778. },
  6779. __class__: k.text.Font
  6780. };
  6781. k.text.FontStyle = s["flash.text.FontStyle"] = {
  6782. __ename__: ["flash", "text", "FontStyle"],
  6783. __constructs__: ["REGULAR", "ITALIC", "BOLD_ITALIC", "BOLD"]
  6784. };
  6785. k.text.FontStyle.REGULAR = ["REGULAR", 0];
  6786. k.text.FontStyle.REGULAR.toString = N;
  6787. k.text.FontStyle.REGULAR.__enum__ =
  6788. k.text.FontStyle;
  6789. k.text.FontStyle.ITALIC = ["ITALIC", 1];
  6790. k.text.FontStyle.ITALIC.toString = N;
  6791. k.text.FontStyle.ITALIC.__enum__ = k.text.FontStyle;
  6792. k.text.FontStyle.BOLD_ITALIC = ["BOLD_ITALIC", 2];
  6793. k.text.FontStyle.BOLD_ITALIC.toString = N;
  6794. k.text.FontStyle.BOLD_ITALIC.__enum__ = k.text.FontStyle;
  6795. k.text.FontStyle.BOLD = ["BOLD", 3];
  6796. k.text.FontStyle.BOLD.toString = N;
  6797. k.text.FontStyle.BOLD.__enum__ = k.text.FontStyle;
  6798. k.text.FontType = s["flash.text.FontType"] = {
  6799. __ename__: ["flash", "text", "FontType"],
  6800. __constructs__: ["EMBEDDED",
  6801. "DEVICE"
  6802. ]
  6803. };
  6804. k.text.FontType.EMBEDDED = ["EMBEDDED", 0];
  6805. k.text.FontType.EMBEDDED.toString = N;
  6806. k.text.FontType.EMBEDDED.__enum__ = k.text.FontType;
  6807. k.text.FontType.DEVICE = ["DEVICE", 1];
  6808. k.text.FontType.DEVICE.toString = N;
  6809. k.text.FontType.DEVICE.__enum__ = k.text.FontType;
  6810. k.utils = {};
  6811. k.utils.ByteArray = function () {
  6812. this.littleEndian = !1;
  6813. this.length = this.position = this.allocated = 0;
  6814. this._nmeResizeBuffer(this.allocated)
  6815. };
  6816. s["flash.utils.ByteArray"] = k.utils.ByteArray;
  6817. k.utils.ByteArray.__name__ = ["flash", "utils", "ByteArray"];
  6818. k.utils.ByteArray.fromBytes =
  6819. function (a) {
  6820. var b = new k.utils.ByteArray;
  6821. b.byteView = new Uint8Array(a.b);
  6822. b.set_length(b.byteView.length);
  6823. b.allocated = b.length;
  6824. return b
  6825. };
  6826. k.utils.ByteArray.nmeOfBuffer = function (a) {
  6827. var b = new k.utils.ByteArray;
  6828. b.set_length(b.allocated = a.byteLength);
  6829. b.data = new DataView(a);
  6830. b.byteView = new Uint8Array(a);
  6831. return b
  6832. };
  6833. k.utils.ByteArray.prototype = {
  6834. set_length: function (a) {
  6835. this.allocated < a ? this._nmeResizeBuffer(this.allocated = Math.max(a, 2 * this.allocated) | 0) : this.allocated > a && this._nmeResizeBuffer(this.allocated = a);
  6836. return this.length = a
  6837. },
  6838. set_endian: function (a) {
  6839. this.littleEndian = "littleEndian" == a;
  6840. return a
  6841. },
  6842. get_endian: function () {
  6843. return this.littleEndian ? "littleEndian" : "bigEndian"
  6844. },
  6845. get_bytesAvailable: function () {
  6846. return this.length - this.position
  6847. },
  6848. writeUTFBytes: function (a) {
  6849. for (var b = 0, d = a.length; b < d;) {
  6850. var c = b++,
  6851. c = a.charCodeAt(c);
  6852. 127 >= c ? this.writeByte(c) : (2047 >= c ? this.writeByte(192 | c >> 6) : (65535 >= c ? this.writeByte(224 | c >> 12) : (this.writeByte(240 | c >> 18), this.writeByte(128 | c >> 12 & 63)), this.writeByte(128 | c >> 6 & 63)), this.writeByte(128 |
  6853. c & 63))
  6854. }
  6855. },
  6856. writeUTF: function (a) {
  6857. this.writeUnsignedShort(this._getUTFBytesCount(a));
  6858. this.writeUTFBytes(a)
  6859. },
  6860. writeUnsignedShort: function (a) {
  6861. var b = this.position + 2;
  6862. this.length < b && this.set_length(b);
  6863. this.data.setUint16(this.position, a, this.littleEndian);
  6864. this.position += 2
  6865. },
  6866. writeUnsignedInt: function (a) {
  6867. var b = this.position + 4;
  6868. this.length < b && this.set_length(b);
  6869. this.data.setUint32(this.position, a, this.littleEndian);
  6870. this.position += 4
  6871. },
  6872. writeShort: function (a) {
  6873. var b = this.position + 2;
  6874. this.length < b && this.set_length(b);
  6875. this.data.setInt16(this.position, a, this.littleEndian);
  6876. this.position += 2
  6877. },
  6878. writeInt: function (a) {
  6879. var b = this.position + 4;
  6880. this.length < b && this.set_length(b);
  6881. this.data.setInt32(this.position, a, this.littleEndian);
  6882. this.position += 4
  6883. },
  6884. writeFloat: function (a) {
  6885. var b = this.position + 4;
  6886. this.length < b && this.set_length(b);
  6887. this.data.setFloat32(this.position, a, this.littleEndian);
  6888. this.position += 4
  6889. },
  6890. writeDouble: function (a) {
  6891. var b = this.position + 8;
  6892. this.length < b && this.set_length(b);
  6893. this.data.setFloat64(this.position, a, this.littleEndian);
  6894. this.position += 8
  6895. },
  6896. writeBytes: function (a, b, d) {
  6897. if (0 > b || 0 > d) throw new k.errors.IOError("Write error - Out of bounds");
  6898. var c = this.position + d;
  6899. this.length < c && this.set_length(c);
  6900. this.byteView.set(a.byteView.subarray(b, b + d), this.position);
  6901. this.position += d
  6902. },
  6903. writeByte: function (a) {
  6904. var b = this.position + 1;
  6905. this.length < b && this.set_length(b);
  6906. this.data.setInt8(this.position, a);
  6907. this.position += 1
  6908. },
  6909. writeBoolean: function (a) {
  6910. this.writeByte(a ? 1 : 0)
  6911. },
  6912. toString: function () {
  6913. var a = this.position,
  6914. b;
  6915. this.position = 0;
  6916. b = this.readUTFBytes(this.length);
  6917. this.position = a;
  6918. return b
  6919. },
  6920. readUTFBytes: function (a) {
  6921. var b = "";
  6922. for (a = this.position + a; this.position < a;) {
  6923. var d = this.data.getUint8(this.position++);
  6924. if (128 > d) {
  6925. if (0 == d) break;
  6926. b += String.fromCharCode(d)
  6927. } else if (224 > d) b += String.fromCharCode((d & 63) << 6 | this.data.getUint8(this.position++) & 127);
  6928. else if (240 > d) var c = this.data.getUint8(this.position++),
  6929. b = b + String.fromCharCode((d & 31) << 12 | (c & 127) << 6 | this.data.getUint8(this.position++) & 127);
  6930. else var c = this.data.getUint8(this.position++),
  6931. e = this.data.getUint8(this.position++),
  6932. b = b + String.fromCharCode((d & 15) << 18 | (c & 127) << 12 | e << 6 & 127 | this.data.getUint8(this.position++) & 127)
  6933. }
  6934. return b
  6935. },
  6936. readUTF: function () {
  6937. return this.readUTFBytes(this.readUnsignedShort())
  6938. },
  6939. readUnsignedShort: function () {
  6940. var a = this.data.getUint16(this.position, this.littleEndian);
  6941. this.position += 2;
  6942. return a
  6943. },
  6944. readUnsignedInt: function () {
  6945. var a = this.data.getUint32(this.position, this.littleEndian);
  6946. this.position += 4;
  6947. return a
  6948. },
  6949. readUnsignedByte: function () {
  6950. return this.data.getUint8(this.position++)
  6951. },
  6952. readShort: function () {
  6953. var a =
  6954. this.data.getInt16(this.position, this.littleEndian);
  6955. this.position += 2;
  6956. return a
  6957. },
  6958. readInt: function () {
  6959. var a = this.data.getInt32(this.position, this.littleEndian);
  6960. this.position += 4;
  6961. return a
  6962. },
  6963. readFullBytes: function (a, b, d) {
  6964. this.length < d && this.set_length(d);
  6965. var c = b;
  6966. for (b += d; c < b;) d = c++, this.data.setInt8(this.position++, a.b[d])
  6967. },
  6968. readFloat: function () {
  6969. var a = this.data.getFloat32(this.position, this.littleEndian);
  6970. this.position += 4;
  6971. return a
  6972. },
  6973. readDouble: function () {
  6974. var a = this.data.getFloat64(this.position, this.littleEndian);
  6975. this.position += 8;
  6976. return a
  6977. },
  6978. readBytes: function (a, b, d) {
  6979. null == b && (b = 0);
  6980. null == d && (d = this.length);
  6981. if (0 > b || 0 > d) throw new k.errors.IOError("Read error - Out of bounds");
  6982. var c = b + d;
  6983. a.length < c && a.set_length(c);
  6984. a.byteView.set(this.byteView.subarray(this.position, this.position + d), b);
  6985. a.position = b;
  6986. this.position += d;
  6987. a.position + d > a.length && a.set_length(a.position + d)
  6988. },
  6989. readByte: function () {
  6990. return this.data.getUint8(this.position++)
  6991. },
  6992. readBoolean: function () {
  6993. return 0 != this.data.getUint8(this.position++)
  6994. },
  6995. nmeSet: function (a,
  6996. b) {
  6997. this.data.setUint8(a, b)
  6998. },
  6999. nmeGetBuffer: function () {
  7000. return this.data.buffer
  7001. },
  7002. nmeGet: function (a) {
  7003. return this.data.getUint8(a)
  7004. },
  7005. nmeFromBytes: function (a) {
  7006. this.byteView = new Uint8Array(a.b);
  7007. this.set_length(this.byteView.length);
  7008. this.allocated = this.length
  7009. },
  7010. clear: function () {
  7011. this.set_length(0)
  7012. },
  7013. _nmeResizeBuffer: function (a) {
  7014. var b = this.byteView,
  7015. d = new Uint8Array(a);
  7016. null != b && (b.length <= a ? d.set(b) : d.set(b.subarray(0, a)));
  7017. this.byteView = d;
  7018. this.data = new DataView(d.buffer)
  7019. },
  7020. _getUTFBytesCount: function (a) {
  7021. for (var b =
  7022. 0, d = 0, c = a.length; d < c;) var e = d++,
  7023. e = a.charCodeAt(e),
  7024. b = 127 >= e ? b + 1 : 2047 >= e ? b + 2 : 65535 >= e ? b + 3 : b + 4;
  7025. return b
  7026. },
  7027. __set: function (a, b) {
  7028. this.data.setUint8(a, b)
  7029. },
  7030. __get: function (a) {
  7031. return this.data.getUint8(a)
  7032. },
  7033. __class__: k.utils.ByteArray
  7034. };
  7035. k.utils.Dictionary = function (a) {};
  7036. s["flash.utils.Dictionary"] = k.utils.Dictionary;
  7037. k.utils.Dictionary.__name__ = ["flash", "utils", "Dictionary"];
  7038. k.utils.Dictionary.prototype = {
  7039. __class__: k.utils.Dictionary
  7040. };
  7041. k.utils.Endian = function () {};
  7042. s["flash.utils.Endian"] = k.utils.Endian;
  7043. k.utils.Endian.__name__ = ["flash", "utils", "Endian"];
  7044. var ea;
  7045. ea = function () {};
  7046. s["gameplay.OzObject"] = ea;
  7047. ea.__name__ = ["gameplay", "OzObject"];
  7048. ea.GetGFXXML = function (a) {
  7049. if (null != q.Xu.fc(q.Xu.fc(a, "joint"), "graphics")) a = q.Xu.fc(q.Xu.fc(a, "joint"), "graphics");
  7050. else if (null != q.Xu.fc(q.Xu.fc(a, "body"), "graphics")) a = q.Xu.fc(q.Xu.fc(a, "body"), "graphics");
  7051. else throw new k.errors.Error("can't find graphics at initGFX");
  7052. return a
  7053. };
  7054. ea.GetBitmapData = function (a) {
  7055. a = q.OzUtil.FindStringId(q.OzSprite.BitmapsNames, a.get("src"));
  7056. a = q.OzSprite.Bitmaps[a];
  7057. return q.OzSprite.TilesheetBitmapDatas[a.tilesheetId][a.frames[0]]
  7058. };
  7059. ea.GetBitmap = function (a) {
  7060. a = q.OzUtil.FindStringId(q.OzSprite.BitmapsNames, a.get("src"));
  7061. return new q.OzSprite(q.OzSprite.Bitmaps[a])
  7062. };
  7063. ea.prototype = {
  7064. drawEditor: function (a, b, d) {
  7065. this.sprite.rotation = this.geometry.degrees;
  7066. this.sprite.x = this.geometry.x;
  7067. this.sprite.y = this.geometry.y
  7068. },
  7069. setProperty: function (a, b) {
  7070. "x" == a ? this.geometry.x = K.parseFloat(b) : "y" == a ? this.geometry.y = K.parseFloat(b) : "degrees" == a ? this.geometry.degrees = K.parseFloat(b) :
  7071. (null == q.Xu.fc(this.attributes, "properties") && this.attributes.addChild(O.createElement("properties")), q.Xu.fc(this.attributes, "properties").set(a, b))
  7072. },
  7073. isRotatable: function () {
  7074. return !0
  7075. },
  7076. initGFX: function () {
  7077. var a = ea.GetGFXXML(this.bluePrint);
  7078. if ("sprite" == a.get("type")) this.sprite = ea.GetBitmap(a);
  7079. else if ("fill" == a.get("type")) a = ea.GetBitmapData(a), null == this.sprite && (this.sprite = new q.OzSprite(null, q.SpriteType.POLYGON)), this.sprite.flSprite.get_graphics().clear(), this.sprite.flSprite.get_graphics().beginBitmapFill(a,
  7080. null, !0, !0), this.geometry.drawLocalOutline(this.sprite.flSprite.get_graphics()), this.sprite.flSprite.get_graphics().endFill();
  7081. else if ("line" != a.get("type")) throw new k.errors.Error("Todo: if not sprite");
  7082. },
  7083. fromXML: function (a, b, d, c, e) {
  7084. null == e && (e = -10000001);
  7085. null == c && (c = -10000001); - 1E6 > c && (c = Math.NaN); - 1E6 > e && (e = Math.NaN);
  7086. var f = O.parse(a.toString()).firstElement(),
  7087. l = new q.OzGeometry;
  7088. if (null != q.Xu.fc(q.Xu.fc(b, "body"), "geometry")) l.fromXML(q.Xu.fc(q.Xu.fc(b, "body"), "geometry"));
  7089. else if (null != q.Xu.fc(q.Xu.fc(b,
  7090. "joint"), "geometry")) l.fromXML(q.Xu.fc(q.Xu.fc(b, "joint"), "geometry"));
  7091. else if (null != q.Xu.fc(a, "geometry")) l.fromXML(q.Xu.fc(a, "geometry")), f.removeChild(q.Xu.fc(f, "geometry"));
  7092. else throw new k.errors.Error("ERROR CAN'T FIND GEOMETRY FROM Xml");
  7093. l.x += K.parseFloat(a.get("x"));
  7094. l.y += K.parseFloat(a.get("y"));
  7095. l.degrees += K.parseFloat(a.get("rot"));
  7096. Math.isNaN(c) || Math.isNaN(e) || (l.x += c, l.y += e);
  7097. this.attributes = f;
  7098. this.bluePrint = b;
  7099. this.geometry = l;
  7100. if (null != q.Xu.fc(this.bluePrint, "property"))
  7101. for (null == q.Xu.fc(this.attributes,
  7102. "properties") && this.attributes.addChild(O.createElement("properties")), a = this.bluePrint.elementsNamed("property"); a.hasNext();) b = a.next().get("name"), null == q.Xu.fc(this.attributes, "properties").get(b) && (c = q.Xu.fc(d, "properties"), c = q.Xu.cwav(c, "property", "name", b).get("default"), q.Xu.fc(this.attributes, "properties").set(b, c));
  7103. this.initGFX();
  7104. this.gameSpecInit()
  7105. },
  7106. toXML: function () {
  7107. var a = O.parse(this.attributes.toString()).firstElement();
  7108. a.set("x", "" + this.geometry.x);
  7109. a.set("y", "" + this.geometry.y);
  7110. a.set("rot",
  7111. "" + this.geometry.degrees);
  7112. if ("dot" != this.bluePrint.get("editor") && "none" != this.bluePrint.get("editor")) {
  7113. var b = this.geometry.toXML();
  7114. b.set("x", "0");
  7115. b.set("y", "0");
  7116. b.set("degrees", "0");
  7117. a.addChild(b)
  7118. }
  7119. return a
  7120. },
  7121. initPhysics: function (a) {
  7122. if (null != q.Xu.fc(this.bluePrint, "body")) {
  7123. var b = h.phys.Body,
  7124. d;
  7125. "static" == q.Xu.fc(this.bluePrint, "body").get("type") ? (null == c.util.ZPP_Flags.BodyType_STATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_STATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1), d =
  7126. c.util.ZPP_Flags.BodyType_STATIC) : (null == c.util.ZPP_Flags.BodyType_DYNAMIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_DYNAMIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1), d = c.util.ZPP_Flags.BodyType_DYNAMIC);
  7127. this.body = new b(d);
  7128. this.geometry.makePhysics(this.body);
  7129. b = K.parseFloat(this.attributes.get("rot"));
  7130. y.Log.trace("rot", {
  7131. fileName: "OzObject.hx",
  7132. lineNumber: 54,
  7133. className: "gameplay.OzObject",
  7134. methodName: "initPhysics",
  7135. customParams: [this.attributes.get("rot"), this.geometry.degrees]
  7136. });
  7137. 1E-4 < this.body.get_localCOM().get_x() || -1E-4 > this.body.get_localCOM().get_x() || 1E-4 < this.body.get_localCOM().get_y() || -0.001 > this.body.get_localCOM().get_y() ? (this.shiftCOM = !0, this.comOffset = this.body.get_localCOM().copy(null), d = new q.OzSprite(null, q.SpriteType.EMPTY), null != this.sprite.parent && this.sprite.parent.addChild(d), d.addChild(this.sprite), d.x = this.sprite.x, d.y = this.sprite.y, d.rotation = this.sprite.rotation, this.sprite.x = -this.body.get_localCOM().get_x(), this.sprite.y = -this.body.get_localCOM().get_y(),
  7138. this.sprite.rotation = 0, d.addChild(this.sprite), this.sprite = d, this.body.align(), d = [], q.OzUtil.rotateAroundPoint(this.comOffset.get_x(), this.comOffset.get_y(), b, 0, 0, d), this.body.get_position().setxy(this.geometry.x + d[0], this.geometry.y + d[1])) : this.body.get_position().setxy(this.geometry.x, this.geometry.y);
  7139. this.body.set_rotation(this.geometry.degrees * Math.PI / 180);
  7140. this.body.set_space(a);
  7141. this.body.get_userData().object = this
  7142. }
  7143. },
  7144. gameSpecInit: function () {
  7145. null != q.Xu.fc(this.attributes, "properties") && null != q.Xu.fc(this.attributes,
  7146. "properties").get("position") && (this.position = K.parseInt(q.Xu.fc(this.attributes, "properties").get("position")));
  7147. this.isHooda == ("hooda" == this.attributes.get("type"))
  7148. },
  7149. __class__: ea
  7150. };
  7151. var y = {};
  7152. y.StackItem = s["haxe.StackItem"] = {
  7153. __ename__: ["haxe", "StackItem"],
  7154. __constructs__: ["CFunction", "Module", "FilePos", "Method", "Lambda"]
  7155. };
  7156. y.StackItem.CFunction = ["CFunction", 0];
  7157. y.StackItem.CFunction.toString = N;
  7158. y.StackItem.CFunction.__enum__ = y.StackItem;
  7159. y.StackItem.Module = function (a) {
  7160. a = ["Module", 1, a];
  7161. a.__enum__ = y.StackItem;
  7162. a.toString = N;
  7163. return a
  7164. };
  7165. y.StackItem.FilePos = function (a, b, d) {
  7166. a = ["FilePos", 2, a, b, d];
  7167. a.__enum__ = y.StackItem;
  7168. a.toString = N;
  7169. return a
  7170. };
  7171. y.StackItem.Method = function (a, b) {
  7172. var d = ["Method", 3, a, b];
  7173. d.__enum__ = y.StackItem;
  7174. d.toString = N;
  7175. return d
  7176. };
  7177. y.StackItem.Lambda = function (a) {
  7178. a = ["Lambda", 4, a];
  7179. a.__enum__ = y.StackItem;
  7180. a.toString = N;
  7181. return a
  7182. };
  7183. y.CallStack = function () {};
  7184. s["haxe.CallStack"] = y.CallStack;
  7185. y.CallStack.__name__ = ["haxe", "CallStack"];
  7186. y.CallStack.exceptionStack = function () {
  7187. return []
  7188. };
  7189. y.CallStack.toString = function (a) {
  7190. for (var b =
  7191. new fa, d = 0; d < a.length;) {
  7192. var c = a[d];
  7193. ++d;
  7194. b.b += "\nCalled from ";
  7195. y.CallStack.itemToString(b, c)
  7196. }
  7197. return b.b
  7198. };
  7199. y.CallStack.itemToString = function (a, b) {
  7200. switch (b[1]) {
  7201. case 0:
  7202. a.b += "a C function";
  7203. break;
  7204. case 1:
  7205. var d = b[2];
  7206. a.b += "module ";
  7207. a.b += K.string(d);
  7208. break;
  7209. case 2:
  7210. var d = b[4],
  7211. c = b[3],
  7212. e = b[2];
  7213. null != e && (y.CallStack.itemToString(a, e), a.b += " (");
  7214. a.b += K.string(c);
  7215. a.b += " line ";
  7216. a.b += K.string(d);
  7217. null != e && (a.b += ")");
  7218. break;
  7219. case 3:
  7220. d = b[3];
  7221. a.b += K.string(b[2]);
  7222. a.b += ".";
  7223. a.b += K.string(d);
  7224. break;
  7225. case 4:
  7226. d = b[2], a.b += "local function #",
  7227. a.b += K.string(d)
  7228. }
  7229. };
  7230. y.Log = function () {};
  7231. s["haxe.Log"] = y.Log;
  7232. y.Log.__name__ = ["haxe", "Log"];
  7233. y.Log.trace = function (a, b) {
  7234. F.Boot.__trace(a, b)
  7235. };
  7236. y.Resource = function () {};
  7237. s["haxe.Resource"] = y.Resource;
  7238. y.Resource.__name__ = ["haxe", "Resource"];
  7239. y.Resource.listNames = function () {
  7240. for (var a = [], b = 0, d = y.Resource.content; b < d.length;) {
  7241. var c = d[b];
  7242. ++b;
  7243. a.push(c.name)
  7244. }
  7245. return a
  7246. };
  7247. y.Resource.getString = function (a) {
  7248. for (var b = 0, d = y.Resource.content; b < d.length;) {
  7249. var c = d[b];
  7250. ++b;
  7251. if (c.name == a) return null != c.str ? c.str : y.Unserializer.run(c.data).toString()
  7252. }
  7253. return null
  7254. };
  7255. y.Serializer = function () {
  7256. this.buf = new fa;
  7257. this.cache = [];
  7258. this.useCache = y.Serializer.USE_CACHE;
  7259. this.useEnumIndex = y.Serializer.USE_ENUM_INDEX;
  7260. this.shash = new y.ds.StringMap;
  7261. this.scount = 0
  7262. };
  7263. s["haxe.Serializer"] = y.Serializer;
  7264. y.Serializer.__name__ = ["haxe", "Serializer"];
  7265. y.Serializer.run = function (a) {
  7266. var b = new y.Serializer;
  7267. b.serialize(a);
  7268. return b.toString()
  7269. };
  7270. y.Serializer.prototype = {
  7271. serialize: function (a) {
  7272. var b = Y["typeof"](a);
  7273. switch (b[1]) {
  7274. case 0:
  7275. this.buf.b += "n";
  7276. break;
  7277. case 1:
  7278. if (0 == a) {
  7279. this.buf.b += "z";
  7280. break
  7281. }
  7282. this.buf.b +=
  7283. "i";
  7284. this.buf.b += K.string(a);
  7285. break;
  7286. case 2:
  7287. Math.isNaN(a) ? this.buf.b += "k" : Math.isFinite(a) ? (this.buf.b += "d", this.buf.b += K.string(a)) : this.buf.b += K.string(0 > a ? "m" : "p");
  7288. break;
  7289. case 3:
  7290. this.buf.b += K.string(a ? "t" : "f");
  7291. break;
  7292. case 6:
  7293. b = b[2];
  7294. if (b == String) {
  7295. this.serializeString(a);
  7296. break
  7297. }
  7298. if (this.useCache && this.serializeRef(a)) break;
  7299. switch (b) {
  7300. case Array:
  7301. var d = 0;
  7302. this.buf.b += "a";
  7303. for (var c = a.length, e = 0; e < c;) b = e++, null == a[b] ? d++ : (0 < d && (1 == d ? this.buf.b += "n" : (this.buf.b += "u", this.buf.b += K.string(d)), d = 0), this.serialize(a[b]));
  7304. 0 < d && (1 == d ? this.buf.b += "n" : (this.buf.b += "u", this.buf.b += K.string(d)));
  7305. this.buf.b += "h";
  7306. break;
  7307. case la:
  7308. this.buf.b += "l";
  7309. for (a = a.iterator(); a.hasNext();) b = a.next(), this.serialize(b);
  7310. this.buf.b += "h";
  7311. break;
  7312. case Date:
  7313. this.buf.b += "v";
  7314. this.buf.b += K.string(S.dateStr(a));
  7315. break;
  7316. case y.ds.StringMap:
  7317. this.buf.b += "b";
  7318. for (d = a.keys(); d.hasNext();) b = d.next(), this.serializeString(b), this.serialize(a.get(b));
  7319. this.buf.b += "h";
  7320. break;
  7321. case y.ds.IntMap:
  7322. this.buf.b += "q";
  7323. for (d = a.keys(); d.hasNext();) b = d.next(), this.buf.b += ":", this.buf.b +=
  7324. K.string(b), this.serialize(a.get(b));
  7325. this.buf.b += "h";
  7326. break;
  7327. case y.ds.ObjectMap:
  7328. this.buf.b += "M";
  7329. for (d = a.keys(); d.hasNext();) b = d.next(), c = W.field(b, "__id__"), W.deleteField(b, "__id__"), this.serialize(b), b.__id__ = c, this.serialize(a.h[b.__id__]);
  7330. this.buf.b += "h";
  7331. break;
  7332. case y.io.Bytes:
  7333. b = 0;
  7334. d = a.length - 2;
  7335. c = new fa;
  7336. for (e = y.Serializer.BASE64; b < d;) {
  7337. var f = a.b[b++],
  7338. l = a.b[b++],
  7339. m = a.b[b++];
  7340. c.b += K.string(e.charAt(f >> 2));
  7341. c.b += K.string(e.charAt((f << 4 | l >> 4) & 63));
  7342. c.b += K.string(e.charAt((l << 2 | m >> 6) & 63));
  7343. c.b += K.string(e.charAt(m &
  7344. 63))
  7345. }
  7346. b == d ? (f = a.b[b++], l = a.b[b++], c.b += K.string(e.charAt(f >> 2)), c.b += K.string(e.charAt((f << 4 | l >> 4) & 63)), c.b += K.string(e.charAt(l << 2 & 63))) : b == d + 1 && (f = a.b[b++], c.b += K.string(e.charAt(f >> 2)), c.b += K.string(e.charAt(f << 4 & 63)));
  7347. b = c.b;
  7348. this.buf.b += "s";
  7349. this.buf.b += K.string(b.length);
  7350. this.buf.b += ":";
  7351. this.buf.b += K.string(b);
  7352. break;
  7353. default:
  7354. this.cache.pop(), null != a.hxSerialize ? (this.buf.b += "C", this.serializeString(Y.getClassName(b)), this.cache.push(a), a.hxSerialize(this), this.buf.b += "g") : (this.buf.b += "c", this.serializeString(Y.getClassName(b)),
  7355. this.cache.push(a), this.serializeFields(a))
  7356. }
  7357. break;
  7358. case 4:
  7359. if (this.useCache && this.serializeRef(a)) break;
  7360. this.buf.b += "o";
  7361. this.serializeFields(a);
  7362. break;
  7363. case 7:
  7364. b = b[2];
  7365. if (this.useCache && this.serializeRef(a)) break;
  7366. this.cache.pop();
  7367. this.buf.b += K.string(this.useEnumIndex ? "j" : "w");
  7368. this.serializeString(Y.getEnumName(b));
  7369. this.useEnumIndex ? (this.buf.b += ":", this.buf.b += K.string(a[1])) : this.serializeString(a[0]);
  7370. this.buf.b += ":";
  7371. c = a.length;
  7372. this.buf.b += K.string(c - 2);
  7373. for (e = 2; e < c;) b = e++, this.serialize(a[b]);
  7374. this.cache.push(a);
  7375. break;
  7376. case 5:
  7377. throw "Cannot serialize function";
  7378. default:
  7379. throw "Cannot serialize " + K.string(a);
  7380. }
  7381. },
  7382. serializeFields: function (a) {
  7383. for (var b = 0, d = W.fields(a); b < d.length;) {
  7384. var c = d[b];
  7385. ++b;
  7386. this.serializeString(c);
  7387. this.serialize(W.field(a, c))
  7388. }
  7389. this.buf.b += "g"
  7390. },
  7391. serializeRef: function (a) {
  7392. for (var b = typeof a, d = 0, c = this.cache.length; d < c;) {
  7393. var e = d++,
  7394. f = this.cache[e];
  7395. if (typeof f == b && f == a) return this.buf.b += "r", this.buf.b += K.string(e), !0
  7396. }
  7397. this.cache.push(a);
  7398. return !1
  7399. },
  7400. serializeString: function (a) {
  7401. var b = this.shash.get(a);
  7402. null !=
  7403. b ? (this.buf.b += "R", this.buf.b += K.string(b)) : (this.shash.set(a, this.scount++), this.buf.b += "y", a = $.urlEncode(a), this.buf.b += K.string(a.length), this.buf.b += ":", this.buf.b += K.string(a))
  7404. },
  7405. toString: function () {
  7406. return this.buf.b
  7407. },
  7408. __class__: y.Serializer
  7409. };
  7410. y.Timer = function (a) {
  7411. var b = this;
  7412. this.id = setInterval(function () {
  7413. b.run()
  7414. }, a)
  7415. };
  7416. s["haxe.Timer"] = y.Timer;
  7417. y.Timer.__name__ = ["haxe", "Timer"];
  7418. y.Timer.prototype = {
  7419. run: function () {
  7420. y.Log.trace("run", {
  7421. fileName: "Timer.hx",
  7422. lineNumber: 98,
  7423. className: "haxe.Timer",
  7424. methodName: "run"
  7425. })
  7426. },
  7427. __class__: y.Timer
  7428. };
  7429. y.Unserializer = function (a) {
  7430. this.buf = a;
  7431. this.length = a.length;
  7432. this.pos = 0;
  7433. this.scache = [];
  7434. this.cache = [];
  7435. a = y.Unserializer.DEFAULT_RESOLVER;
  7436. null == a && (a = Y, y.Unserializer.DEFAULT_RESOLVER = a);
  7437. this.setResolver(a)
  7438. };
  7439. s["haxe.Unserializer"] = y.Unserializer;
  7440. y.Unserializer.__name__ = ["haxe", "Unserializer"];
  7441. y.Unserializer.initCodes = function () {
  7442. for (var a = [], b = 0, d = y.Unserializer.BASE64.length; b < d;) {
  7443. var c = b++;
  7444. a[y.Unserializer.BASE64.charCodeAt(c)] = c
  7445. }
  7446. return a
  7447. };
  7448. y.Unserializer.run = function (a) {
  7449. return (new y.Unserializer(a)).unserialize()
  7450. };
  7451. y.Unserializer.prototype = {
  7452. unserialize: function () {
  7453. switch (this.buf.charCodeAt(this.pos++)) {
  7454. case 110:
  7455. return null;
  7456. case 116:
  7457. return !0;
  7458. case 102:
  7459. return !1;
  7460. case 122:
  7461. return 0;
  7462. case 105:
  7463. return this.readDigits();
  7464. case 100:
  7465. for (var a = this.pos;;) {
  7466. var b = this.buf.charCodeAt(this.pos);
  7467. if (43 <= b && 58 > b || 101 == b || 69 == b) this.pos++;
  7468. else break
  7469. }
  7470. return K.parseFloat(S.substr(this.buf, a, this.pos - a));
  7471. case 121:
  7472. b = this.readDigits();
  7473. if (58 != this.buf.charCodeAt(this.pos++) || this.length - this.pos < b) throw "Invalid string length";
  7474. a = S.substr(this.buf,
  7475. this.pos, b);
  7476. this.pos += b;
  7477. a = $.urlDecode(a);
  7478. this.scache.push(a);
  7479. return a;
  7480. case 107:
  7481. return Math.NaN;
  7482. case 109:
  7483. return Math.NEGATIVE_INFINITY;
  7484. case 112:
  7485. return Math.POSITIVE_INFINITY;
  7486. case 97:
  7487. var d = this.buf,
  7488. a = [];
  7489. for (this.cache.push(a);;) {
  7490. b = this.buf.charCodeAt(this.pos);
  7491. if (104 == b) {
  7492. this.pos++;
  7493. break
  7494. }
  7495. 117 == b ? (this.pos++, b = this.readDigits(), a[a.length + b - 1] = null) : a.push(this.unserialize())
  7496. }
  7497. return a;
  7498. case 111:
  7499. return b = {}, this.cache.push(b), this.unserializeObject(b), b;
  7500. case 114:
  7501. b = this.readDigits();
  7502. if (0 > b || b >= this.cache.length) throw "Invalid reference";
  7503. return this.cache[b];
  7504. case 82:
  7505. b = this.readDigits();
  7506. if (0 > b || b >= this.scache.length) throw "Invalid string reference";
  7507. return this.scache[b];
  7508. case 120:
  7509. throw this.unserialize();
  7510. case 99:
  7511. b = this.unserialize();
  7512. a = this.resolver.resolveClass(b);
  7513. if (null == a) throw "Class not found " + b;
  7514. b = Y.createEmptyInstance(a);
  7515. this.cache.push(b);
  7516. this.unserializeObject(b);
  7517. return b;
  7518. case 119:
  7519. b = this.unserialize();
  7520. a = this.resolver.resolveEnum(b);
  7521. if (null == a) throw "Enum not found " + b;
  7522. b = this.unserializeEnum(a, this.unserialize());
  7523. this.cache.push(b);
  7524. return b;
  7525. case 106:
  7526. b = this.unserialize();
  7527. a = this.resolver.resolveEnum(b);
  7528. if (null == a) throw "Enum not found " + b;
  7529. this.pos++;
  7530. var d = this.readDigits(),
  7531. c = Y.getEnumConstructs(a)[d];
  7532. if (null == c) throw "Unknown enum index " + b + "@" + d;
  7533. b = this.unserializeEnum(a, c);
  7534. this.cache.push(b);
  7535. return b;
  7536. case 108:
  7537. b = new la;
  7538. for (this.cache.push(b); 104 != this.buf.charCodeAt(this.pos);) b.add(this.unserialize());
  7539. this.pos++;
  7540. return b;
  7541. case 98:
  7542. d = new y.ds.StringMap;
  7543. for (this.cache.push(d); 104 != this.buf.charCodeAt(this.pos);) a = this.unserialize(),
  7544. d.set(a, this.unserialize());
  7545. this.pos++;
  7546. return d;
  7547. case 113:
  7548. d = new y.ds.IntMap;
  7549. this.cache.push(d);
  7550. for (b = this.buf.charCodeAt(this.pos++); 58 == b;) a = this.readDigits(), d.set(a, this.unserialize()), b = this.buf.charCodeAt(this.pos++);
  7551. if (104 != b) throw "Invalid IntMap format";
  7552. return d;
  7553. case 77:
  7554. d = new y.ds.ObjectMap;
  7555. for (this.cache.push(d); 104 != this.buf.charCodeAt(this.pos);) a = this.unserialize(), d.set(a, this.unserialize());
  7556. this.pos++;
  7557. return d;
  7558. case 118:
  7559. return b = S.strDate(S.substr(this.buf, this.pos, 19)), this.cache.push(b),
  7560. this.pos += 19, b;
  7561. case 115:
  7562. b = this.readDigits();
  7563. d = this.buf;
  7564. if (58 != this.buf.charCodeAt(this.pos++) || this.length - this.pos < b) throw "Invalid bytes length";
  7565. c = y.Unserializer.CODES;
  7566. null == c && (c = y.Unserializer.initCodes(), y.Unserializer.CODES = c);
  7567. for (var a = this.pos, e = b & 3, f = a + (b - e), l = y.io.Bytes.alloc(3 * (b >> 2) + (2 <= e ? e - 1 : 0)), m = 0; a < f;) {
  7568. var h = c[d.charCodeAt(a++)],
  7569. p = c[d.charCodeAt(a++)];
  7570. l.b[m++] = (h << 2 | p >> 4) & 255;
  7571. h = c[d.charCodeAt(a++)];
  7572. l.b[m++] = (p << 4 | h >> 2) & 255;
  7573. p = c[d.charCodeAt(a++)];
  7574. l.b[m++] = (h << 6 | p) & 255
  7575. }
  7576. 2 <= e && (h = c[d.charCodeAt(a++)],
  7577. p = c[d.charCodeAt(a++)], l.b[m++] = (h << 2 | p >> 4) & 255, 3 == e && (h = c[d.charCodeAt(a++)], l.b[m++] = (p << 4 | h >> 2) & 255));
  7578. this.pos += b;
  7579. this.cache.push(l);
  7580. return l;
  7581. case 67:
  7582. b = this.unserialize();
  7583. a = this.resolver.resolveClass(b);
  7584. if (null == a) throw "Class not found " + b;
  7585. b = Y.createEmptyInstance(a);
  7586. this.cache.push(b);
  7587. b.hxUnserialize(this);
  7588. if (103 != this.buf.charCodeAt(this.pos++)) throw "Invalid custom data";
  7589. return b
  7590. }
  7591. this.pos--;
  7592. throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos;
  7593. },
  7594. unserializeEnum: function (a, b) {
  7595. if (58 !=
  7596. this.buf.charCodeAt(this.pos++)) throw "Invalid enum format";
  7597. var d = this.readDigits();
  7598. if (0 == d) return Y.createEnum(a, b);
  7599. for (var c = []; 0 < d--;) c.push(this.unserialize());
  7600. return Y.createEnum(a, b, c)
  7601. },
  7602. unserializeObject: function (a) {
  7603. for (;;) {
  7604. if (this.pos >= this.length) throw "Invalid object";
  7605. if (103 == this.buf.charCodeAt(this.pos)) break;
  7606. var b = this.unserialize();
  7607. if (!F.Boot.__instanceof(b, String)) throw "Invalid object key";
  7608. var d = this.unserialize();
  7609. a[b] = d
  7610. }
  7611. this.pos++
  7612. },
  7613. readDigits: function () {
  7614. for (var a = 0, b = !1, d = this.pos;;) {
  7615. var c =
  7616. this.buf.charCodeAt(this.pos);
  7617. if (c != c) break;
  7618. if (45 == c) {
  7619. if (this.pos != d) break;
  7620. b = !0
  7621. } else {
  7622. if (48 > c || 57 < c) break;
  7623. a = 10 * a + (c - 48)
  7624. }
  7625. this.pos++
  7626. }
  7627. b && (a *= -1);
  7628. return a
  7629. },
  7630. setResolver: function (a) {
  7631. this.resolver = null == a ? {
  7632. resolveClass: function (a) {
  7633. return null
  7634. },
  7635. resolveEnum: function (a) {
  7636. return null
  7637. }
  7638. } : a
  7639. },
  7640. __class__: y.Unserializer
  7641. };
  7642. y.ds = {};
  7643. y.ds.IntMap = function () {
  7644. this.h = {}
  7645. };
  7646. s["haxe.ds.IntMap"] = y.ds.IntMap;
  7647. y.ds.IntMap.__name__ = ["haxe", "ds", "IntMap"];
  7648. y.ds.IntMap.__interfaces__ = [ca];
  7649. y.ds.IntMap.prototype = {
  7650. keys: function () {
  7651. var a = [],
  7652. b;
  7653. for (b in this.h) this.h.hasOwnProperty(b) && a.push(b | 0);
  7654. return S.iter(a)
  7655. },
  7656. exists: function (a) {
  7657. return this.h.hasOwnProperty(a)
  7658. },
  7659. get: function (a) {
  7660. return this.h[a]
  7661. },
  7662. set: function (a, b) {
  7663. this.h[a] = b
  7664. },
  7665. __class__: y.ds.IntMap
  7666. };
  7667. y.ds.ObjectMap = function () {
  7668. this.h = {};
  7669. this.h.__keys__ = {}
  7670. };
  7671. s["haxe.ds.ObjectMap"] = y.ds.ObjectMap;
  7672. y.ds.ObjectMap.__name__ = ["haxe", "ds", "ObjectMap"];
  7673. y.ds.ObjectMap.__interfaces__ = [ca];
  7674. y.ds.ObjectMap.prototype = {
  7675. keys: function () {
  7676. var a = [],
  7677. b;
  7678. for (b in this.h.__keys__) this.h.hasOwnProperty(b) && a.push(this.h.__keys__[b]);
  7679. return S.iter(a)
  7680. },
  7681. remove: function (a) {
  7682. a = a.__id__;
  7683. if (!this.h.hasOwnProperty(a)) return !1;
  7684. delete this.h[a];
  7685. delete this.h.__keys__[a];
  7686. return !0
  7687. },
  7688. set: function (a, b) {
  7689. var d = null != a.__id__ ? a.__id__ : a.__id__ = ++y.ds.ObjectMap.count;
  7690. this.h[d] = b;
  7691. this.h.__keys__[d] = a
  7692. },
  7693. __class__: y.ds.ObjectMap
  7694. };
  7695. y.ds.StringMap = function () {
  7696. this.h = {}
  7697. };
  7698. s["haxe.ds.StringMap"] = y.ds.StringMap;
  7699. y.ds.StringMap.__name__ = ["haxe", "ds", "StringMap"];
  7700. y.ds.StringMap.__interfaces__ = [ca];
  7701. y.ds.StringMap.prototype = {
  7702. keys: function () {
  7703. var a = [],
  7704. b;
  7705. for (b in this.h) this.h.hasOwnProperty(b) &&
  7706. a.push(b.substr(1));
  7707. return S.iter(a)
  7708. },
  7709. remove: function (a) {
  7710. a = "$" + a;
  7711. if (!this.h.hasOwnProperty(a)) return !1;
  7712. delete this.h[a];
  7713. return !0
  7714. },
  7715. exists: function (a) {
  7716. return this.h.hasOwnProperty("$" + a)
  7717. },
  7718. get: function (a) {
  7719. return this.h["$" + a]
  7720. },
  7721. set: function (a, b) {
  7722. this.h["$" + a] = b
  7723. },
  7724. __class__: y.ds.StringMap
  7725. };
  7726. y.io = {};
  7727. y.io.Bytes = function (a, b) {
  7728. this.length = a;
  7729. this.b = b
  7730. };
  7731. s["haxe.io.Bytes"] = y.io.Bytes;
  7732. y.io.Bytes.__name__ = ["haxe", "io", "Bytes"];
  7733. y.io.Bytes.alloc = function (a) {
  7734. for (var b = [], d = 0; d < a;) d++, b.push(0);
  7735. return new y.io.Bytes(a,
  7736. b)
  7737. };
  7738. y.io.Bytes.ofString = function (a) {
  7739. for (var b = [], d = 0, c = a.length; d < c;) {
  7740. var e = d++,
  7741. e = a.charCodeAt(e);
  7742. 127 >= e ? b.push(e) : (2047 >= e ? b.push(192 | e >> 6) : (65535 >= e ? b.push(224 | e >> 12) : (b.push(240 | e >> 18), b.push(128 | e >> 12 & 63)), b.push(128 | e >> 6 & 63)), b.push(128 | e & 63))
  7743. }
  7744. return new y.io.Bytes(b.length, b)
  7745. };
  7746. y.io.Bytes.prototype = {
  7747. toString: function () {
  7748. return this.readString(0, this.length)
  7749. },
  7750. readString: function (a, b) {
  7751. if (0 > a || 0 > b || a + b > this.length) throw y.io.Error.OutsideBounds;
  7752. for (var d = "", c = this.b, e = String.fromCharCode, f = a, l = a +
  7753. b; f < l;) {
  7754. var m = c[f++];
  7755. if (128 > m) {
  7756. if (0 == m) break;
  7757. d += e(m)
  7758. } else if (224 > m) d += e((m & 63) << 6 | c[f++] & 127);
  7759. else if (240 > m) var h = c[f++],
  7760. d = d + e((m & 31) << 12 | (h & 127) << 6 | c[f++] & 127);
  7761. else var h = c[f++],
  7762. p = c[f++],
  7763. d = d + e((m & 15) << 18 | (h & 127) << 12 | p << 6 & 127 | c[f++] & 127)
  7764. }
  7765. return d
  7766. },
  7767. __class__: y.io.Bytes
  7768. };
  7769. y.io.Eof = function () {};
  7770. s["haxe.io.Eof"] = y.io.Eof;
  7771. y.io.Eof.__name__ = ["haxe", "io", "Eof"];
  7772. y.io.Eof.prototype = {
  7773. toString: function () {
  7774. return "Eof"
  7775. },
  7776. __class__: y.io.Eof
  7777. };
  7778. y.io.Error = s["haxe.io.Error"] = {
  7779. __ename__: ["haxe", "io", "Error"],
  7780. __constructs__: ["Blocked",
  7781. "Overflow", "OutsideBounds", "Custom"
  7782. ]
  7783. };
  7784. y.io.Error.Blocked = ["Blocked", 0];
  7785. y.io.Error.Blocked.toString = N;
  7786. y.io.Error.Blocked.__enum__ = y.io.Error;
  7787. y.io.Error.Overflow = ["Overflow", 1];
  7788. y.io.Error.Overflow.toString = N;
  7789. y.io.Error.Overflow.__enum__ = y.io.Error;
  7790. y.io.Error.OutsideBounds = ["OutsideBounds", 2];
  7791. y.io.Error.OutsideBounds.toString = N;
  7792. y.io.Error.OutsideBounds.__enum__ = y.io.Error;
  7793. y.io.Error.Custom = function (a) {
  7794. a = ["Custom", 3, a];
  7795. a.__enum__ = y.io.Error;
  7796. a.toString = N;
  7797. return a
  7798. };
  7799. y.xml = {};
  7800. y.xml.Parser = function () {};
  7801. s["haxe.xml.Parser"] =
  7802. y.xml.Parser;
  7803. y.xml.Parser.__name__ = ["haxe", "xml", "Parser"];
  7804. y.xml.Parser.parse = function (a) {
  7805. var b = O.createDocument();
  7806. y.xml.Parser.doParse(a, 0, b);
  7807. return b
  7808. };
  7809. y.xml.Parser.doParse = function (a, b, d) {
  7810. null == b && (b = 0);
  7811. for (var c = null, e = 1, f = 1, l = null, m = 0, h = 0, p = 0, C = a.charCodeAt(b), r = new fa; C == C;) {
  7812. switch (e) {
  7813. case 0:
  7814. switch (C) {
  7815. case 10:
  7816. case 13:
  7817. case 9:
  7818. case 32:
  7819. break;
  7820. default:
  7821. e = f;
  7822. continue
  7823. }
  7824. break;
  7825. case 1:
  7826. switch (C) {
  7827. case 60:
  7828. e = 0;
  7829. f = 2;
  7830. break;
  7831. default:
  7832. m = b;
  7833. e = 13;
  7834. continue
  7835. }
  7836. break;
  7837. case 13:
  7838. 60 == C ? (e = O.createPCData(r.b + S.substr(a, m, b - m)), r = new fa,
  7839. d.addChild(e), h++, e = 0, f = 2) : 38 == C && (r.addSub(a, m, b - m), e = 18, f = 13, m = b + 1);
  7840. break;
  7841. case 17:
  7842. 93 == C && 93 == a.charCodeAt(b + 1) && 62 == a.charCodeAt(b + 2) && (e = O.createCData(S.substr(a, m, b - m)), d.addChild(e), h++, b += 2, e = 1);
  7843. break;
  7844. case 2:
  7845. switch (C) {
  7846. case 33:
  7847. if (91 == a.charCodeAt(b + 1)) {
  7848. b += 2;
  7849. if ("CDATA[" != S.substr(a, b, 6).toUpperCase()) throw "Expected <![CDATA[";
  7850. b += 5;
  7851. e = 17
  7852. } else if (68 == a.charCodeAt(b + 1) || 100 == a.charCodeAt(b + 1)) {
  7853. if ("OCTYPE" != S.substr(a, b + 2, 6).toUpperCase()) throw "Expected <!DOCTYPE";
  7854. b += 8;
  7855. e = 16
  7856. } else {
  7857. if (45 != a.charCodeAt(b +
  7858. 1) || 45 != a.charCodeAt(b + 2)) throw "Expected \x3c!--";
  7859. b += 2;
  7860. e = 15
  7861. }
  7862. m = b + 1;
  7863. break;
  7864. case 63:
  7865. e = 14;
  7866. m = b;
  7867. break;
  7868. case 47:
  7869. if (null == d) throw "Expected node name";
  7870. m = b + 1;
  7871. e = 0;
  7872. f = 10;
  7873. break;
  7874. default:
  7875. e = 3;
  7876. m = b;
  7877. continue
  7878. }
  7879. break;
  7880. case 3:
  7881. if (!(97 <= C && 122 >= C || 65 <= C && 90 >= C || 48 <= C && 57 >= C || 58 == C || 46 == C || 95 == C || 45 == C)) {
  7882. if (b == m) throw "Expected node name";
  7883. c = O.createElement(S.substr(a, m, b - m));
  7884. d.addChild(c);
  7885. e = 0;
  7886. f = 4;
  7887. continue
  7888. }
  7889. break;
  7890. case 4:
  7891. switch (C) {
  7892. case 47:
  7893. e = 11;
  7894. h++;
  7895. break;
  7896. case 62:
  7897. e = 9;
  7898. h++;
  7899. break;
  7900. default:
  7901. e = 5;
  7902. m = b;
  7903. continue
  7904. }
  7905. break;
  7906. case 5:
  7907. if (!(97 <= C && 122 >=
  7908. C || 65 <= C && 90 >= C || 48 <= C && 57 >= C || 58 == C || 46 == C || 95 == C || 45 == C)) {
  7909. if (m == b) throw "Expected attribute name";
  7910. l = S.substr(a, m, b - m);
  7911. if (c.exists(l)) throw "Duplicate attribute";
  7912. e = 0;
  7913. f = 6;
  7914. continue
  7915. }
  7916. break;
  7917. case 6:
  7918. switch (C) {
  7919. case 61:
  7920. e = 0;
  7921. f = 7;
  7922. break;
  7923. default:
  7924. throw "Expected =";
  7925. }
  7926. break;
  7927. case 7:
  7928. switch (C) {
  7929. case 34:
  7930. case 39:
  7931. e = 8;
  7932. m = b;
  7933. break;
  7934. default:
  7935. throw 'Expected "';
  7936. }
  7937. break;
  7938. case 8:
  7939. C == a.charCodeAt(m) && (f = S.substr(a, m + 1, b - m - 1), c.set(l, f), e = 0, f = 4);
  7940. break;
  7941. case 9:
  7942. m = b = y.xml.Parser.doParse(a, b, c);
  7943. e = 1;
  7944. break;
  7945. case 11:
  7946. switch (C) {
  7947. case 62:
  7948. e = 1;
  7949. break;
  7950. default:
  7951. throw "Expected >";
  7952. }
  7953. break;
  7954. case 12:
  7955. switch (C) {
  7956. case 62:
  7957. return 0 == h && d.addChild(O.createPCData("")), b;
  7958. default:
  7959. throw "Expected >";
  7960. }
  7961. case 10:
  7962. if (!(97 <= C && 122 >= C || 65 <= C && 90 >= C || 48 <= C && 57 >= C || 58 == C || 46 == C || 95 == C || 45 == C)) {
  7963. if (m == b) throw "Expected node name";
  7964. if (S.substr(a, m, b - m) != d.get_nodeName()) throw "Expected </" + d.get_nodeName() + ">";
  7965. e = 0;
  7966. f = 12;
  7967. continue
  7968. }
  7969. break;
  7970. case 15:
  7971. 45 == C && 45 == a.charCodeAt(b + 1) && 62 == a.charCodeAt(b + 2) && (d.addChild(O.createComment(S.substr(a, m, b - m))), b += 2, e = 1);
  7972. break;
  7973. case 16:
  7974. 91 == C ? p++ : 93 == C ? p-- : 62 == C && 0 == p && (d.addChild(O.createDocType(S.substr(a,
  7975. m, b - m))), e = 1);
  7976. break;
  7977. case 14:
  7978. 63 == C && 62 == a.charCodeAt(b + 1) && (b++, e = S.substr(a, m + 1, b - m - 2), d.addChild(O.createProcessingInstruction(e)), e = 1);
  7979. break;
  7980. case 18:
  7981. 59 == C && (m = S.substr(a, m, b - m), 35 == m.charCodeAt(0) ? (m = 120 == m.charCodeAt(1) ? K.parseInt("0" + S.substr(m, 1, m.length - 1)) : K.parseInt(S.substr(m, 1, m.length - 1)), r.b += K.string(String.fromCharCode(m))) : y.xml.Parser.escapes.exists(m) ? r.b += K.string(y.xml.Parser.escapes.get(m)) : r.b += K.string("&" + m + ";"), m = b + 1, e = f)
  7982. }
  7983. C = a.charCodeAt(++b)
  7984. }
  7985. 1 == e && (m = b, e = 13);
  7986. if (13 == e) return b ==
  7987. m && 0 != h || d.addChild(O.createPCData(r.b + S.substr(a, m, b - m))), b;
  7988. throw "Unexpected end";
  7989. };
  7990. var F = {
  7991. Boot: function () {}
  7992. };
  7993. s["js.Boot"] = F.Boot;
  7994. F.Boot.__name__ = ["js", "Boot"];
  7995. F.Boot.__unhtml = function (a) {
  7996. return a.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;")
  7997. };
  7998. F.Boot.__trace = function (a, b) {
  7999. var d = null != b ? b.fileName + ":" + b.lineNumber + ": " : "",
  8000. d = d + F.Boot.__string_rec(a, "");
  8001. if (null != b && null != b.customParams)
  8002. for (var c = 0, e = b.customParams; c < e.length;) {
  8003. var f = e[c];
  8004. ++c;
  8005. d += "," + F.Boot.__string_rec(f, "")
  8006. }
  8007. var l;
  8008. "undefined" != typeof document && null != (l = document.getElementById("haxe:trace")) ? l.innerHTML += F.Boot.__unhtml(d) + "<br/>" : "undefined" != typeof console && null != console.log && console.log(d)
  8009. };
  8010. F.Boot.__string_rec = function (a, b) {
  8011. if (null == a) return "null";
  8012. if (5 <= b.length) return "<...>";
  8013. var d = typeof a;
  8014. "function" == d && (a.__name__ || a.__ename__) && (d = "object");
  8015. switch (d) {
  8016. case "object":
  8017. if (a instanceof Array) {
  8018. if (a.__enum__) {
  8019. if (2 == a.length) return a[0];
  8020. d = a[0] + "(";
  8021. b += "\t";
  8022. for (var c = 2, e = a.length; c < e;) var f = c++,
  8023. d = 2 != f ? d + ("," + F.Boot.__string_rec(a[f],
  8024. b)) : d + F.Boot.__string_rec(a[f], b);
  8025. return d + ")"
  8026. }
  8027. c = a.length;
  8028. d = "[";
  8029. b += "\t";
  8030. for (e = 0; e < c;) f = e++, d += (0 < f ? "," : "") + F.Boot.__string_rec(a[f], b);
  8031. return d + "]"
  8032. }
  8033. try {
  8034. e = a.toString
  8035. } catch (l) {
  8036. return "???"
  8037. }
  8038. if (null != e && e != Object.toString && (d = a.toString(), "[object Object]" != d)) return d;
  8039. e = null;
  8040. d = "{\n";
  8041. b += "\t";
  8042. c = null != a.hasOwnProperty;
  8043. for (e in a) c && !a.hasOwnProperty(e) || "prototype" == e || "__class__" == e || "__super__" == e || "__interfaces__" == e || "__properties__" == e || (2 != d.length && (d += ", \n"), d += b + e + " : " + F.Boot.__string_rec(a[e],
  8044. b));
  8045. b = b.substring(1);
  8046. return d += "\n" + b + "}";
  8047. case "function":
  8048. return "<function>";
  8049. case "string":
  8050. return a;
  8051. default:
  8052. return String(a)
  8053. }
  8054. };
  8055. F.Boot.__interfLoop = function (a, b) {
  8056. if (null == a) return !1;
  8057. if (a == b) return !0;
  8058. var d = a.__interfaces__;
  8059. if (null != d)
  8060. for (var c = 0, e = d.length; c < e;) {
  8061. var f = c++,
  8062. f = d[f];
  8063. if (f == b || F.Boot.__interfLoop(f, b)) return !0
  8064. }
  8065. return F.Boot.__interfLoop(a.__super__, b)
  8066. };
  8067. F.Boot.__instanceof = function (a, b) {
  8068. if (null == b) return !1;
  8069. switch (b) {
  8070. case wa:
  8071. return (a | 0) === a;
  8072. case sa:
  8073. return "number" == typeof a;
  8074. case ta:
  8075. return "boolean" ==
  8076. typeof a;
  8077. case String:
  8078. return "string" == typeof a;
  8079. case xa:
  8080. return !0;
  8081. default:
  8082. if (null != a) {
  8083. if ("function" == typeof b) {
  8084. if (a instanceof b) return b == Array ? null == a.__enum__ : !0;
  8085. if (F.Boot.__interfLoop(a.__class__, b)) return !0
  8086. }
  8087. } else return !1;
  8088. return b == ya && null != a.__name__ || b == za && null != a.__ename__ ? !0 : a.__enum__ == b
  8089. }
  8090. };
  8091. F.Boot.__cast = function (a, b) {
  8092. if (F.Boot.__instanceof(a, b)) return a;
  8093. throw "Cannot cast " + K.string(a) + " to " + K.string(b);
  8094. };
  8095. F.Browser = function () {};
  8096. s["js.Browser"] = F.Browser;
  8097. F.Browser.__name__ = ["js", "Browser"];
  8098. F.Browser.getLocalStorage = function () {
  8099. try {
  8100. var a = F.Browser.window.localStorage;
  8101. a.getItem("");
  8102. return a
  8103. } catch (b) {
  8104. return null
  8105. }
  8106. };
  8107. var h = {
  8108. Config: function () {}
  8109. };
  8110. s["nape.Config"] = h.Config;
  8111. h.Config.__name__ = ["nape", "Config"];
  8112. h.Config.prototype = {
  8113. __class__: h.Config
  8114. };
  8115. h.callbacks = {};
  8116. h.callbacks.Callback = function () {
  8117. this.zpp_inner = null;
  8118. if (!c.callbacks.ZPP_Callback.internal) throw "Error: Callback cannot be instantiated derp!";
  8119. };
  8120. s["nape.callbacks.Callback"] = h.callbacks.Callback;
  8121. h.callbacks.Callback.__name__ = ["nape", "callbacks",
  8122. "Callback"
  8123. ];
  8124. h.callbacks.Callback.prototype = {
  8125. toString: function () {
  8126. return ""
  8127. },
  8128. get_listener: function () {
  8129. return this.zpp_inner.listener.outer
  8130. },
  8131. get_event: function () {
  8132. return c.callbacks.ZPP_Listener.events[this.zpp_inner.event]
  8133. },
  8134. __class__: h.callbacks.Callback
  8135. };
  8136. h.callbacks.BodyCallback = function () {
  8137. h.callbacks.Callback.call(this)
  8138. };
  8139. s["nape.callbacks.BodyCallback"] = h.callbacks.BodyCallback;
  8140. h.callbacks.BodyCallback.__name__ = ["nape", "callbacks", "BodyCallback"];
  8141. h.callbacks.BodyCallback.__super__ = h.callbacks.Callback;
  8142. h.callbacks.BodyCallback.prototype = I(h.callbacks.Callback.prototype, {
  8143. toString: function () {
  8144. var a;
  8145. a = "Cb:" + ["WAKE", "SLEEP"][this.zpp_inner.event - c.util.ZPP_Flags.id_CbEvent_WAKE];
  8146. a += ":" + this.zpp_inner.body.outer.toString();
  8147. return a += " : listener: " + K.string(this.zpp_inner.listener.outer)
  8148. },
  8149. get_body: function () {
  8150. return this.zpp_inner.body.outer
  8151. },
  8152. __class__: h.callbacks.BodyCallback
  8153. });
  8154. h.callbacks.Listener = function () {
  8155. this.zpp_inner = null;
  8156. if (!c.callbacks.ZPP_Listener.internal) throw "Error: Cannot instantiate Listener derp!";
  8157. };
  8158. s["nape.callbacks.Listener"] = h.callbacks.Listener;
  8159. h.callbacks.Listener.__name__ = ["nape", "callbacks", "Listener"];
  8160. h.callbacks.Listener.prototype = {
  8161. toString: function () {
  8162. var a = "BEGIN END WAKE SLEEP BREAK PRE ONGOING".split(" ")[this.zpp_inner.event];
  8163. if (this.zpp_inner.type == c.util.ZPP_Flags.id_ListenerType_BODY) return "BodyListener{" + a + "::" + K.string(this.zpp_inner.body.outer_zn.zpp_inner_zn.options.outer) + "}";
  8164. if (this.zpp_inner.type == c.util.ZPP_Flags.id_ListenerType_CONSTRAINT) {
  8165. var b = this.zpp_inner.constraint;
  8166. return "ConstraintListener{" + a + "::" + K.string(b.outer_zn.zpp_inner_zn.options.outer) + "}"
  8167. }
  8168. var b = this.zpp_inner.interaction,
  8169. d;
  8170. switch (b.itype) {
  8171. case c.util.ZPP_Flags.id_InteractionType_COLLISION:
  8172. d = "COLLISION";
  8173. break;
  8174. case c.util.ZPP_Flags.id_InteractionType_SENSOR:
  8175. d = "SENSOR";
  8176. break;
  8177. case c.util.ZPP_Flags.id_InteractionType_FLUID:
  8178. d = "FLUID";
  8179. break;
  8180. default:
  8181. d = "ALL"
  8182. }
  8183. return (this.zpp_inner.type == c.util.ZPP_Flags.id_ListenerType_INTERACTION ? "InteractionListener{" + a + "#" + d + "::" + K.string(b.outer_zni.zpp_inner_zn.options1.outer) +
  8184. ":" + K.string(b.outer_zni.zpp_inner_zn.options2.outer) + "}" : "PreListener{" + d + "::" + K.string(b.outer_znp.zpp_inner_zn.options1.outer) + ":" + K.string(b.outer_znp.zpp_inner_zn.options2.outer) + "}") + " precedence=" + this.zpp_inner.precedence
  8185. },
  8186. set_space: function (a) {
  8187. (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) != a && (null != this.zpp_inner.space && this.zpp_inner.space.outer.zpp_inner.wrap_listeners.remove(this), null != a ? a.zpp_inner.wrap_listeners.add(this) : this.zpp_inner.space = null);
  8188. return null == this.zpp_inner.space ?
  8189. null : this.zpp_inner.space.outer
  8190. },
  8191. get_space: function () {
  8192. return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
  8193. },
  8194. set_precedence: function (a) {
  8195. this.zpp_inner.precedence != a && (this.zpp_inner.precedence = a, this.zpp_inner.invalidate_precedence());
  8196. return this.zpp_inner.precedence
  8197. },
  8198. get_precedence: function () {
  8199. return this.zpp_inner.precedence
  8200. },
  8201. set_event: function (a) {
  8202. if (null == a) throw "Error: Cannot set listener event type to null";
  8203. c.callbacks.ZPP_Listener.events[this.zpp_inner.event] != a && (null == c.util.ZPP_Flags.CbEvent_BEGIN &&
  8204. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BEGIN = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_BEGIN ? a = c.util.ZPP_Flags.id_CbEvent_BEGIN : (null == c.util.ZPP_Flags.CbEvent_ONGOING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_ONGOING = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_ONGOING ? a = c.util.ZPP_Flags.id_CbEvent_ONGOING : (null == c.util.ZPP_Flags.CbEvent_END && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_END =
  8205. new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_END ? a = c.util.ZPP_Flags.id_CbEvent_END : (null == c.util.ZPP_Flags.CbEvent_SLEEP && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_SLEEP = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_SLEEP ? a = c.util.ZPP_Flags.id_CbEvent_SLEEP : (null == c.util.ZPP_Flags.CbEvent_WAKE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_WAKE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_WAKE ?
  8206. a = c.util.ZPP_Flags.id_CbEvent_WAKE : (null == c.util.ZPP_Flags.CbEvent_PRE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_PRE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a = a == c.util.ZPP_Flags.CbEvent_PRE ? c.util.ZPP_Flags.id_CbEvent_PRE : c.util.ZPP_Flags.id_CbEvent_BREAK))))), this.zpp_inner.swapEvent(a));
  8207. return c.callbacks.ZPP_Listener.events[this.zpp_inner.event]
  8208. },
  8209. get_event: function () {
  8210. return c.callbacks.ZPP_Listener.events[this.zpp_inner.event]
  8211. },
  8212. get_type: function () {
  8213. return c.callbacks.ZPP_Listener.types[this.zpp_inner.type]
  8214. },
  8215. __class__: h.callbacks.Listener
  8216. };
  8217. h.callbacks.BodyListener = function (a, b, d, g) {
  8218. null == g && (g = 0);
  8219. this.zpp_inner_zn = null;
  8220. c.callbacks.ZPP_Listener.internal = !0;
  8221. h.callbacks.Listener.call(this);
  8222. c.callbacks.ZPP_Listener.internal = !1;
  8223. if (null == d) throw "Error: BodyListener::handler cannot be null";
  8224. var e = -1;
  8225. null == c.util.ZPP_Flags.CbEvent_WAKE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_WAKE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8226. if (a == c.util.ZPP_Flags.CbEvent_WAKE) e = c.util.ZPP_Flags.id_CbEvent_WAKE;
  8227. else if (null == c.util.ZPP_Flags.CbEvent_SLEEP && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_SLEEP = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_SLEEP) e = c.util.ZPP_Flags.id_CbEvent_SLEEP;
  8228. else throw "Error: cbEvent '" + a.toString() + "' is not a valid event type for a BodyListener";
  8229. this.zpp_inner = this.zpp_inner_zn = new c.callbacks.ZPP_BodyListener(c.callbacks.ZPP_OptionType.argument(b), e, d);
  8230. this.zpp_inner.outer = this;
  8231. this.zpp_inner_zn.outer_zn = this;
  8232. this.zpp_inner.precedence =
  8233. g
  8234. };
  8235. s["nape.callbacks.BodyListener"] = h.callbacks.BodyListener;
  8236. h.callbacks.BodyListener.__name__ = ["nape", "callbacks", "BodyListener"];
  8237. h.callbacks.BodyListener.__super__ = h.callbacks.Listener;
  8238. h.callbacks.BodyListener.prototype = I(h.callbacks.Listener.prototype, {
  8239. set_handler: function (a) {
  8240. if (null == a) throw "Error: BodyListener::handler cannot be null";
  8241. this.zpp_inner_zn.handler = a;
  8242. return this.zpp_inner_zn.handler
  8243. },
  8244. get_handler: function () {
  8245. return this.zpp_inner_zn.handler
  8246. },
  8247. set_options: function (a) {
  8248. this.zpp_inner_zn.options.set(a.zpp_inner);
  8249. return this.zpp_inner_zn.options.outer
  8250. },
  8251. get_options: function () {
  8252. return this.zpp_inner_zn.options.outer
  8253. },
  8254. __class__: h.callbacks.BodyListener
  8255. });
  8256. h.callbacks.CbEvent = function () {
  8257. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate CbEvent derp!";
  8258. };
  8259. s["nape.callbacks.CbEvent"] = h.callbacks.CbEvent;
  8260. h.callbacks.CbEvent.__name__ = ["nape", "callbacks", "CbEvent"];
  8261. h.callbacks.CbEvent.get_BEGIN = function () {
  8262. null == c.util.ZPP_Flags.CbEvent_BEGIN && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BEGIN = new h.callbacks.CbEvent,
  8263. c.util.ZPP_Flags.internal = !1);
  8264. return c.util.ZPP_Flags.CbEvent_BEGIN
  8265. };
  8266. h.callbacks.CbEvent.get_ONGOING = function () {
  8267. null == c.util.ZPP_Flags.CbEvent_ONGOING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_ONGOING = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8268. return c.util.ZPP_Flags.CbEvent_ONGOING
  8269. };
  8270. h.callbacks.CbEvent.get_END = function () {
  8271. null == c.util.ZPP_Flags.CbEvent_END && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_END = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8272. return c.util.ZPP_Flags.CbEvent_END
  8273. };
  8274. h.callbacks.CbEvent.get_WAKE = function () {
  8275. null == c.util.ZPP_Flags.CbEvent_WAKE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_WAKE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8276. return c.util.ZPP_Flags.CbEvent_WAKE
  8277. };
  8278. h.callbacks.CbEvent.get_SLEEP = function () {
  8279. null == c.util.ZPP_Flags.CbEvent_SLEEP && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_SLEEP = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8280. return c.util.ZPP_Flags.CbEvent_SLEEP
  8281. };
  8282. h.callbacks.CbEvent.get_BREAK = function () {
  8283. null ==
  8284. c.util.ZPP_Flags.CbEvent_BREAK && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BREAK = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8285. return c.util.ZPP_Flags.CbEvent_BREAK
  8286. };
  8287. h.callbacks.CbEvent.get_PRE = function () {
  8288. null == c.util.ZPP_Flags.CbEvent_PRE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_PRE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8289. return c.util.ZPP_Flags.CbEvent_PRE
  8290. };
  8291. h.callbacks.CbEvent.prototype = {
  8292. toString: function () {
  8293. var a;
  8294. null == c.util.ZPP_Flags.CbEvent_PRE &&
  8295. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_PRE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8296. this == c.util.ZPP_Flags.CbEvent_PRE ? a = "PRE" : (null == c.util.ZPP_Flags.CbEvent_BEGIN && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BEGIN = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.CbEvent_BEGIN ? a = "BEGIN" : (null == c.util.ZPP_Flags.CbEvent_ONGOING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_ONGOING = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.CbEvent_ONGOING ? a = "ONGOING" : (null == c.util.ZPP_Flags.CbEvent_END && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_END = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.CbEvent_END ? a = "END" : (null == c.util.ZPP_Flags.CbEvent_WAKE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_WAKE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.CbEvent_WAKE ? a = "WAKE" : (null == c.util.ZPP_Flags.CbEvent_SLEEP && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_SLEEP = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.CbEvent_SLEEP ? a = "SLEEP" : (null == c.util.ZPP_Flags.CbEvent_BREAK && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BREAK = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.CbEvent_BREAK ? "BREAK" : ""))))));
  8297. return a
  8298. },
  8299. __class__: h.callbacks.CbEvent
  8300. };
  8301. h.callbacks.CbType = function () {
  8302. this.zpp_inner = null;
  8303. this.zpp_inner = new c.callbacks.ZPP_CbType;
  8304. this.zpp_inner.outer = this
  8305. };
  8306. s["nape.callbacks.CbType"] = h.callbacks.CbType;
  8307. h.callbacks.CbType.__name__ = ["nape", "callbacks", "CbType"];
  8308. h.callbacks.CbType.get_ANY_BODY = function () {
  8309. return c.callbacks.ZPP_CbType.ANY_BODY
  8310. };
  8311. h.callbacks.CbType.get_ANY_CONSTRAINT = function () {
  8312. return c.callbacks.ZPP_CbType.ANY_CONSTRAINT
  8313. };
  8314. h.callbacks.CbType.get_ANY_SHAPE = function () {
  8315. return c.callbacks.ZPP_CbType.ANY_SHAPE
  8316. };
  8317. h.callbacks.CbType.get_ANY_COMPOUND = function () {
  8318. return c.callbacks.ZPP_CbType.ANY_COMPOUND
  8319. };
  8320. h.callbacks.CbType.prototype = {
  8321. toString: function () {
  8322. return this ==
  8323. c.callbacks.ZPP_CbType.ANY_BODY ? "ANY_BODY" : this == c.callbacks.ZPP_CbType.ANY_SHAPE ? "ANY_SHAPE" : this == c.callbacks.ZPP_CbType.ANY_COMPOUND ? "ANY_COMPOUND" : this == c.callbacks.ZPP_CbType.ANY_CONSTRAINT ? "ANY_CONSTRAINT" : "CbType#" + this.zpp_inner.id
  8324. },
  8325. get_constraints: function () {
  8326. null == this.zpp_inner.wrap_constraints && (this.zpp_inner.wrap_constraints = c.util.ZPP_ConstraintList.get(this.zpp_inner.constraints, !0));
  8327. return this.zpp_inner.wrap_constraints
  8328. },
  8329. get_interactors: function () {
  8330. null == this.zpp_inner.wrap_interactors &&
  8331. (this.zpp_inner.wrap_interactors = c.util.ZPP_InteractorList.get(this.zpp_inner.interactors, !0));
  8332. return this.zpp_inner.wrap_interactors
  8333. },
  8334. get_userData: function () {
  8335. null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
  8336. return this.zpp_inner.userData
  8337. },
  8338. excluding: function (a) {
  8339. return (new h.callbacks.OptionType(this)).excluding(a)
  8340. },
  8341. including: function (a) {
  8342. return (new h.callbacks.OptionType(this)).including(a)
  8343. },
  8344. get_id: function () {
  8345. return this.zpp_inner.id
  8346. },
  8347. __class__: h.callbacks.CbType
  8348. };
  8349. h.callbacks.CbTypeIterator =
  8350. function () {
  8351. this.zpp_next = null;
  8352. this.zpp_critical = !1;
  8353. this.zpp_i = 0;
  8354. this.zpp_inner = null;
  8355. if (!c.util.ZPP_CbTypeList.internal) throw "Error: Cannot instantiate CbTypeIterator derp!";
  8356. };
  8357. s["nape.callbacks.CbTypeIterator"] = h.callbacks.CbTypeIterator;
  8358. h.callbacks.CbTypeIterator.__name__ = ["nape", "callbacks", "CbTypeIterator"];
  8359. h.callbacks.CbTypeIterator.get = function (a) {
  8360. var b = null == h.callbacks.CbTypeIterator.zpp_pool ? function (a) {
  8361. c.util.ZPP_CbTypeList.internal = !0;
  8362. a = new h.callbacks.CbTypeIterator;
  8363. c.util.ZPP_CbTypeList.internal = !1;
  8364. return a
  8365. }(this) : function (a) {
  8366. a = h.callbacks.CbTypeIterator.zpp_pool;
  8367. h.callbacks.CbTypeIterator.zpp_pool = a.zpp_next;
  8368. return a
  8369. }(this);
  8370. b.zpp_i = 0;
  8371. b.zpp_inner = a;
  8372. b.zpp_critical = !1;
  8373. return b
  8374. };
  8375. h.callbacks.CbTypeIterator.prototype = {
  8376. next: function () {
  8377. this.zpp_critical = !1;
  8378. return this.zpp_inner.at(this.zpp_i++)
  8379. },
  8380. hasNext: function () {
  8381. this.zpp_inner.zpp_inner.valmod();
  8382. var a = this.zpp_inner.get_length();
  8383. this.zpp_critical = !0;
  8384. if (this.zpp_i < a) return !0;
  8385. this.zpp_next = h.callbacks.CbTypeIterator.zpp_pool;
  8386. h.callbacks.CbTypeIterator.zpp_pool =
  8387. this;
  8388. this.zpp_inner = null;
  8389. return !1
  8390. },
  8391. __class__: h.callbacks.CbTypeIterator
  8392. };
  8393. h.callbacks.CbTypeList = function () {
  8394. this.zpp_inner = null;
  8395. this.zpp_inner = new c.util.ZPP_CbTypeList;
  8396. this.zpp_inner.outer = this
  8397. };
  8398. s["nape.callbacks.CbTypeList"] = h.callbacks.CbTypeList;
  8399. h.callbacks.CbTypeList.__name__ = ["nape", "callbacks", "CbTypeList"];
  8400. h.callbacks.CbTypeList.fromArray = function (a) {
  8401. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  8402. for (var b = new h.callbacks.CbTypeList, d = 0; d < a.length;) {
  8403. var c = a[d];
  8404. ++d;
  8405. b.push(c)
  8406. }
  8407. return b
  8408. };
  8409. h.callbacks.CbTypeList.prototype = {
  8410. filter: function (a) {
  8411. if (null == a) throw "Error: Cannot select elements of list with null";
  8412. for (var b = 0; b < this.get_length();) {
  8413. var d = this.at(b);
  8414. try {
  8415. a(d) ? b++ : this.remove(d)
  8416. } catch (c) {
  8417. break
  8418. }
  8419. }
  8420. return this
  8421. },
  8422. foreach: function (a) {
  8423. if (null == a) throw "Error: Cannot execute null on list elements";
  8424. var b;
  8425. this.zpp_inner.valmod();
  8426. for (b = h.callbacks.CbTypeIterator.get(this); b.hasNext();) try {
  8427. var d = a,
  8428. c;
  8429. b.zpp_critical = !1;
  8430. c = b.zpp_inner.at(b.zpp_i++);
  8431. d(c)
  8432. } catch (e) {
  8433. b.zpp_next = h.callbacks.CbTypeIterator.zpp_pool;
  8434. h.callbacks.CbTypeIterator.zpp_pool = b;
  8435. b.zpp_inner = null;
  8436. break
  8437. }
  8438. return this
  8439. },
  8440. toString: function () {
  8441. var a = "[",
  8442. b = !0,
  8443. d;
  8444. this.zpp_inner.valmod();
  8445. for (d = h.callbacks.CbTypeIterator.get(this); d.hasNext();) {
  8446. var c = d.next();
  8447. b || (a += ",");
  8448. a += null == c ? "NULL" : c.toString();
  8449. b = !1
  8450. }
  8451. return a + "]"
  8452. },
  8453. merge: function (a) {
  8454. if (null == a) throw "Error: Cannot merge with null list";
  8455. a.zpp_inner.valmod();
  8456. for (a = h.callbacks.CbTypeIterator.get(a); a.hasNext();) {
  8457. var b = a.next();
  8458. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  8459. }
  8460. },
  8461. copy: function (a) {
  8462. null == a && (a = !1);
  8463. var b = new h.callbacks.CbTypeList,
  8464. d;
  8465. this.zpp_inner.valmod();
  8466. for (d = h.callbacks.CbTypeIterator.get(this); d.hasNext();) {
  8467. var c = d.next();
  8468. b.push(a ? function (a) {
  8469. throw "Error: CbType is not a copyable type";
  8470. }(this) : c)
  8471. }
  8472. return b
  8473. },
  8474. iterator: function () {
  8475. this.zpp_inner.valmod();
  8476. return h.callbacks.CbTypeIterator.get(this)
  8477. },
  8478. empty: function () {
  8479. return null == this.zpp_inner.inner.head
  8480. },
  8481. clear: function () {
  8482. if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
  8483. if (this.zpp_inner.reverse_flag)
  8484. for (; null !=
  8485. this.zpp_inner.inner.head;) this.pop();
  8486. else
  8487. for (; null != this.zpp_inner.inner.head;) this.shift()
  8488. },
  8489. remove: function (a) {
  8490. if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
  8491. this.zpp_inner.modify_test();
  8492. this.zpp_inner.valmod();
  8493. var b;
  8494. b = !1;
  8495. for (var d = this.zpp_inner.inner.head; null != d;) {
  8496. if (d.elt == a.zpp_inner) {
  8497. b = !0;
  8498. break
  8499. }
  8500. d = d.next
  8501. }
  8502. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  8503. return b
  8504. },
  8505. add: function (a) {
  8506. return this.zpp_inner.reverse_flag ?
  8507. this.push(a) : this.unshift(a)
  8508. },
  8509. shift: function () {
  8510. if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
  8511. this.zpp_inner.modify_test();
  8512. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  8513. this.zpp_inner.valmod();
  8514. var a = null;
  8515. if (this.zpp_inner.reverse_flag) {
  8516. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  8517. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  8518. a = null == b ? this.zpp_inner.inner.head.elt :
  8519. b.next.elt,
  8520. d = a.outer;
  8521. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  8522. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  8523. } else a = this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  8524. this.zpp_inner.invalidate();
  8525. return d = a.outer
  8526. },
  8527. pop: function () {
  8528. if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
  8529. this.zpp_inner.modify_test();
  8530. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  8531. this.zpp_inner.valmod();
  8532. var a = null;
  8533. if (this.zpp_inner.reverse_flag) {
  8534. var a = this.zpp_inner.inner.head.elt,
  8535. b = a.outer;
  8536. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  8537. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  8538. } else {
  8539. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  8540. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  8541. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  8542. b = a.outer;
  8543. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  8544. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  8545. }
  8546. this.zpp_inner.invalidate();
  8547. return b = a.outer
  8548. },
  8549. unshift: function (a) {
  8550. if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
  8551. this.zpp_inner.modify_test();
  8552. this.zpp_inner.valmod();
  8553. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  8554. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite =
  8555. this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  8556. return b
  8557. },
  8558. push: function (a) {
  8559. if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
  8560. this.zpp_inner.modify_test();
  8561. this.zpp_inner.valmod();
  8562. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  8563. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite &&
  8564. (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  8565. return b
  8566. },
  8567. at: function (a) {
  8568. this.zpp_inner.valmod();
  8569. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  8570. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  8571. if (a < this.zpp_inner.at_index || null ==
  8572. this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  8573. else
  8574. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  8575. return this.zpp_inner.at_ite.elt.outer
  8576. },
  8577. has: function (a) {
  8578. this.zpp_inner.valmod();
  8579. return this.zpp_inner.inner.has(a.zpp_inner)
  8580. },
  8581. get_length: function () {
  8582. this.zpp_inner.valmod();
  8583. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  8584. return this.zpp_inner.user_length
  8585. },
  8586. __class__: h.callbacks.CbTypeList
  8587. };
  8588. h.callbacks.ConstraintCallback = function () {
  8589. h.callbacks.Callback.call(this)
  8590. };
  8591. s["nape.callbacks.ConstraintCallback"] = h.callbacks.ConstraintCallback;
  8592. h.callbacks.ConstraintCallback.__name__ = ["nape", "callbacks", "ConstraintCallback"];
  8593. h.callbacks.ConstraintCallback.__super__ = h.callbacks.Callback;
  8594. h.callbacks.ConstraintCallback.prototype = I(h.callbacks.Callback.prototype, {
  8595. toString: function () {
  8596. var a;
  8597. a = "Cb:" + ["WAKE", "SLEEP", "BREAK"][this.zpp_inner.event -
  8598. c.util.ZPP_Flags.id_CbEvent_WAKE
  8599. ];
  8600. a += ":" + this.zpp_inner.constraint.outer.toString();
  8601. return a += " : listener: " + K.string(this.zpp_inner.listener.outer)
  8602. },
  8603. get_constraint: function () {
  8604. return this.zpp_inner.constraint.outer
  8605. },
  8606. __class__: h.callbacks.ConstraintCallback
  8607. });
  8608. h.callbacks.ConstraintListener = function (a, b, d, g) {
  8609. null == g && (g = 0);
  8610. this.zpp_inner_zn = null;
  8611. c.callbacks.ZPP_Listener.internal = !0;
  8612. h.callbacks.Listener.call(this);
  8613. c.callbacks.ZPP_Listener.internal = !1;
  8614. if (null == d) throw "Error: ConstraintListener::handler cannot be null";
  8615. var e = -1;
  8616. null == c.util.ZPP_Flags.CbEvent_WAKE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_WAKE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8617. if (a == c.util.ZPP_Flags.CbEvent_WAKE) e = c.util.ZPP_Flags.id_CbEvent_WAKE;
  8618. else if (null == c.util.ZPP_Flags.CbEvent_SLEEP && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_SLEEP = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_SLEEP) e = c.util.ZPP_Flags.id_CbEvent_SLEEP;
  8619. else if (null == c.util.ZPP_Flags.CbEvent_BREAK &&
  8620. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BREAK = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_BREAK) e = c.util.ZPP_Flags.id_CbEvent_BREAK;
  8621. else throw "Error: cbEvent '" + a.toString() + "' is not a valid event type for a ConstraintListener";
  8622. this.zpp_inner = this.zpp_inner_zn = new c.callbacks.ZPP_ConstraintListener(c.callbacks.ZPP_OptionType.argument(b), e, d);
  8623. this.zpp_inner.outer = this;
  8624. this.zpp_inner_zn.outer_zn = this;
  8625. this.zpp_inner.precedence = g
  8626. };
  8627. s["nape.callbacks.ConstraintListener"] =
  8628. h.callbacks.ConstraintListener;
  8629. h.callbacks.ConstraintListener.__name__ = ["nape", "callbacks", "ConstraintListener"];
  8630. h.callbacks.ConstraintListener.__super__ = h.callbacks.Listener;
  8631. h.callbacks.ConstraintListener.prototype = I(h.callbacks.Listener.prototype, {
  8632. set_handler: function (a) {
  8633. if (null == a) throw "Error: ConstraintListener::handler cannot be null";
  8634. this.zpp_inner_zn.handler = a;
  8635. return this.zpp_inner_zn.handler
  8636. },
  8637. get_handler: function () {
  8638. return this.zpp_inner_zn.handler
  8639. },
  8640. set_options: function (a) {
  8641. this.zpp_inner_zn.options.set(a.zpp_inner);
  8642. return this.zpp_inner_zn.options.outer
  8643. },
  8644. get_options: function () {
  8645. return this.zpp_inner_zn.options.outer
  8646. },
  8647. __class__: h.callbacks.ConstraintListener
  8648. });
  8649. h.callbacks.InteractionCallback = function () {
  8650. h.callbacks.Callback.call(this)
  8651. };
  8652. s["nape.callbacks.InteractionCallback"] = h.callbacks.InteractionCallback;
  8653. h.callbacks.InteractionCallback.__name__ = ["nape", "callbacks", "InteractionCallback"];
  8654. h.callbacks.InteractionCallback.__super__ = h.callbacks.Callback;
  8655. h.callbacks.InteractionCallback.prototype = I(h.callbacks.Callback.prototype, {
  8656. toString: function () {
  8657. var a;
  8658. a = "Cb:" + "BEGIN END ONGOING".split(" ")[this.zpp_inner.event];
  8659. a += ":" + this.zpp_inner.int1.outer_i.toString() + "/" + this.zpp_inner.int2.outer_i.toString();
  8660. a += " : " + this.zpp_inner.wrap_arbiters.toString();
  8661. return a += " : listener: " + K.string(this.zpp_inner.listener.outer)
  8662. },
  8663. get_arbiters: function () {
  8664. return this.zpp_inner.wrap_arbiters
  8665. },
  8666. get_int2: function () {
  8667. return this.zpp_inner.int2.outer_i
  8668. },
  8669. get_int1: function () {
  8670. return this.zpp_inner.int1.outer_i
  8671. },
  8672. __class__: h.callbacks.InteractionCallback
  8673. });
  8674. h.callbacks.InteractionListener = function (a, b, d, g, e, f) {
  8675. null == f && (f = 0);
  8676. this.zpp_inner_zn = null;
  8677. c.callbacks.ZPP_Listener.internal = !0;
  8678. h.callbacks.Listener.call(this);
  8679. c.callbacks.ZPP_Listener.internal = !1;
  8680. if (null == e) throw "Error: InteractionListener::handler cannot be null";
  8681. if (null == a) throw "Error: CbEvent cannot be null for InteractionListener";
  8682. var l = -1;
  8683. null == c.util.ZPP_Flags.CbEvent_BEGIN && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BEGIN = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  8684. if (a == c.util.ZPP_Flags.CbEvent_BEGIN) l = c.util.ZPP_Flags.id_CbEvent_BEGIN;
  8685. else if (null == c.util.ZPP_Flags.CbEvent_END && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_END = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_END) l = c.util.ZPP_Flags.id_CbEvent_END;
  8686. else if (null == c.util.ZPP_Flags.CbEvent_ONGOING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_ONGOING = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.CbEvent_ONGOING) l = c.util.ZPP_Flags.id_CbEvent_ONGOING;
  8687. else throw "Error: CbEvent '" + a.toString() + "' is not a valid event type for InteractionListener";
  8688. this.zpp_inner = this.zpp_inner_zn = new c.callbacks.ZPP_InteractionListener(c.callbacks.ZPP_OptionType.argument(d), c.callbacks.ZPP_OptionType.argument(g), l, c.util.ZPP_Flags.id_ListenerType_INTERACTION);
  8689. this.zpp_inner.outer = this;
  8690. this.zpp_inner_zn.outer_zni = this;
  8691. this.zpp_inner.precedence = f;
  8692. this.zpp_inner_zn.handleri = e;
  8693. this.set_interactionType(b)
  8694. };
  8695. s["nape.callbacks.InteractionListener"] = h.callbacks.InteractionListener;
  8696. h.callbacks.InteractionListener.__name__ = ["nape", "callbacks", "InteractionListener"];
  8697. h.callbacks.InteractionListener.__super__ = h.callbacks.Listener;
  8698. h.callbacks.InteractionListener.prototype = I(h.callbacks.Listener.prototype, {
  8699. set_allowSleepingCallbacks: function (a) {
  8700. this.zpp_inner_zn.allowSleepingCallbacks = a;
  8701. return this.zpp_inner_zn.allowSleepingCallbacks
  8702. },
  8703. get_allowSleepingCallbacks: function () {
  8704. return this.zpp_inner_zn.allowSleepingCallbacks
  8705. },
  8706. set_handler: function (a) {
  8707. if (null == a) throw "Error: InteractionListener::handler cannot be null";
  8708. this.zpp_inner_zn.handleri = a;
  8709. return this.zpp_inner_zn.handleri
  8710. },
  8711. get_handler: function () {
  8712. return this.zpp_inner_zn.handleri
  8713. },
  8714. set_interactionType: function (a) {
  8715. if (null == a) throw "Error: Cannot set listener interaction type to null";
  8716. this.get_interactionType() != a && (null == c.util.ZPP_Flags.InteractionType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.InteractionType_COLLISION ? a = c.util.ZPP_Flags.id_InteractionType_COLLISION :
  8717. (null == c.util.ZPP_Flags.InteractionType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.InteractionType_SENSOR ? a = c.util.ZPP_Flags.id_InteractionType_SENSOR : (null == c.util.ZPP_Flags.InteractionType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_FLUID = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = a == c.util.ZPP_Flags.InteractionType_FLUID ? c.util.ZPP_Flags.id_InteractionType_FLUID :
  8718. c.util.ZPP_Flags.id_InteractionType_ANY)), this.zpp_inner_zn.itype = a);
  8719. return this.get_interactionType()
  8720. },
  8721. get_interactionType: function () {
  8722. var a = this.zpp_inner_zn.itype;
  8723. a == c.util.ZPP_Flags.id_InteractionType_COLLISION ? (null == c.util.ZPP_Flags.InteractionType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_COLLISION) : a == c.util.ZPP_Flags.id_InteractionType_SENSOR ? (null == c.util.ZPP_Flags.InteractionType_SENSOR &&
  8724. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_SENSOR) : a == c.util.ZPP_Flags.id_InteractionType_FLUID ? (null == c.util.ZPP_Flags.InteractionType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_FLUID = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_FLUID) : a == c.util.ZPP_Flags.id_InteractionType_ANY ? (null == c.util.ZPP_Flags.InteractionType_ANY &&
  8725. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_ANY = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_ANY) : a = null;
  8726. return a
  8727. },
  8728. set_options2: function (a) {
  8729. this.zpp_inner_zn.options2.set(a.zpp_inner);
  8730. return this.zpp_inner_zn.options2.outer
  8731. },
  8732. get_options2: function () {
  8733. return this.zpp_inner_zn.options2.outer
  8734. },
  8735. set_options1: function (a) {
  8736. this.zpp_inner_zn.options1.set(a.zpp_inner);
  8737. return this.zpp_inner_zn.options1.outer
  8738. },
  8739. get_options1: function () {
  8740. return this.zpp_inner_zn.options1.outer
  8741. },
  8742. __class__: h.callbacks.InteractionListener
  8743. });
  8744. h.callbacks.InteractionType = function () {
  8745. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate InteractionType derp!";
  8746. };
  8747. s["nape.callbacks.InteractionType"] = h.callbacks.InteractionType;
  8748. h.callbacks.InteractionType.__name__ = ["nape", "callbacks", "InteractionType"];
  8749. h.callbacks.InteractionType.get_COLLISION = function () {
  8750. null == c.util.ZPP_Flags.InteractionType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION = new h.callbacks.InteractionType,
  8751. c.util.ZPP_Flags.internal = !1);
  8752. return c.util.ZPP_Flags.InteractionType_COLLISION
  8753. };
  8754. h.callbacks.InteractionType.get_SENSOR = function () {
  8755. null == c.util.ZPP_Flags.InteractionType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1);
  8756. return c.util.ZPP_Flags.InteractionType_SENSOR
  8757. };
  8758. h.callbacks.InteractionType.get_FLUID = function () {
  8759. null == c.util.ZPP_Flags.InteractionType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_FLUID =
  8760. new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1);
  8761. return c.util.ZPP_Flags.InteractionType_FLUID
  8762. };
  8763. h.callbacks.InteractionType.get_ANY = function () {
  8764. null == c.util.ZPP_Flags.InteractionType_ANY && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_ANY = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1);
  8765. return c.util.ZPP_Flags.InteractionType_ANY
  8766. };
  8767. h.callbacks.InteractionType.prototype = {
  8768. toString: function () {
  8769. var a;
  8770. null == c.util.ZPP_Flags.InteractionType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1);
  8771. this == c.util.ZPP_Flags.InteractionType_COLLISION ? a = "COLLISION" : (null == c.util.ZPP_Flags.InteractionType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.InteractionType_SENSOR ? a = "SENSOR" : (null == c.util.ZPP_Flags.InteractionType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_FLUID =
  8772. new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.InteractionType_FLUID ? a = "FLUID" : (null == c.util.ZPP_Flags.InteractionType_ANY && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_ANY = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.InteractionType_ANY ? "ANY" : "")));
  8773. return a
  8774. },
  8775. __class__: h.callbacks.InteractionType
  8776. };
  8777. h.callbacks.ListenerIterator = function () {
  8778. this.zpp_next = null;
  8779. this.zpp_critical = !1;
  8780. this.zpp_i = 0;
  8781. this.zpp_inner =
  8782. null;
  8783. if (!c.util.ZPP_ListenerList.internal) throw "Error: Cannot instantiate ListenerIterator derp!";
  8784. };
  8785. s["nape.callbacks.ListenerIterator"] = h.callbacks.ListenerIterator;
  8786. h.callbacks.ListenerIterator.__name__ = ["nape", "callbacks", "ListenerIterator"];
  8787. h.callbacks.ListenerIterator.get = function (a) {
  8788. var b = null == h.callbacks.ListenerIterator.zpp_pool ? function (a) {
  8789. c.util.ZPP_ListenerList.internal = !0;
  8790. a = new h.callbacks.ListenerIterator;
  8791. c.util.ZPP_ListenerList.internal = !1;
  8792. return a
  8793. }(this) : function (a) {
  8794. a = h.callbacks.ListenerIterator.zpp_pool;
  8795. h.callbacks.ListenerIterator.zpp_pool = a.zpp_next;
  8796. return a
  8797. }(this);
  8798. b.zpp_i = 0;
  8799. b.zpp_inner = a;
  8800. b.zpp_critical = !1;
  8801. return b
  8802. };
  8803. h.callbacks.ListenerIterator.prototype = {
  8804. next: function () {
  8805. this.zpp_critical = !1;
  8806. return this.zpp_inner.at(this.zpp_i++)
  8807. },
  8808. hasNext: function () {
  8809. this.zpp_inner.zpp_inner.valmod();
  8810. var a = this.zpp_inner.get_length();
  8811. this.zpp_critical = !0;
  8812. if (this.zpp_i < a) return !0;
  8813. this.zpp_next = h.callbacks.ListenerIterator.zpp_pool;
  8814. h.callbacks.ListenerIterator.zpp_pool = this;
  8815. this.zpp_inner = null;
  8816. return !1
  8817. },
  8818. __class__: h.callbacks.ListenerIterator
  8819. };
  8820. h.callbacks.ListenerList = function () {
  8821. this.zpp_inner = null;
  8822. this.zpp_inner = new c.util.ZPP_ListenerList;
  8823. this.zpp_inner.outer = this
  8824. };
  8825. s["nape.callbacks.ListenerList"] = h.callbacks.ListenerList;
  8826. h.callbacks.ListenerList.__name__ = ["nape", "callbacks", "ListenerList"];
  8827. h.callbacks.ListenerList.fromArray = function (a) {
  8828. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  8829. for (var b = new h.callbacks.ListenerList, d = 0; d < a.length;) {
  8830. var c = a[d];
  8831. ++d;
  8832. b.push(c)
  8833. }
  8834. return b
  8835. };
  8836. h.callbacks.ListenerList.prototype = {
  8837. filter: function (a) {
  8838. if (null ==
  8839. a) throw "Error: Cannot select elements of list with null";
  8840. for (var b = 0; b < this.get_length();) {
  8841. var d = this.at(b);
  8842. try {
  8843. a(d) ? b++ : this.remove(d)
  8844. } catch (c) {
  8845. break
  8846. }
  8847. }
  8848. return this
  8849. },
  8850. foreach: function (a) {
  8851. if (null == a) throw "Error: Cannot execute null on list elements";
  8852. var b;
  8853. this.zpp_inner.valmod();
  8854. for (b = h.callbacks.ListenerIterator.get(this); b.hasNext();) try {
  8855. var d = a,
  8856. c;
  8857. b.zpp_critical = !1;
  8858. c = b.zpp_inner.at(b.zpp_i++);
  8859. d(c)
  8860. } catch (e) {
  8861. b.zpp_next = h.callbacks.ListenerIterator.zpp_pool;
  8862. h.callbacks.ListenerIterator.zpp_pool = b;
  8863. b.zpp_inner =
  8864. null;
  8865. break
  8866. }
  8867. return this
  8868. },
  8869. toString: function () {
  8870. var a = "[",
  8871. b = !0,
  8872. d;
  8873. this.zpp_inner.valmod();
  8874. for (d = h.callbacks.ListenerIterator.get(this); d.hasNext();) {
  8875. var c = d.next();
  8876. b || (a += ",");
  8877. a += null == c ? "NULL" : c.toString();
  8878. b = !1
  8879. }
  8880. return a + "]"
  8881. },
  8882. merge: function (a) {
  8883. if (null == a) throw "Error: Cannot merge with null list";
  8884. a.zpp_inner.valmod();
  8885. for (a = h.callbacks.ListenerIterator.get(a); a.hasNext();) {
  8886. var b = a.next();
  8887. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  8888. }
  8889. },
  8890. copy: function (a) {
  8891. null == a && (a = !1);
  8892. var b = new h.callbacks.ListenerList,
  8893. d;
  8894. this.zpp_inner.valmod();
  8895. for (d = h.callbacks.ListenerIterator.get(this); d.hasNext();) {
  8896. var c = d.next();
  8897. b.push(a ? function (a) {
  8898. throw "Error: Listener is not a copyable type";
  8899. }(this) : c)
  8900. }
  8901. return b
  8902. },
  8903. iterator: function () {
  8904. this.zpp_inner.valmod();
  8905. return h.callbacks.ListenerIterator.get(this)
  8906. },
  8907. empty: function () {
  8908. return null == this.zpp_inner.inner.head
  8909. },
  8910. clear: function () {
  8911. if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
  8912. if (this.zpp_inner.reverse_flag)
  8913. for (; null != this.zpp_inner.inner.head;) this.pop();
  8914. else
  8915. for (; null != this.zpp_inner.inner.head;) this.shift()
  8916. },
  8917. remove: function (a) {
  8918. if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
  8919. this.zpp_inner.modify_test();
  8920. this.zpp_inner.valmod();
  8921. var b;
  8922. b = !1;
  8923. for (var d = this.zpp_inner.inner.head; null != d;) {
  8924. if (d.elt == a.zpp_inner) {
  8925. b = !0;
  8926. break
  8927. }
  8928. d = d.next
  8929. }
  8930. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  8931. return b
  8932. },
  8933. add: function (a) {
  8934. return this.zpp_inner.reverse_flag ?
  8935. this.push(a) : this.unshift(a)
  8936. },
  8937. shift: function () {
  8938. if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
  8939. this.zpp_inner.modify_test();
  8940. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  8941. this.zpp_inner.valmod();
  8942. var a = null;
  8943. if (this.zpp_inner.reverse_flag) {
  8944. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  8945. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  8946. a = null == b ? this.zpp_inner.inner.head.elt :
  8947. b.next.elt,
  8948. d = a.outer;
  8949. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  8950. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  8951. } else a = this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  8952. this.zpp_inner.invalidate();
  8953. return d = a.outer
  8954. },
  8955. pop: function () {
  8956. if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
  8957. this.zpp_inner.modify_test();
  8958. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  8959. this.zpp_inner.valmod();
  8960. var a = null;
  8961. if (this.zpp_inner.reverse_flag) {
  8962. var a = this.zpp_inner.inner.head.elt,
  8963. b = a.outer;
  8964. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  8965. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  8966. } else {
  8967. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  8968. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  8969. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  8970. b = a.outer;
  8971. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  8972. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  8973. }
  8974. this.zpp_inner.invalidate();
  8975. return b = a.outer
  8976. },
  8977. unshift: function (a) {
  8978. if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
  8979. this.zpp_inner.modify_test();
  8980. this.zpp_inner.valmod();
  8981. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  8982. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite =
  8983. this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  8984. return b
  8985. },
  8986. push: function (a) {
  8987. if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
  8988. this.zpp_inner.modify_test();
  8989. this.zpp_inner.valmod();
  8990. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  8991. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite &&
  8992. (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  8993. return b
  8994. },
  8995. at: function (a) {
  8996. this.zpp_inner.valmod();
  8997. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  8998. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  8999. if (a < this.zpp_inner.at_index || null ==
  9000. this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  9001. else
  9002. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  9003. return this.zpp_inner.at_ite.elt.outer
  9004. },
  9005. has: function (a) {
  9006. this.zpp_inner.valmod();
  9007. return this.zpp_inner.inner.has(a.zpp_inner)
  9008. },
  9009. get_length: function () {
  9010. this.zpp_inner.valmod();
  9011. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  9012. return this.zpp_inner.user_length
  9013. },
  9014. __class__: h.callbacks.ListenerList
  9015. };
  9016. h.callbacks.ListenerType = function () {
  9017. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ListenerType derp!";
  9018. };
  9019. s["nape.callbacks.ListenerType"] = h.callbacks.ListenerType;
  9020. h.callbacks.ListenerType.__name__ = ["nape", "callbacks", "ListenerType"];
  9021. h.callbacks.ListenerType.get_BODY = function () {
  9022. null == c.util.ZPP_Flags.ListenerType_BODY && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_BODY = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1);
  9023. return c.util.ZPP_Flags.ListenerType_BODY
  9024. };
  9025. h.callbacks.ListenerType.get_CONSTRAINT = function () {
  9026. null == c.util.ZPP_Flags.ListenerType_CONSTRAINT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_CONSTRAINT = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1);
  9027. return c.util.ZPP_Flags.ListenerType_CONSTRAINT
  9028. };
  9029. h.callbacks.ListenerType.get_INTERACTION = function () {
  9030. null == c.util.ZPP_Flags.ListenerType_INTERACTION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_INTERACTION = new h.callbacks.ListenerType,
  9031. c.util.ZPP_Flags.internal = !1);
  9032. return c.util.ZPP_Flags.ListenerType_INTERACTION
  9033. };
  9034. h.callbacks.ListenerType.get_PRE = function () {
  9035. null == c.util.ZPP_Flags.ListenerType_PRE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_PRE = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1);
  9036. return c.util.ZPP_Flags.ListenerType_PRE
  9037. };
  9038. h.callbacks.ListenerType.prototype = {
  9039. toString: function () {
  9040. null == c.util.ZPP_Flags.ListenerType_BODY && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_BODY = new h.callbacks.ListenerType,
  9041. c.util.ZPP_Flags.internal = !1);
  9042. var a;
  9043. this == c.util.ZPP_Flags.ListenerType_BODY ? a = "BODY" : (null == c.util.ZPP_Flags.ListenerType_CONSTRAINT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_CONSTRAINT = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.ListenerType_CONSTRAINT ? a = "CONSTRAINT" : (null == c.util.ZPP_Flags.ListenerType_INTERACTION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_INTERACTION = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.ListenerType_INTERACTION ? a = "INTERACTION" : (null == c.util.ZPP_Flags.ListenerType_PRE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_PRE = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.ListenerType_PRE ? "PRE" : "")));
  9044. return a
  9045. },
  9046. __class__: h.callbacks.ListenerType
  9047. };
  9048. h.callbacks.OptionType = function (a, b) {
  9049. this.zpp_inner = null;
  9050. this.zpp_inner = new c.callbacks.ZPP_OptionType;
  9051. this.zpp_inner.outer = this;
  9052. null != a && this.including(a);
  9053. null != b && this.excluding(b)
  9054. };
  9055. s["nape.callbacks.OptionType"] = h.callbacks.OptionType;
  9056. h.callbacks.OptionType.__name__ = ["nape", "callbacks", "OptionType"];
  9057. h.callbacks.OptionType.prototype = {
  9058. toString: function () {
  9059. null == this.zpp_inner.wrap_includes && this.zpp_inner.setup_includes();
  9060. var a = this.zpp_inner.wrap_includes.toString();
  9061. null == this.zpp_inner.wrap_excludes && this.zpp_inner.setup_excludes();
  9062. return "@{" + a + " excluding " + this.zpp_inner.wrap_excludes.toString() + "}"
  9063. },
  9064. excluding: function (a) {
  9065. this.zpp_inner.append(this.zpp_inner.excludes, a);
  9066. return this
  9067. },
  9068. including: function (a) {
  9069. this.zpp_inner.append(this.zpp_inner.includes, a);
  9070. return this
  9071. },
  9072. get_excludes: function () {
  9073. null == this.zpp_inner.wrap_excludes && this.zpp_inner.setup_excludes();
  9074. return this.zpp_inner.wrap_excludes
  9075. },
  9076. get_includes: function () {
  9077. null == this.zpp_inner.wrap_includes && this.zpp_inner.setup_includes();
  9078. return this.zpp_inner.wrap_includes
  9079. },
  9080. __class__: h.callbacks.OptionType
  9081. };
  9082. h.callbacks.PreCallback = function () {
  9083. h.callbacks.Callback.call(this)
  9084. };
  9085. s["nape.callbacks.PreCallback"] = h.callbacks.PreCallback;
  9086. h.callbacks.PreCallback.__name__ = ["nape", "callbacks", "PreCallback"];
  9087. h.callbacks.PreCallback.__super__ = h.callbacks.Callback;
  9088. h.callbacks.PreCallback.prototype = I(h.callbacks.Callback.prototype, {
  9089. toString: function () {
  9090. var a;
  9091. a = "Cb:PRE:" + (":" + this.zpp_inner.int1.outer_i.toString() + "/" + this.zpp_inner.int2.outer_i.toString());
  9092. a += " : " + this.zpp_inner.pre_arbiter.wrapper().toString();
  9093. return a += " : listnener: " + K.string(this.zpp_inner.listener.outer)
  9094. },
  9095. get_swapped: function () {
  9096. return this.zpp_inner.pre_swapped
  9097. },
  9098. get_int2: function () {
  9099. return this.zpp_inner.int2.outer_i
  9100. },
  9101. get_int1: function () {
  9102. return this.zpp_inner.int1.outer_i
  9103. },
  9104. get_arbiter: function () {
  9105. return this.zpp_inner.pre_arbiter.wrapper()
  9106. },
  9107. __class__: h.callbacks.PreCallback
  9108. });
  9109. h.callbacks.PreFlag = function () {
  9110. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate PreFlag derp!";
  9111. };
  9112. s["nape.callbacks.PreFlag"] = h.callbacks.PreFlag;
  9113. h.callbacks.PreFlag.__name__ = ["nape", "callbacks", "PreFlag"];
  9114. h.callbacks.PreFlag.get_ACCEPT = function () {
  9115. null == c.util.ZPP_Flags.PreFlag_ACCEPT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT =
  9116. new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  9117. return c.util.ZPP_Flags.PreFlag_ACCEPT
  9118. };
  9119. h.callbacks.PreFlag.get_IGNORE = function () {
  9120. null == c.util.ZPP_Flags.PreFlag_IGNORE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  9121. return c.util.ZPP_Flags.PreFlag_IGNORE
  9122. };
  9123. h.callbacks.PreFlag.get_ACCEPT_ONCE = function () {
  9124. null == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE = new h.callbacks.PreFlag,
  9125. c.util.ZPP_Flags.internal = !1);
  9126. return c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE
  9127. };
  9128. h.callbacks.PreFlag.get_IGNORE_ONCE = function () {
  9129. null == c.util.ZPP_Flags.PreFlag_IGNORE_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  9130. return c.util.ZPP_Flags.PreFlag_IGNORE_ONCE
  9131. };
  9132. h.callbacks.PreFlag.prototype = {
  9133. toString: function () {
  9134. var a;
  9135. null == c.util.ZPP_Flags.PreFlag_ACCEPT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT = new h.callbacks.PreFlag,
  9136. c.util.ZPP_Flags.internal = !1);
  9137. this == c.util.ZPP_Flags.PreFlag_ACCEPT ? a = "ACCEPT" : (null == c.util.ZPP_Flags.PreFlag_IGNORE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.PreFlag_IGNORE ? a = "IGNORE" : (null == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE ? a = "ACCEPT_ONCE" :
  9138. (null == c.util.ZPP_Flags.PreFlag_IGNORE_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.PreFlag_IGNORE_ONCE ? "IGNORE_ONCE" : "")));
  9139. return a
  9140. },
  9141. __class__: h.callbacks.PreFlag
  9142. };
  9143. h.callbacks.PreListener = function (a, b, d, g, e, f) {
  9144. null == f && (f = !1);
  9145. null == e && (e = 0);
  9146. this.zpp_inner_zn = null;
  9147. c.callbacks.ZPP_Listener.internal = !0;
  9148. h.callbacks.Listener.call(this);
  9149. c.callbacks.ZPP_Listener.internal = !1;
  9150. if (null == g) throw "Error: PreListener must take a handler!";
  9151. this.zpp_inner = this.zpp_inner_zn = new c.callbacks.ZPP_InteractionListener(c.callbacks.ZPP_OptionType.argument(b), c.callbacks.ZPP_OptionType.argument(d), c.util.ZPP_Flags.id_CbEvent_PRE, c.util.ZPP_Flags.id_ListenerType_PRE);
  9152. this.zpp_inner.outer = this;
  9153. this.zpp_inner_zn.outer_znp = this;
  9154. this.zpp_inner.precedence = e;
  9155. this.zpp_inner_zn.pure = f;
  9156. this.zpp_inner_zn.handlerp = g;
  9157. this.set_interactionType(a)
  9158. };
  9159. s["nape.callbacks.PreListener"] = h.callbacks.PreListener;
  9160. h.callbacks.PreListener.__name__ = ["nape", "callbacks", "PreListener"];
  9161. h.callbacks.PreListener.__super__ = h.callbacks.Listener;
  9162. h.callbacks.PreListener.prototype = I(h.callbacks.Listener.prototype, {
  9163. set_interactionType: function (a) {
  9164. if (null == a) throw "Error: Cannot set listener interaction type to null";
  9165. this.get_interactionType() != a && (null == c.util.ZPP_Flags.InteractionType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.InteractionType_COLLISION ? a = c.util.ZPP_Flags.id_InteractionType_COLLISION :
  9166. (null == c.util.ZPP_Flags.InteractionType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.InteractionType_SENSOR ? a = c.util.ZPP_Flags.id_InteractionType_SENSOR : (null == c.util.ZPP_Flags.InteractionType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_FLUID = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = a == c.util.ZPP_Flags.InteractionType_FLUID ? c.util.ZPP_Flags.id_InteractionType_FLUID :
  9167. c.util.ZPP_Flags.id_InteractionType_ANY)), this.zpp_inner_zn.itype = a);
  9168. return this.get_interactionType()
  9169. },
  9170. get_interactionType: function () {
  9171. var a = this.zpp_inner_zn.itype;
  9172. a == c.util.ZPP_Flags.id_InteractionType_COLLISION ? (null == c.util.ZPP_Flags.InteractionType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_COLLISION) : a == c.util.ZPP_Flags.id_InteractionType_SENSOR ? (null == c.util.ZPP_Flags.InteractionType_SENSOR &&
  9173. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_SENSOR) : a == c.util.ZPP_Flags.id_InteractionType_FLUID ? (null == c.util.ZPP_Flags.InteractionType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_FLUID = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_FLUID) : a == c.util.ZPP_Flags.id_InteractionType_ANY ? (null == c.util.ZPP_Flags.InteractionType_ANY &&
  9174. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_ANY = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.InteractionType_ANY) : a = null;
  9175. return a
  9176. },
  9177. set_pure: function (a) {
  9178. a || this.zpp_inner_zn.wake();
  9179. this.zpp_inner_zn.pure = a;
  9180. return this.zpp_inner_zn.pure
  9181. },
  9182. get_pure: function () {
  9183. return this.zpp_inner_zn.pure
  9184. },
  9185. set_handler: function (a) {
  9186. if (null == a) throw "Error: PreListener must take a non-null handler!";
  9187. this.zpp_inner_zn.handlerp = a;
  9188. this.zpp_inner_zn.wake();
  9189. return this.zpp_inner_zn.handlerp
  9190. },
  9191. get_handler: function () {
  9192. return this.zpp_inner_zn.handlerp
  9193. },
  9194. set_options2: function (a) {
  9195. this.zpp_inner_zn.options2.set(a.zpp_inner);
  9196. return this.zpp_inner_zn.options2.outer
  9197. },
  9198. get_options2: function () {
  9199. return this.zpp_inner_zn.options2.outer
  9200. },
  9201. set_options1: function (a) {
  9202. this.zpp_inner_zn.options1.set(a.zpp_inner);
  9203. return this.zpp_inner_zn.options1.outer
  9204. },
  9205. get_options1: function () {
  9206. return this.zpp_inner_zn.options1.outer
  9207. },
  9208. __class__: h.callbacks.PreListener
  9209. });
  9210. h.constraint = {};
  9211. h.constraint.Constraint = function () {
  9212. this.debugDraw = !0;
  9213. this.zpp_inner.insert_cbtype(c.callbacks.ZPP_CbType.ANY_CONSTRAINT.zpp_inner);
  9214. throw "Error: Constraint cannot be instantiated derp!";
  9215. };
  9216. s["nape.constraint.Constraint"] = h.constraint.Constraint;
  9217. h.constraint.Constraint.__name__ = ["nape", "constraint", "Constraint"];
  9218. h.constraint.Constraint.prototype = {
  9219. copy: function () {
  9220. return this.zpp_inner.copy()
  9221. },
  9222. toString: function () {
  9223. return "{Constraint}"
  9224. },
  9225. get_cbTypes: function () {
  9226. null == this.zpp_inner.wrap_cbTypes && this.zpp_inner.setupcbTypes();
  9227. return this.zpp_inner.wrap_cbTypes
  9228. },
  9229. visitBodies: function (a) {},
  9230. bodyImpulse: function (a) {
  9231. return null
  9232. },
  9233. impulse: function () {
  9234. return null
  9235. },
  9236. set_removeOnBreak: function (a) {
  9237. this.zpp_inner.removeOnBreak = a;
  9238. return this.zpp_inner.removeOnBreak
  9239. },
  9240. get_removeOnBreak: function () {
  9241. return this.zpp_inner.removeOnBreak
  9242. },
  9243. set_breakUnderError: function (a) {
  9244. this.zpp_inner.breakUnderError != a && (this.zpp_inner.breakUnderError = a, this.zpp_inner.wake());
  9245. return this.zpp_inner.breakUnderError
  9246. },
  9247. get_breakUnderError: function () {
  9248. return this.zpp_inner.breakUnderError
  9249. },
  9250. set_breakUnderForce: function (a) {
  9251. this.zpp_inner.breakUnderForce !=
  9252. a && (this.zpp_inner.breakUnderForce = a, this.zpp_inner.wake());
  9253. return this.zpp_inner.breakUnderForce
  9254. },
  9255. get_breakUnderForce: function () {
  9256. return this.zpp_inner.breakUnderForce
  9257. },
  9258. set_maxError: function (a) {
  9259. if (a != a) throw "Error: Constraint::maxError cannot be NaN";
  9260. if (0 > a) throw "Error: Constraint::maxError must be >=0";
  9261. this.zpp_inner.maxError != a && (this.zpp_inner.maxError = a, this.zpp_inner.wake());
  9262. return this.zpp_inner.maxError
  9263. },
  9264. get_maxError: function () {
  9265. return this.zpp_inner.maxError
  9266. },
  9267. set_maxForce: function (a) {
  9268. if (a !=
  9269. a) throw "Error: Constraint::maxForce cannot be NaN";
  9270. if (0 > a) throw "Error: Constraint::maxForce must be >=0";
  9271. this.zpp_inner.maxForce != a && (this.zpp_inner.maxForce = a, this.zpp_inner.wake());
  9272. return this.zpp_inner.maxForce
  9273. },
  9274. get_maxForce: function () {
  9275. return this.zpp_inner.maxForce
  9276. },
  9277. set_damping: function (a) {
  9278. if (a != a) throw "Error: Constraint::Damping cannot be Nan";
  9279. if (0 > a) throw "Error: Constraint::Damping must be >=0";
  9280. this.zpp_inner.damping != a && (this.zpp_inner.damping = a, this.zpp_inner.stiff || this.zpp_inner.wake());
  9281. return this.zpp_inner.damping
  9282. },
  9283. get_damping: function () {
  9284. return this.zpp_inner.damping
  9285. },
  9286. set_frequency: function (a) {
  9287. if (a != a) throw "Error: Constraint::Frequency cannot be NaN";
  9288. if (0 >= a) throw "Error: Constraint::Frequency must be >0";
  9289. this.zpp_inner.frequency != a && (this.zpp_inner.frequency = a, this.zpp_inner.stiff || this.zpp_inner.wake());
  9290. return this.zpp_inner.frequency
  9291. },
  9292. get_frequency: function () {
  9293. return this.zpp_inner.frequency
  9294. },
  9295. set_stiff: function (a) {
  9296. this.zpp_inner.stiff != a && (this.zpp_inner.stiff = a, this.zpp_inner.wake());
  9297. return this.zpp_inner.stiff
  9298. },
  9299. get_stiff: function () {
  9300. return this.zpp_inner.stiff
  9301. },
  9302. set_ignore: function (a) {
  9303. this.zpp_inner.ignore != a && (this.zpp_inner.ignore = a, this.zpp_inner.wake());
  9304. return this.zpp_inner.ignore
  9305. },
  9306. get_ignore: function () {
  9307. return this.zpp_inner.ignore
  9308. },
  9309. set_active: function (a) {
  9310. this.zpp_inner.active != a && (null != this.zpp_inner.component && (this.zpp_inner.component.woken = !1), this.zpp_inner.clearcache(), a ? (this.zpp_inner.active = a, this.zpp_inner.activate(), null != this.zpp_inner.space && (null != this.zpp_inner.component &&
  9311. (this.zpp_inner.component.sleeping = !0), this.zpp_inner.space.wake_constraint(this.zpp_inner, !0))) : (null != this.zpp_inner.space && (this.zpp_inner.wake(), this.zpp_inner.space.live_constraints.remove(this.zpp_inner)), this.zpp_inner.active = a, this.zpp_inner.deactivate()));
  9312. return this.zpp_inner.active
  9313. },
  9314. get_active: function () {
  9315. return this.zpp_inner.active
  9316. },
  9317. get_isSleeping: function () {
  9318. if (null == this.zpp_inner.space || !this.zpp_inner.active) throw "Error: isSleeping only makes sense if constraint is active and inside a space";
  9319. return this.zpp_inner.component.sleeping
  9320. },
  9321. set_space: function (a) {
  9322. if (null != this.zpp_inner.compound) throw "Error: Cannot set the space of a Constraint belonging to a Compound, only the root Compound space can be set";
  9323. (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) != a && (null != this.zpp_inner.component && (this.zpp_inner.component.woken = !1), this.zpp_inner.clearcache(), null != this.zpp_inner.space && this.zpp_inner.space.outer.zpp_inner.wrap_constraints.remove(this), null != a ? a.zpp_inner.wrap_constraints.add(this) :
  9324. this.zpp_inner.space = null);
  9325. return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
  9326. },
  9327. get_space: function () {
  9328. return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
  9329. },
  9330. set_compound: function (a) {
  9331. (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer) != a && (null != (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer) && (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer).zpp_inner.wrap_constraints.remove(this), null != a && a.zpp_inner.wrap_constraints.add(this));
  9332. return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
  9333. },
  9334. get_compound: function () {
  9335. return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
  9336. },
  9337. get_userData: function () {
  9338. null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
  9339. return this.zpp_inner.userData
  9340. },
  9341. __class__: h.constraint.Constraint
  9342. };
  9343. h.constraint.AngleJoint = function (a, b, d, g, e) {
  9344. null == e && (e = 1);
  9345. this.zpp_inner_zn = null;
  9346. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_AngleJoint;
  9347. this.zpp_inner.outer = this;
  9348. this.zpp_inner_zn.outer_zn =
  9349. this;
  9350. try {
  9351. h.constraint.Constraint.call(this)
  9352. } catch (f) {}
  9353. this.set_body1(a);
  9354. this.set_body2(b);
  9355. this.zpp_inner.immutable_midstep("AngleJoint::jointMin");
  9356. if (d != d) throw "Error: AngleJoint::jointMin cannot be NaN";
  9357. this.zpp_inner_zn.jointMin != d && (this.zpp_inner_zn.jointMin = d, this.zpp_inner.wake());
  9358. this.zpp_inner_zn.jointMin;
  9359. this.zpp_inner.immutable_midstep("AngleJoint::jointMax");
  9360. if (g != g) throw "Error: AngleJoint::jointMax cannot be NaN";
  9361. this.zpp_inner_zn.jointMax != g && (this.zpp_inner_zn.jointMax = g, this.zpp_inner.wake());
  9362. this.zpp_inner_zn.jointMax;
  9363. this.zpp_inner.immutable_midstep("AngleJoint::ratio");
  9364. if (e != e) throw "Error: AngleJoint::ratio cannot be NaN";
  9365. this.zpp_inner_zn.ratio != e && (this.zpp_inner_zn.ratio = e, this.zpp_inner.wake());
  9366. this.zpp_inner_zn.ratio
  9367. };
  9368. s["nape.constraint.AngleJoint"] = h.constraint.AngleJoint;
  9369. h.constraint.AngleJoint.__name__ = ["nape", "constraint", "AngleJoint"];
  9370. h.constraint.AngleJoint.__super__ = h.constraint.Constraint;
  9371. h.constraint.AngleJoint.prototype = I(h.constraint.Constraint.prototype, {
  9372. visitBodies: function (a) {
  9373. if (null ==
  9374. a) throw "Error: Cannot apply null lambda to bodies";
  9375. null != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer);
  9376. null != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)
  9377. },
  9378. bodyImpulse: function (a) {
  9379. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  9380. if (a != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)) throw "Error: Body is not linked to this constraint";
  9381. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get(0, 0, 0)
  9382. },
  9383. impulse: function () {
  9384. var a = new h.geom.MatMN(1, 1);
  9385. if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  9386. a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
  9387. return a
  9388. },
  9389. isSlack: function () {
  9390. if (null == (null ==
  9391. this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) || null == (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)) throw "Error: Cannot compute slack for AngleJoint if either body is null.";
  9392. return this.zpp_inner_zn.is_slack()
  9393. },
  9394. set_ratio: function (a) {
  9395. this.zpp_inner.immutable_midstep("AngleJoint::ratio");
  9396. if (a != a) throw "Error: AngleJoint::ratio cannot be NaN";
  9397. this.zpp_inner_zn.ratio != a && (this.zpp_inner_zn.ratio = a, this.zpp_inner.wake());
  9398. return this.zpp_inner_zn.ratio
  9399. },
  9400. get_ratio: function () {
  9401. return this.zpp_inner_zn.ratio
  9402. },
  9403. set_jointMax: function (a) {
  9404. this.zpp_inner.immutable_midstep("AngleJoint::jointMax");
  9405. if (a != a) throw "Error: AngleJoint::jointMax cannot be NaN";
  9406. this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
  9407. return this.zpp_inner_zn.jointMax
  9408. },
  9409. get_jointMax: function () {
  9410. return this.zpp_inner_zn.jointMax
  9411. },
  9412. set_jointMin: function (a) {
  9413. this.zpp_inner.immutable_midstep("AngleJoint::jointMin");
  9414. if (a != a) throw "Error: AngleJoint::jointMin cannot be NaN";
  9415. this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin =
  9416. a, this.zpp_inner.wake());
  9417. return this.zpp_inner_zn.jointMin
  9418. },
  9419. get_jointMin: function () {
  9420. return this.zpp_inner_zn.jointMin
  9421. },
  9422. set_body2: function (a) {
  9423. this.zpp_inner.immutable_midstep("Constraint::body2");
  9424. a = null == a ? null : a.zpp_inner;
  9425. a != this.zpp_inner_zn.b2 && (null != this.zpp_inner_zn.b2 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 != this.zpp_inner_zn.b2 && null != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b2.constraints.remove(this.zpp_inner), this.zpp_inner.active && null !=
  9426. (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2.wake()), this.zpp_inner_zn.b2 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  9427. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  9428. },
  9429. get_body2: function () {
  9430. return null == this.zpp_inner_zn.b2 ?
  9431. null : this.zpp_inner_zn.b2.outer
  9432. },
  9433. set_body1: function (a) {
  9434. this.zpp_inner.immutable_midstep("Constraint::body1");
  9435. a = null == a ? null : a.zpp_inner;
  9436. a != this.zpp_inner_zn.b1 && (null != this.zpp_inner_zn.b1 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2 != this.zpp_inner_zn.b1 && null != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b1.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1.wake()),
  9437. this.zpp_inner_zn.b1 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b2 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  9438. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  9439. },
  9440. get_body1: function () {
  9441. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  9442. },
  9443. __class__: h.constraint.AngleJoint
  9444. });
  9445. h.constraint.ConstraintIterator =
  9446. function () {
  9447. this.zpp_next = null;
  9448. this.zpp_critical = !1;
  9449. this.zpp_i = 0;
  9450. this.zpp_inner = null;
  9451. if (!c.util.ZPP_ConstraintList.internal) throw "Error: Cannot instantiate ConstraintIterator derp!";
  9452. };
  9453. s["nape.constraint.ConstraintIterator"] = h.constraint.ConstraintIterator;
  9454. h.constraint.ConstraintIterator.__name__ = ["nape", "constraint", "ConstraintIterator"];
  9455. h.constraint.ConstraintIterator.get = function (a) {
  9456. var b = null == h.constraint.ConstraintIterator.zpp_pool ? function (a) {
  9457. c.util.ZPP_ConstraintList.internal = !0;
  9458. a = new h.constraint.ConstraintIterator;
  9459. c.util.ZPP_ConstraintList.internal = !1;
  9460. return a
  9461. }(this) : function (a) {
  9462. a = h.constraint.ConstraintIterator.zpp_pool;
  9463. h.constraint.ConstraintIterator.zpp_pool = a.zpp_next;
  9464. return a
  9465. }(this);
  9466. b.zpp_i = 0;
  9467. b.zpp_inner = a;
  9468. b.zpp_critical = !1;
  9469. return b
  9470. };
  9471. h.constraint.ConstraintIterator.prototype = {
  9472. next: function () {
  9473. this.zpp_critical = !1;
  9474. return this.zpp_inner.at(this.zpp_i++)
  9475. },
  9476. hasNext: function () {
  9477. this.zpp_inner.zpp_inner.valmod();
  9478. var a = this.zpp_inner.get_length();
  9479. this.zpp_critical = !0;
  9480. if (this.zpp_i < a) return !0;
  9481. this.zpp_next = h.constraint.ConstraintIterator.zpp_pool;
  9482. h.constraint.ConstraintIterator.zpp_pool = this;
  9483. this.zpp_inner = null;
  9484. return !1
  9485. },
  9486. __class__: h.constraint.ConstraintIterator
  9487. };
  9488. h.constraint.ConstraintList = function () {
  9489. this.zpp_inner = null;
  9490. this.zpp_inner = new c.util.ZPP_ConstraintList;
  9491. this.zpp_inner.outer = this
  9492. };
  9493. s["nape.constraint.ConstraintList"] = h.constraint.ConstraintList;
  9494. h.constraint.ConstraintList.__name__ = ["nape", "constraint", "ConstraintList"];
  9495. h.constraint.ConstraintList.fromArray = function (a) {
  9496. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  9497. for (var b = new h.constraint.ConstraintList, d = 0; d < a.length;) {
  9498. var c = a[d];
  9499. ++d;
  9500. b.push(c)
  9501. }
  9502. return b
  9503. };
  9504. h.constraint.ConstraintList.prototype = {
  9505. filter: function (a) {
  9506. if (null == a) throw "Error: Cannot select elements of list with null";
  9507. for (var b = 0; b < this.get_length();) {
  9508. var d = this.at(b);
  9509. try {
  9510. a(d) ? b++ : this.remove(d)
  9511. } catch (c) {
  9512. break
  9513. }
  9514. }
  9515. return this
  9516. },
  9517. foreach: function (a) {
  9518. if (null == a) throw "Error: Cannot execute null on list elements";
  9519. var b;
  9520. this.zpp_inner.valmod();
  9521. for (b = h.constraint.ConstraintIterator.get(this); b.hasNext();) try {
  9522. var d =
  9523. a,
  9524. c;
  9525. b.zpp_critical = !1;
  9526. c = b.zpp_inner.at(b.zpp_i++);
  9527. d(c)
  9528. } catch (e) {
  9529. b.zpp_next = h.constraint.ConstraintIterator.zpp_pool;
  9530. h.constraint.ConstraintIterator.zpp_pool = b;
  9531. b.zpp_inner = null;
  9532. break
  9533. }
  9534. return this
  9535. },
  9536. toString: function () {
  9537. var a = "[",
  9538. b = !0,
  9539. d;
  9540. this.zpp_inner.valmod();
  9541. for (d = h.constraint.ConstraintIterator.get(this); d.hasNext();) {
  9542. var c = d.next();
  9543. b || (a += ",");
  9544. a += null == c ? "NULL" : c.toString();
  9545. b = !1
  9546. }
  9547. return a + "]"
  9548. },
  9549. merge: function (a) {
  9550. if (null == a) throw "Error: Cannot merge with null list";
  9551. a.zpp_inner.valmod();
  9552. for (a = h.constraint.ConstraintIterator.get(a); a.hasNext();) {
  9553. var b =
  9554. a.next();
  9555. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  9556. }
  9557. },
  9558. copy: function (a) {
  9559. null == a && (a = !1);
  9560. var b = new h.constraint.ConstraintList,
  9561. d;
  9562. this.zpp_inner.valmod();
  9563. for (d = h.constraint.ConstraintIterator.get(this); d.hasNext();) {
  9564. var c = d.next();
  9565. b.push(a ? function (a) {
  9566. throw "Error: Constraint is not a copyable type";
  9567. }(this) : c)
  9568. }
  9569. return b
  9570. },
  9571. iterator: function () {
  9572. this.zpp_inner.valmod();
  9573. return h.constraint.ConstraintIterator.get(this)
  9574. },
  9575. empty: function () {
  9576. return null == this.zpp_inner.inner.head
  9577. },
  9578. clear: function () {
  9579. if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
  9580. if (this.zpp_inner.reverse_flag)
  9581. for (; null != this.zpp_inner.inner.head;) this.pop();
  9582. else
  9583. for (; null != this.zpp_inner.inner.head;) this.shift()
  9584. },
  9585. remove: function (a) {
  9586. if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
  9587. this.zpp_inner.modify_test();
  9588. this.zpp_inner.valmod();
  9589. var b;
  9590. b = !1;
  9591. for (var d = this.zpp_inner.inner.head; null != d;) {
  9592. if (d.elt == a.zpp_inner) {
  9593. b = !0;
  9594. break
  9595. }
  9596. d = d.next
  9597. }
  9598. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner),
  9599. this.zpp_inner.invalidate());
  9600. return b
  9601. },
  9602. add: function (a) {
  9603. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  9604. },
  9605. shift: function () {
  9606. if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
  9607. this.zpp_inner.modify_test();
  9608. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  9609. this.zpp_inner.valmod();
  9610. var a = null;
  9611. if (this.zpp_inner.reverse_flag) {
  9612. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  9613. var b = 1 == this.get_length() ?
  9614. null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  9615. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  9616. d = a.outer;
  9617. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  9618. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  9619. } else a = this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  9620. this.zpp_inner.invalidate();
  9621. return d = a.outer
  9622. },
  9623. pop: function () {
  9624. if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
  9625. this.zpp_inner.modify_test();
  9626. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  9627. this.zpp_inner.valmod();
  9628. var a = null;
  9629. if (this.zpp_inner.reverse_flag) {
  9630. var a = this.zpp_inner.inner.head.elt,
  9631. b = a.outer;
  9632. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  9633. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  9634. } else {
  9635. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  9636. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
  9637. 2),
  9638. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  9639. b = a.outer;
  9640. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  9641. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  9642. }
  9643. this.zpp_inner.invalidate();
  9644. return b = a.outer
  9645. },
  9646. unshift: function (a) {
  9647. if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
  9648. this.zpp_inner.modify_test();
  9649. this.zpp_inner.valmod();
  9650. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  9651. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite =
  9652. null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  9653. return b
  9654. },
  9655. push: function (a) {
  9656. if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
  9657. this.zpp_inner.modify_test();
  9658. this.zpp_inner.valmod();
  9659. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
  9660. !0;
  9661. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  9662. return b
  9663. },
  9664. at: function (a) {
  9665. this.zpp_inner.valmod();
  9666. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  9667. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  9668. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  9669. else
  9670. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  9671. return this.zpp_inner.at_ite.elt.outer
  9672. },
  9673. has: function (a) {
  9674. this.zpp_inner.valmod();
  9675. return this.zpp_inner.inner.has(a.zpp_inner)
  9676. },
  9677. get_length: function () {
  9678. this.zpp_inner.valmod();
  9679. this.zpp_inner.zip_length &&
  9680. (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  9681. return this.zpp_inner.user_length
  9682. },
  9683. __class__: h.constraint.ConstraintList
  9684. };
  9685. h.constraint.DistanceJoint = function (a, b, d, g, e, f) {
  9686. this.zpp_inner_zn = null;
  9687. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_DistanceJoint;
  9688. this.zpp_inner.outer = this;
  9689. this.zpp_inner_zn.outer_zn = this;
  9690. try {
  9691. h.constraint.Constraint.call(this)
  9692. } catch (l) {}
  9693. this.set_body1(a);
  9694. this.set_body2(b);
  9695. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9696. if (null == d) throw "Error: Constraint::anchor1 cannot be null";
  9697. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9698. this.zpp_inner_zn.wrap_a1.set(d);
  9699. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9700. this.zpp_inner_zn.wrap_a1;
  9701. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9702. if (null == g) throw "Error: Constraint::anchor2 cannot be null";
  9703. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9704. this.zpp_inner_zn.wrap_a2.set(g);
  9705. null == this.zpp_inner_zn.wrap_a2 &&
  9706. this.zpp_inner_zn.setup_a2();
  9707. this.zpp_inner_zn.wrap_a2;
  9708. this.zpp_inner.immutable_midstep("DistanceJoint::jointMin");
  9709. if (e != e) throw "Error: DistanceJoint::jointMin cannot be NaN";
  9710. if (0 > e) throw "Error: DistanceJoint::jointMin must be >= 0";
  9711. this.zpp_inner_zn.jointMin != e && (this.zpp_inner_zn.jointMin = e, this.zpp_inner.wake());
  9712. this.zpp_inner_zn.jointMin;
  9713. this.zpp_inner.immutable_midstep("DistanceJoint::jointMax");
  9714. if (f != f) throw "Error: DistanceJoint::jointMax cannot be NaN";
  9715. if (0 > f) throw "Error: DistanceJoint::jointMax must be >= 0";
  9716. this.zpp_inner_zn.jointMax != f && (this.zpp_inner_zn.jointMax = f, this.zpp_inner.wake());
  9717. this.zpp_inner_zn.jointMax
  9718. };
  9719. s["nape.constraint.DistanceJoint"] = h.constraint.DistanceJoint;
  9720. h.constraint.DistanceJoint.__name__ = ["nape", "constraint", "DistanceJoint"];
  9721. h.constraint.DistanceJoint.__super__ = h.constraint.Constraint;
  9722. h.constraint.DistanceJoint.prototype = I(h.constraint.Constraint.prototype, {
  9723. visitBodies: function (a) {
  9724. null != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b1 ?
  9725. null : this.zpp_inner_zn.b1.outer);
  9726. null != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)
  9727. },
  9728. bodyImpulse: function (a) {
  9729. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  9730. if (a != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)) throw "Error: Body is not linked to this constraint";
  9731. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
  9732. },
  9733. impulse: function () {
  9734. var a = new h.geom.MatMN(1, 1);
  9735. if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  9736. a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
  9737. return a
  9738. },
  9739. isSlack: function () {
  9740. if (null == (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) || null == (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)) throw "Error: Cannot compute slack for DistanceJoint if either body is null.";
  9741. return this.zpp_inner_zn.slack
  9742. },
  9743. set_jointMax: function (a) {
  9744. this.zpp_inner.immutable_midstep("DistanceJoint::jointMax");
  9745. if (a != a) throw "Error: DistanceJoint::jointMax cannot be NaN";
  9746. if (0 > a) throw "Error: DistanceJoint::jointMax must be >= 0";
  9747. this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
  9748. return this.zpp_inner_zn.jointMax
  9749. },
  9750. get_jointMax: function () {
  9751. return this.zpp_inner_zn.jointMax
  9752. },
  9753. set_jointMin: function (a) {
  9754. this.zpp_inner.immutable_midstep("DistanceJoint::jointMin");
  9755. if (a !=
  9756. a) throw "Error: DistanceJoint::jointMin cannot be NaN";
  9757. if (0 > a) throw "Error: DistanceJoint::jointMin must be >= 0";
  9758. this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin = a, this.zpp_inner.wake());
  9759. return this.zpp_inner_zn.jointMin
  9760. },
  9761. get_jointMin: function () {
  9762. return this.zpp_inner_zn.jointMin
  9763. },
  9764. set_anchor2: function (a) {
  9765. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9766. if (null == a) throw "Error: Constraint::anchor2 cannot be null";
  9767. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9768. this.zpp_inner_zn.wrap_a2.set(a);
  9769. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9770. return this.zpp_inner_zn.wrap_a2
  9771. },
  9772. get_anchor2: function () {
  9773. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9774. return this.zpp_inner_zn.wrap_a2
  9775. },
  9776. set_anchor1: function (a) {
  9777. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9778. if (null == a) throw "Error: Constraint::anchor1 cannot be null";
  9779. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9780. this.zpp_inner_zn.wrap_a1.set(a);
  9781. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9782. return this.zpp_inner_zn.wrap_a1
  9783. },
  9784. get_anchor1: function () {
  9785. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9786. return this.zpp_inner_zn.wrap_a1
  9787. },
  9788. set_body2: function (a) {
  9789. this.zpp_inner.immutable_midstep("Constraint::body2");
  9790. a = null == a ? null : a.zpp_inner;
  9791. a != this.zpp_inner_zn.b2 && (null != this.zpp_inner_zn.b2 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 != this.zpp_inner_zn.b2 && null != this.zpp_inner_zn.b2 &&
  9792. this.zpp_inner_zn.b2.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2.wake()), this.zpp_inner_zn.b2 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  9793. return null == this.zpp_inner_zn.b2 ?
  9794. null : this.zpp_inner_zn.b2.outer
  9795. },
  9796. get_body2: function () {
  9797. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  9798. },
  9799. set_body1: function (a) {
  9800. this.zpp_inner.immutable_midstep("Constraint::body1");
  9801. a = null == a ? null : a.zpp_inner;
  9802. a != this.zpp_inner_zn.b1 && (null != this.zpp_inner_zn.b1 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2 != this.zpp_inner_zn.b1 && null != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b1.constraints.remove(this.zpp_inner), this.zpp_inner.active && null !=
  9803. (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1.wake()), this.zpp_inner_zn.b1 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b2 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  9804. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  9805. },
  9806. get_body1: function () {
  9807. return null == this.zpp_inner_zn.b1 ?
  9808. null : this.zpp_inner_zn.b1.outer
  9809. },
  9810. __class__: h.constraint.DistanceJoint
  9811. });
  9812. h.constraint.LineJoint = function (a, b, d, g, e, f, l) {
  9813. this.zpp_inner_zn = null;
  9814. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_LineJoint;
  9815. this.zpp_inner.outer = this;
  9816. this.zpp_inner_zn.outer_zn = this;
  9817. try {
  9818. h.constraint.Constraint.call(this)
  9819. } catch (m) {}
  9820. this.set_body1(a);
  9821. this.set_body2(b);
  9822. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9823. if (null == d) throw "Error: Constraint::anchor1 cannot be null";
  9824. null == this.zpp_inner_zn.wrap_a1 &&
  9825. this.zpp_inner_zn.setup_a1();
  9826. this.zpp_inner_zn.wrap_a1.set(d);
  9827. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9828. this.zpp_inner_zn.wrap_a1;
  9829. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9830. if (null == g) throw "Error: Constraint::anchor2 cannot be null";
  9831. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9832. this.zpp_inner_zn.wrap_a2.set(g);
  9833. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9834. this.zpp_inner_zn.wrap_a2;
  9835. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9836. if (null == e) throw "Error: Constraint::direction cannot be null";
  9837. null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
  9838. this.zpp_inner_zn.wrap_n.set(e);
  9839. null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
  9840. this.zpp_inner_zn.wrap_n;
  9841. this.zpp_inner.immutable_midstep("LineJoint::jointMin");
  9842. if (f != f) throw "Error: AngleJoint::jointMin cannot be NaN";
  9843. this.zpp_inner_zn.jointMin != f && (this.zpp_inner_zn.jointMin = f, this.zpp_inner.wake());
  9844. this.zpp_inner_zn.jointMin;
  9845. this.zpp_inner.immutable_midstep("LineJoint::jointMax");
  9846. if (l != l) throw "Error: AngleJoint::jointMax cannot be NaN";
  9847. this.zpp_inner_zn.jointMax != l && (this.zpp_inner_zn.jointMax = l, this.zpp_inner.wake());
  9848. this.zpp_inner_zn.jointMax
  9849. };
  9850. s["nape.constraint.LineJoint"] = h.constraint.LineJoint;
  9851. h.constraint.LineJoint.__name__ = ["nape", "constraint", "LineJoint"];
  9852. h.constraint.LineJoint.__super__ = h.constraint.Constraint;
  9853. h.constraint.LineJoint.prototype = I(h.constraint.Constraint.prototype, {
  9854. visitBodies: function (a) {
  9855. null != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) &&
  9856. a(null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer);
  9857. null != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)
  9858. },
  9859. bodyImpulse: function (a) {
  9860. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  9861. if (a != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a != (null == this.zpp_inner_zn.b2 ?
  9862. null : this.zpp_inner_zn.b2.outer)) throw "Error: Body is not linked to this constraint";
  9863. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
  9864. },
  9865. impulse: function () {
  9866. var a = new h.geom.MatMN(2, 1);
  9867. if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  9868. a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAccx;
  9869. if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  9870. a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccy;
  9871. return a
  9872. },
  9873. set_jointMax: function (a) {
  9874. this.zpp_inner.immutable_midstep("LineJoint::jointMax");
  9875. if (a != a) throw "Error: AngleJoint::jointMax cannot be NaN";
  9876. this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
  9877. return this.zpp_inner_zn.jointMax
  9878. },
  9879. get_jointMax: function () {
  9880. return this.zpp_inner_zn.jointMax
  9881. },
  9882. set_jointMin: function (a) {
  9883. this.zpp_inner.immutable_midstep("LineJoint::jointMin");
  9884. if (a != a) throw "Error: AngleJoint::jointMin cannot be NaN";
  9885. this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin = a, this.zpp_inner.wake());
  9886. return this.zpp_inner_zn.jointMin
  9887. },
  9888. get_jointMin: function () {
  9889. return this.zpp_inner_zn.jointMin
  9890. },
  9891. set_direction: function (a) {
  9892. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9893. if (null == a) throw "Error: Constraint::direction cannot be null";
  9894. null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
  9895. this.zpp_inner_zn.wrap_n.set(a);
  9896. null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
  9897. return this.zpp_inner_zn.wrap_n
  9898. },
  9899. get_direction: function () {
  9900. null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
  9901. return this.zpp_inner_zn.wrap_n
  9902. },
  9903. set_anchor2: function (a) {
  9904. if (null !=
  9905. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9906. if (null == a) throw "Error: Constraint::anchor2 cannot be null";
  9907. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9908. this.zpp_inner_zn.wrap_a2.set(a);
  9909. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9910. return this.zpp_inner_zn.wrap_a2
  9911. },
  9912. get_anchor2: function () {
  9913. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  9914. return this.zpp_inner_zn.wrap_a2
  9915. },
  9916. set_anchor1: function (a) {
  9917. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  9918. if (null == a) throw "Error: Constraint::anchor1 cannot be null";
  9919. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9920. this.zpp_inner_zn.wrap_a1.set(a);
  9921. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9922. return this.zpp_inner_zn.wrap_a1
  9923. },
  9924. get_anchor1: function () {
  9925. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  9926. return this.zpp_inner_zn.wrap_a1
  9927. },
  9928. set_body2: function (a) {
  9929. this.zpp_inner.immutable_midstep("Constraint::body2");
  9930. a = null == a ? null : a.zpp_inner;
  9931. a != this.zpp_inner_zn.b2 && (null !=
  9932. this.zpp_inner_zn.b2 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 != this.zpp_inner_zn.b2 && null != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b2.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2.wake()), this.zpp_inner_zn.b2 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && null != a && a.constraints.add(this.zpp_inner),
  9933. this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  9934. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  9935. },
  9936. get_body2: function () {
  9937. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  9938. },
  9939. set_body1: function (a) {
  9940. this.zpp_inner.immutable_midstep("Constraint::body1");
  9941. a = null == a ? null : a.zpp_inner;
  9942. a != this.zpp_inner_zn.b1 && (null != this.zpp_inner_zn.b1 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) &&
  9943. this.zpp_inner_zn.b2 != this.zpp_inner_zn.b1 && null != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b1.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1.wake()), this.zpp_inner_zn.b1 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b2 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) &&
  9944. (this.zpp_inner.wake(), null != a && a.wake()));
  9945. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  9946. },
  9947. get_body1: function () {
  9948. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  9949. },
  9950. __class__: h.constraint.LineJoint
  9951. });
  9952. h.constraint.MotorJoint = function (a, b, d, g) {
  9953. null == g && (g = 1);
  9954. null == d && (d = 0);
  9955. this.zpp_inner_zn = null;
  9956. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_MotorJoint;
  9957. this.zpp_inner.outer = this;
  9958. this.zpp_inner_zn.outer_zn = this;
  9959. try {
  9960. h.constraint.Constraint.call(this)
  9961. } catch (e) {}
  9962. this.set_body1(a);
  9963. this.set_body2(b);
  9964. this.zpp_inner.immutable_midstep("MotorJoint::rate");
  9965. if (d != d) throw "Error: MotorJoint::rate cannot be NaN";
  9966. this.zpp_inner_zn.rate != d && (this.zpp_inner_zn.rate = d, this.zpp_inner.wake());
  9967. this.zpp_inner_zn.rate;
  9968. this.zpp_inner.immutable_midstep("MotorJoint::ratio");
  9969. if (g != g) throw "Error: MotorJoint::ratio cannot be NaN";
  9970. this.zpp_inner_zn.ratio != g && (this.zpp_inner_zn.ratio = g, this.zpp_inner.wake());
  9971. this.zpp_inner_zn.ratio
  9972. };
  9973. s["nape.constraint.MotorJoint"] = h.constraint.MotorJoint;
  9974. h.constraint.MotorJoint.__name__ = ["nape", "constraint", "MotorJoint"];
  9975. h.constraint.MotorJoint.__super__ = h.constraint.Constraint;
  9976. h.constraint.MotorJoint.prototype = I(h.constraint.Constraint.prototype, {
  9977. visitBodies: function (a) {
  9978. null != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer);
  9979. null != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) &&
  9980. a(null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)
  9981. },
  9982. bodyImpulse: function (a) {
  9983. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  9984. if (a != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)) throw "Error: Body is not linked to this constraint";
  9985. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
  9986. },
  9987. impulse: function () {
  9988. var a = new h.geom.MatMN(1, 1);
  9989. if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  9990. a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
  9991. return a
  9992. },
  9993. set_rate: function (a) {
  9994. this.zpp_inner.immutable_midstep("MotorJoint::rate");
  9995. if (a != a) throw "Error: MotorJoint::rate cannot be NaN";
  9996. this.zpp_inner_zn.rate != a && (this.zpp_inner_zn.rate = a, this.zpp_inner.wake());
  9997. return this.zpp_inner_zn.rate
  9998. },
  9999. get_rate: function () {
  10000. return this.zpp_inner_zn.rate
  10001. },
  10002. set_ratio: function (a) {
  10003. this.zpp_inner.immutable_midstep("MotorJoint::ratio");
  10004. if (a != a) throw "Error: MotorJoint::ratio cannot be NaN";
  10005. this.zpp_inner_zn.ratio !=
  10006. a && (this.zpp_inner_zn.ratio = a, this.zpp_inner.wake());
  10007. return this.zpp_inner_zn.ratio
  10008. },
  10009. get_ratio: function () {
  10010. return this.zpp_inner_zn.ratio
  10011. },
  10012. set_body2: function (a) {
  10013. this.zpp_inner.immutable_midstep("Constraint::body2");
  10014. a = null == a ? null : a.zpp_inner;
  10015. a != this.zpp_inner_zn.b2 && (null != this.zpp_inner_zn.b2 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 != this.zpp_inner_zn.b2 && null != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b2.constraints.remove(this.zpp_inner), this.zpp_inner.active &&
  10016. null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2.wake()), this.zpp_inner_zn.b2 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10017. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  10018. },
  10019. get_body2: function () {
  10020. return null == this.zpp_inner_zn.b2 ?
  10021. null : this.zpp_inner_zn.b2.outer
  10022. },
  10023. set_body1: function (a) {
  10024. this.zpp_inner.immutable_midstep("Constraint::body1");
  10025. a = null == a ? null : a.zpp_inner;
  10026. a != this.zpp_inner_zn.b1 && (null != this.zpp_inner_zn.b1 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2 != this.zpp_inner_zn.b1 && null != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b1.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1.wake()),
  10027. this.zpp_inner_zn.b1 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b2 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10028. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10029. },
  10030. get_body1: function () {
  10031. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10032. },
  10033. __class__: h.constraint.MotorJoint
  10034. });
  10035. h.constraint.PivotJoint =
  10036. function (a, b, d, g) {
  10037. this.zpp_inner_zn = null;
  10038. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_PivotJoint;
  10039. this.zpp_inner.outer = this;
  10040. this.zpp_inner_zn.outer_zn = this;
  10041. try {
  10042. h.constraint.Constraint.call(this)
  10043. } catch (e) {}
  10044. this.set_body1(a);
  10045. this.set_body2(b);
  10046. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10047. if (null == d) throw "Error: Constraint::anchor1 cannot be null";
  10048. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10049. this.zpp_inner_zn.wrap_a1.set(d);
  10050. null == this.zpp_inner_zn.wrap_a1 &&
  10051. this.zpp_inner_zn.setup_a1();
  10052. this.zpp_inner_zn.wrap_a1;
  10053. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10054. if (null == g) throw "Error: Constraint::anchor2 cannot be null";
  10055. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10056. this.zpp_inner_zn.wrap_a2.set(g);
  10057. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10058. this.zpp_inner_zn.wrap_a2
  10059. };
  10060. s["nape.constraint.PivotJoint"] = h.constraint.PivotJoint;
  10061. h.constraint.PivotJoint.__name__ = ["nape", "constraint", "PivotJoint"];
  10062. h.constraint.PivotJoint.__super__ = h.constraint.Constraint;
  10063. h.constraint.PivotJoint.prototype = I(h.constraint.Constraint.prototype, {
  10064. visitBodies: function (a) {
  10065. null != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer);
  10066. null != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b2 ?
  10067. null : this.zpp_inner_zn.b2.outer)
  10068. },
  10069. bodyImpulse: function (a) {
  10070. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  10071. if (a != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)) throw "Error: Body is not linked to this constraint";
  10072. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
  10073. },
  10074. impulse: function () {
  10075. var a = new h.geom.MatMN(2, 1);
  10076. if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  10077. a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAccx;
  10078. if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  10079. a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccy;
  10080. return a
  10081. },
  10082. set_anchor2: function (a) {
  10083. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10084. if (null == a) throw "Error: Constraint::anchor2 cannot be null";
  10085. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10086. this.zpp_inner_zn.wrap_a2.set(a);
  10087. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10088. return this.zpp_inner_zn.wrap_a2
  10089. },
  10090. get_anchor2: function () {
  10091. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10092. return this.zpp_inner_zn.wrap_a2
  10093. },
  10094. set_anchor1: function (a) {
  10095. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10096. if (null == a) throw "Error: Constraint::anchor1 cannot be null";
  10097. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10098. this.zpp_inner_zn.wrap_a1.set(a);
  10099. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10100. return this.zpp_inner_zn.wrap_a1
  10101. },
  10102. get_anchor1: function () {
  10103. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10104. return this.zpp_inner_zn.wrap_a1
  10105. },
  10106. set_body2: function (a) {
  10107. this.zpp_inner.immutable_midstep("Constraint::body2");
  10108. a = null == a ? null : a.zpp_inner;
  10109. a != this.zpp_inner_zn.b2 && (null != this.zpp_inner_zn.b2 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 != this.zpp_inner_zn.b2 && null != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b2.constraints.remove(this.zpp_inner), this.zpp_inner.active && null !=
  10110. (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2.wake()), this.zpp_inner_zn.b2 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10111. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  10112. },
  10113. get_body2: function () {
  10114. return null == this.zpp_inner_zn.b2 ?
  10115. null : this.zpp_inner_zn.b2.outer
  10116. },
  10117. set_body1: function (a) {
  10118. this.zpp_inner.immutable_midstep("Constraint::body1");
  10119. a = null == a ? null : a.zpp_inner;
  10120. a != this.zpp_inner_zn.b1 && (null != this.zpp_inner_zn.b1 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2 != this.zpp_inner_zn.b1 && null != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b1.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1.wake()),
  10121. this.zpp_inner_zn.b1 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b2 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10122. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10123. },
  10124. get_body1: function () {
  10125. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10126. },
  10127. __class__: h.constraint.PivotJoint
  10128. });
  10129. h.constraint.PulleyJoint =
  10130. function (a, b, d, g, e, f, l, m, u, p, C) {
  10131. null == C && (C = 1);
  10132. this.zpp_inner_zn = null;
  10133. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_PulleyJoint;
  10134. this.zpp_inner.outer = this;
  10135. this.zpp_inner_zn.outer_zn = this;
  10136. try {
  10137. h.constraint.Constraint.call(this)
  10138. } catch (r) {}
  10139. this.set_body1(a);
  10140. this.set_body2(b);
  10141. this.set_body3(d);
  10142. this.set_body4(g);
  10143. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10144. if (null == e) throw "Error: Constraint::anchor1 cannot be null";
  10145. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10146. this.zpp_inner_zn.wrap_a1.set(e);
  10147. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10148. this.zpp_inner_zn.wrap_a1;
  10149. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10150. if (null == f) throw "Error: Constraint::anchor2 cannot be null";
  10151. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10152. this.zpp_inner_zn.wrap_a2.set(f);
  10153. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10154. this.zpp_inner_zn.wrap_a2;
  10155. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10156. if (null == l) throw "Error: Constraint::anchor3 cannot be null";
  10157. null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
  10158. this.zpp_inner_zn.wrap_a3.set(l);
  10159. null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
  10160. this.zpp_inner_zn.wrap_a3;
  10161. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10162. if (null == m) throw "Error: Constraint::anchor4 cannot be null";
  10163. null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
  10164. this.zpp_inner_zn.wrap_a4.set(m);
  10165. null == this.zpp_inner_zn.wrap_a4 &&
  10166. this.zpp_inner_zn.setup_a4();
  10167. this.zpp_inner_zn.wrap_a4;
  10168. this.zpp_inner.immutable_midstep("PulleyJoint::ratio");
  10169. if (C != C) throw "Error: PulleyJoint::ratio cannot be NaN";
  10170. this.zpp_inner_zn.ratio != C && (this.zpp_inner_zn.ratio = C, this.zpp_inner.wake());
  10171. this.zpp_inner_zn.ratio;
  10172. this.zpp_inner.immutable_midstep("PulleyJoint::jointMin");
  10173. if (u != u) throw "Error: PulleyJoint::jointMin cannot be NaN";
  10174. if (0 > u) throw "Error: PulleyJoint::jointMin must be >= 0";
  10175. this.zpp_inner_zn.jointMin != u && (this.zpp_inner_zn.jointMin = u, this.zpp_inner.wake());
  10176. this.zpp_inner_zn.jointMin;
  10177. this.zpp_inner.immutable_midstep("PulleyJoint::jointMax");
  10178. if (p != p) throw "Error: PulleyJoint::jointMax cannot be NaN";
  10179. if (0 > p) throw "Error: PulleyJoint::jointMax must be >= 0";
  10180. this.zpp_inner_zn.jointMax != p && (this.zpp_inner_zn.jointMax = p, this.zpp_inner.wake());
  10181. this.zpp_inner_zn.jointMax
  10182. };
  10183. s["nape.constraint.PulleyJoint"] = h.constraint.PulleyJoint;
  10184. h.constraint.PulleyJoint.__name__ = ["nape", "constraint", "PulleyJoint"];
  10185. h.constraint.PulleyJoint.__super__ = h.constraint.Constraint;
  10186. h.constraint.PulleyJoint.prototype =
  10187. I(h.constraint.Constraint.prototype, {
  10188. visitBodies: function (a) {
  10189. null != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer);
  10190. null != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer);
  10191. null != (null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer) &&
  10192. (null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && (null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer) != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && a(null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer);
  10193. null != (null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer) && (null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) &&
  10194. (null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer) != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer) != (null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer) && a(null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer)
  10195. },
  10196. bodyImpulse: function (a) {
  10197. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  10198. if (a != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a != (null == this.zpp_inner_zn.b2 ? null :
  10199. this.zpp_inner_zn.b2.outer) && a != (null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer) && a != (null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer)) throw "Error: Body is not linked to this constraint";
  10200. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
  10201. },
  10202. impulse: function () {
  10203. var a = new h.geom.MatMN(1, 1);
  10204. if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  10205. a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
  10206. return a
  10207. },
  10208. isSlack: function () {
  10209. if (null ==
  10210. (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) || null == (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) || null == (null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer) || null == (null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer)) throw "Error: Cannot compute slack for PulleyJoint if either body is null.";
  10211. return this.zpp_inner_zn.slack
  10212. },
  10213. set_ratio: function (a) {
  10214. this.zpp_inner.immutable_midstep("PulleyJoint::ratio");
  10215. if (a != a) throw "Error: PulleyJoint::ratio cannot be NaN";
  10216. this.zpp_inner_zn.ratio != a && (this.zpp_inner_zn.ratio = a, this.zpp_inner.wake());
  10217. return this.zpp_inner_zn.ratio
  10218. },
  10219. get_ratio: function () {
  10220. return this.zpp_inner_zn.ratio
  10221. },
  10222. set_jointMax: function (a) {
  10223. this.zpp_inner.immutable_midstep("PulleyJoint::jointMax");
  10224. if (a != a) throw "Error: PulleyJoint::jointMax cannot be NaN";
  10225. if (0 > a) throw "Error: PulleyJoint::jointMax must be >= 0";
  10226. this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
  10227. return this.zpp_inner_zn.jointMax
  10228. },
  10229. get_jointMax: function () {
  10230. return this.zpp_inner_zn.jointMax
  10231. },
  10232. set_jointMin: function (a) {
  10233. this.zpp_inner.immutable_midstep("PulleyJoint::jointMin");
  10234. if (a != a) throw "Error: PulleyJoint::jointMin cannot be NaN";
  10235. if (0 > a) throw "Error: PulleyJoint::jointMin must be >= 0";
  10236. this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin = a, this.zpp_inner.wake());
  10237. return this.zpp_inner_zn.jointMin
  10238. },
  10239. get_jointMin: function () {
  10240. return this.zpp_inner_zn.jointMin
  10241. },
  10242. set_anchor4: function (a) {
  10243. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10244. if (null == a) throw "Error: Constraint::anchor4 cannot be null";
  10245. null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
  10246. this.zpp_inner_zn.wrap_a4.set(a);
  10247. null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
  10248. return this.zpp_inner_zn.wrap_a4
  10249. },
  10250. get_anchor4: function () {
  10251. null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
  10252. return this.zpp_inner_zn.wrap_a4
  10253. },
  10254. set_anchor3: function (a) {
  10255. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10256. if (null == a) throw "Error: Constraint::anchor3 cannot be null";
  10257. null == this.zpp_inner_zn.wrap_a3 &&
  10258. this.zpp_inner_zn.setup_a3();
  10259. this.zpp_inner_zn.wrap_a3.set(a);
  10260. null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
  10261. return this.zpp_inner_zn.wrap_a3
  10262. },
  10263. get_anchor3: function () {
  10264. null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
  10265. return this.zpp_inner_zn.wrap_a3
  10266. },
  10267. set_anchor2: function (a) {
  10268. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10269. if (null == a) throw "Error: Constraint::anchor2 cannot be null";
  10270. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10271. this.zpp_inner_zn.wrap_a2.set(a);
  10272. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10273. return this.zpp_inner_zn.wrap_a2
  10274. },
  10275. get_anchor2: function () {
  10276. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10277. return this.zpp_inner_zn.wrap_a2
  10278. },
  10279. set_anchor1: function (a) {
  10280. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10281. if (null == a) throw "Error: Constraint::anchor1 cannot be null";
  10282. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10283. this.zpp_inner_zn.wrap_a1.set(a);
  10284. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10285. return this.zpp_inner_zn.wrap_a1
  10286. },
  10287. get_anchor1: function () {
  10288. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10289. return this.zpp_inner_zn.wrap_a1
  10290. },
  10291. set_body4: function (a) {
  10292. this.zpp_inner.immutable_midstep("Constraint::body4");
  10293. a = null == a ? null : a.zpp_inner;
  10294. a != this.zpp_inner_zn.b4 && (null != this.zpp_inner_zn.b4 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 != this.zpp_inner_zn.b4 && this.zpp_inner_zn.b2 !=
  10295. this.zpp_inner_zn.b4 && this.zpp_inner_zn.b3 != this.zpp_inner_zn.b4 && null != this.zpp_inner_zn.b4 && this.zpp_inner_zn.b4.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b4.wake()), this.zpp_inner_zn.b4 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && this.zpp_inner_zn.b2 != a && this.zpp_inner_zn.b3 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active &&
  10296. null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10297. return null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer
  10298. },
  10299. get_body4: function () {
  10300. return null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer
  10301. },
  10302. set_body3: function (a) {
  10303. this.zpp_inner.immutable_midstep("Constraint::body3");
  10304. a = null == a ? null : a.zpp_inner;
  10305. a != this.zpp_inner_zn.b3 && (null != this.zpp_inner_zn.b3 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 !=
  10306. this.zpp_inner_zn.b3 && this.zpp_inner_zn.b2 != this.zpp_inner_zn.b3 && this.zpp_inner_zn.b4 != this.zpp_inner_zn.b3 && null != this.zpp_inner_zn.b3 && this.zpp_inner_zn.b3.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b3.wake()), this.zpp_inner_zn.b3 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && this.zpp_inner_zn.b2 != a && this.zpp_inner_zn.b4 != a && null != a && a.constraints.add(this.zpp_inner),
  10307. this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10308. return null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer
  10309. },
  10310. get_body3: function () {
  10311. return null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer
  10312. },
  10313. set_body2: function (a) {
  10314. this.zpp_inner.immutable_midstep("Constraint::body2");
  10315. a = null == a ? null : a.zpp_inner;
  10316. a != this.zpp_inner_zn.b2 && (null != this.zpp_inner_zn.b2 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) &&
  10317. this.zpp_inner_zn.b1 != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b3 != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b4 != this.zpp_inner_zn.b2 && null != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b2.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2.wake()), this.zpp_inner_zn.b2 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && this.zpp_inner_zn.b3 != a && this.zpp_inner_zn.b4 !=
  10318. a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10319. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  10320. },
  10321. get_body2: function () {
  10322. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  10323. },
  10324. set_body1: function (a) {
  10325. this.zpp_inner.immutable_midstep("Constraint::body1");
  10326. a = null == a ? null : a.zpp_inner;
  10327. a != this.zpp_inner_zn.b1 && (null != this.zpp_inner_zn.b1 && (null != (null ==
  10328. this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2 != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b3 != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b4 != this.zpp_inner_zn.b1 && null != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b1.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1.wake()), this.zpp_inner_zn.b1 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b2 !=
  10329. a && this.zpp_inner_zn.b3 != a && this.zpp_inner_zn.b4 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10330. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10331. },
  10332. get_body1: function () {
  10333. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10334. },
  10335. __class__: h.constraint.PulleyJoint
  10336. });
  10337. h.constraint.UserConstraint = function (a, b) {
  10338. null == b && (b = !1);
  10339. this.zpp_inner_zn = null;
  10340. if (1 > a) throw "Error: Constraint dimension must be at least 1";
  10341. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_UserConstraint(a, b);
  10342. this.zpp_inner.outer = this;
  10343. this.zpp_inner_zn.outer_zn = this;
  10344. try {
  10345. h.constraint.Constraint.call(this)
  10346. } catch (d) {}
  10347. };
  10348. s["nape.constraint.UserConstraint"] = h.constraint.UserConstraint;
  10349. h.constraint.UserConstraint.__name__ = ["nape", "constraint", "UserConstraint"];
  10350. h.constraint.UserConstraint.__super__ = h.constraint.Constraint;
  10351. h.constraint.UserConstraint.prototype = I(h.constraint.Constraint.prototype, {
  10352. __registerBody: function (a, b) {
  10353. this.zpp_inner.immutable_midstep("UserConstraint::registerBody(..)");
  10354. if (a != b) {
  10355. if (null != a) {
  10356. if (!this.zpp_inner_zn.remBody(a.zpp_inner)) throw "Error: oldBody is not registered to the cosntraint";
  10357. this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && a.zpp_inner.wake()
  10358. }
  10359. null != b && this.zpp_inner_zn.addBody(b.zpp_inner);
  10360. this.zpp_inner.wake();
  10361. null != b && b.zpp_inner.wake()
  10362. }
  10363. return b
  10364. },
  10365. __invalidate: function () {
  10366. this.zpp_inner.immutable_midstep("UserConstraint::invalidate()");
  10367. this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner.wake()
  10368. },
  10369. visitBodies: function (a) {
  10370. for (var b = 0, d = this.zpp_inner_zn.bodies.length; b < d;) {
  10371. var c = this.zpp_inner_zn.bodies[b];
  10372. if (null != c.body) {
  10373. for (var e = !1, f = b + 1; f < d;) {
  10374. var l = f++;
  10375. if (this.zpp_inner_zn.bodies[l].body == c.body) {
  10376. e = !0;
  10377. break
  10378. }
  10379. }
  10380. e || a(c.body.outer)
  10381. }
  10382. b++
  10383. }
  10384. },
  10385. bodyImpulse: function (a) {
  10386. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  10387. for (var b = !1, d = 0, c = this.zpp_inner_zn.bodies; d < c.length;) {
  10388. var e =
  10389. c[d];
  10390. ++d;
  10391. if (e.body == a.zpp_inner) {
  10392. b = !0;
  10393. break
  10394. }
  10395. }
  10396. if (!b) throw "Error: Body is not linked to this constraint";
  10397. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
  10398. },
  10399. impulse: function () {
  10400. for (var a = new h.geom.MatMN(this.zpp_inner_zn.dim, 1), b = 0, d = this.zpp_inner_zn.dim; b < d;) {
  10401. var c = b++;
  10402. if (0 > c || c >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  10403. a.zpp_inner.x[c * a.zpp_inner.n] = this.zpp_inner_zn.jAcc[c]
  10404. }
  10405. return a
  10406. },
  10407. __impulse: function (a, b, d) {
  10408. throw "Error: UserConstraint::__impulse must be overriden";
  10409. },
  10410. __clamp: function (a) {},
  10411. __eff_mass: function (a) {
  10412. throw "Error: UserConstraint::__eff_mass must be overriden";
  10413. },
  10414. __velocity: function (a) {
  10415. throw "Error: Userconstraint::__velocity must be overriden";
  10416. },
  10417. __position: function (a) {
  10418. throw "Error: UserConstraint::__position must be overriden";
  10419. },
  10420. __prepare: function () {},
  10421. __draw: function (a) {},
  10422. __validate: function () {},
  10423. __broken: function () {},
  10424. __copy: function () {
  10425. throw "Error: UserConstraint::__copy must be overriden";
  10426. },
  10427. __bindVec2: function () {
  10428. var a = new h.geom.Vec2;
  10429. a.zpp_inner._inuse = !0;
  10430. a.zpp_inner._invalidate = (da = this.zpp_inner_zn, A(da, da.bindVec2_invalidate));
  10431. return a
  10432. },
  10433. __class__: h.constraint.UserConstraint
  10434. });
  10435. h.constraint.WeldJoint = function (a, b, d, g, e) {
  10436. null == e && (e = 0);
  10437. this.zpp_inner_zn = null;
  10438. this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_WeldJoint;
  10439. this.zpp_inner.outer = this;
  10440. this.zpp_inner_zn.outer_zn = this;
  10441. try {
  10442. h.constraint.Constraint.call(this)
  10443. } catch (f) {}
  10444. this.set_body1(a);
  10445. this.set_body2(b);
  10446. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10447. if (null ==
  10448. d) throw "Error: Constraint::anchor1 cannot be null";
  10449. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10450. this.zpp_inner_zn.wrap_a1.set(d);
  10451. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10452. this.zpp_inner_zn.wrap_a1;
  10453. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10454. if (null == g) throw "Error: Constraint::anchor2 cannot be null";
  10455. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10456. this.zpp_inner_zn.wrap_a2.set(g);
  10457. null == this.zpp_inner_zn.wrap_a2 &&
  10458. this.zpp_inner_zn.setup_a2();
  10459. this.zpp_inner_zn.wrap_a2;
  10460. this.zpp_inner.immutable_midstep("WeldJoint::phase");
  10461. if (e != e) throw "Error: WeldJoint::phase cannot be NaN";
  10462. this.zpp_inner_zn.phase != e && (this.zpp_inner_zn.phase = e, this.zpp_inner.wake());
  10463. this.zpp_inner_zn.phase
  10464. };
  10465. s["nape.constraint.WeldJoint"] = h.constraint.WeldJoint;
  10466. h.constraint.WeldJoint.__name__ = ["nape", "constraint", "WeldJoint"];
  10467. h.constraint.WeldJoint.__super__ = h.constraint.Constraint;
  10468. h.constraint.WeldJoint.prototype = I(h.constraint.Constraint.prototype, {
  10469. visitBodies: function (a) {
  10470. null != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer);
  10471. null != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) && (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer) != (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a(null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)
  10472. },
  10473. bodyImpulse: function (a) {
  10474. if (null == a) throw "Error: Cannot evaluate impulse on null body";
  10475. if (a !=
  10476. (null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer) && a != (null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer)) throw "Error: Body is not linked to this constraint";
  10477. return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
  10478. },
  10479. impulse: function () {
  10480. var a = new h.geom.MatMN(3, 1);
  10481. if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  10482. a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAccx;
  10483. if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  10484. a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccy;
  10485. if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  10486. a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccz;
  10487. return a
  10488. },
  10489. set_phase: function (a) {
  10490. this.zpp_inner.immutable_midstep("WeldJoint::phase");
  10491. if (a != a) throw "Error: WeldJoint::phase cannot be NaN";
  10492. this.zpp_inner_zn.phase != a && (this.zpp_inner_zn.phase = a, this.zpp_inner.wake());
  10493. return this.zpp_inner_zn.phase
  10494. },
  10495. get_phase: function () {
  10496. return this.zpp_inner_zn.phase
  10497. },
  10498. set_anchor2: function (a) {
  10499. if (null !=
  10500. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10501. if (null == a) throw "Error: Constraint::anchor2 cannot be null";
  10502. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10503. this.zpp_inner_zn.wrap_a2.set(a);
  10504. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10505. return this.zpp_inner_zn.wrap_a2
  10506. },
  10507. get_anchor2: function () {
  10508. null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
  10509. return this.zpp_inner_zn.wrap_a2
  10510. },
  10511. set_anchor1: function (a) {
  10512. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  10513. if (null == a) throw "Error: Constraint::anchor1 cannot be null";
  10514. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10515. this.zpp_inner_zn.wrap_a1.set(a);
  10516. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10517. return this.zpp_inner_zn.wrap_a1
  10518. },
  10519. get_anchor1: function () {
  10520. null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
  10521. return this.zpp_inner_zn.wrap_a1
  10522. },
  10523. set_body2: function (a) {
  10524. this.zpp_inner.immutable_midstep("Constraint::body2");
  10525. a = null == a ? null : a.zpp_inner;
  10526. a != this.zpp_inner_zn.b2 && (null !=
  10527. this.zpp_inner_zn.b2 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1 != this.zpp_inner_zn.b2 && null != this.zpp_inner_zn.b2 && this.zpp_inner_zn.b2.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b2.wake()), this.zpp_inner_zn.b2 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b1 != a && null != a && a.constraints.add(this.zpp_inner),
  10528. this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
  10529. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  10530. },
  10531. get_body2: function () {
  10532. return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
  10533. },
  10534. set_body1: function (a) {
  10535. this.zpp_inner.immutable_midstep("Constraint::body1");
  10536. a = null == a ? null : a.zpp_inner;
  10537. a != this.zpp_inner_zn.b1 && (null != this.zpp_inner_zn.b1 && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) &&
  10538. this.zpp_inner_zn.b2 != this.zpp_inner_zn.b1 && null != this.zpp_inner_zn.b1 && this.zpp_inner_zn.b1.constraints.remove(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner_zn.b1.wake()), this.zpp_inner_zn.b1 = a, null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && null != a && this.zpp_inner_zn.b2 != a && null != a && a.constraints.add(this.zpp_inner), this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) &&
  10539. (this.zpp_inner.wake(), null != a && a.wake()));
  10540. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10541. },
  10542. get_body1: function () {
  10543. return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
  10544. },
  10545. __class__: h.constraint.WeldJoint
  10546. });
  10547. h.dynamics = {};
  10548. h.dynamics.Arbiter = function () {
  10549. this.zpp_inner = null;
  10550. if (!c.dynamics.ZPP_Arbiter.internal) throw "Error: Cannot instantiate Arbiter derp!";
  10551. };
  10552. s["nape.dynamics.Arbiter"] = h.dynamics.Arbiter;
  10553. h.dynamics.Arbiter.__name__ = ["nape", "dynamics", "Arbiter"];
  10554. h.dynamics.Arbiter.prototype = {
  10555. toString: function () {
  10556. var a = this.zpp_inner.type == c.dynamics.ZPP_Arbiter.COL ? "CollisionArbiter" : this.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID ? "FluidArbiter" : "SensorArbiter";
  10557. if (this.zpp_inner.cleared) a += "(object-pooled)";
  10558. else {
  10559. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10560. a = a + "(" + (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws2.outer : this.zpp_inner.ws1.outer).toString() + "|";
  10561. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10562. a = a + (this.zpp_inner.ws1.id >
  10563. this.zpp_inner.ws2.id ? this.zpp_inner.ws1.outer : this.zpp_inner.ws2.outer).toString() + ")" + (this.zpp_inner.type == c.dynamics.ZPP_Arbiter.COL ? "[" + ["SD", "DD"][this.zpp_inner.colarb.stat ? 0 : 1] + "]" : "") + "<-" + this.get_state().toString()
  10564. }
  10565. return a
  10566. },
  10567. totalImpulse: function (a, b) {
  10568. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10569. var d;
  10570. if (d = null != a) {
  10571. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10572. if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  10573. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10574. d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  10575. }
  10576. }
  10577. if (d) throw "Error: Arbiter does not relate to body";
  10578. return h.geom.Vec3.get(0, 0, 0)
  10579. },
  10580. get_state: function () {
  10581. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10582. var a;
  10583. switch (this.zpp_inner.immState) {
  10584. case c.util.ZPP_Flags.id_ImmState_ACCEPT:
  10585. case c.util.ZPP_Flags.id_ImmState_ALWAYS:
  10586. null == c.util.ZPP_Flags.PreFlag_ACCEPT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT = new h.callbacks.PreFlag,
  10587. c.util.ZPP_Flags.internal = !1);
  10588. a = c.util.ZPP_Flags.PreFlag_ACCEPT;
  10589. break;
  10590. case c.util.ZPP_Flags.id_ImmState_ACCEPT:
  10591. null == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  10592. a = c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE;
  10593. break;
  10594. case c.util.ZPP_Flags.id_ImmState_IGNORE:
  10595. case c.util.ZPP_Flags.id_ImmState_ALWAYS:
  10596. null == c.util.ZPP_Flags.PreFlag_IGNORE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE =
  10597. new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  10598. a = c.util.ZPP_Flags.PreFlag_IGNORE;
  10599. break;
  10600. default:
  10601. null == c.util.ZPP_Flags.PreFlag_IGNORE_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.PreFlag_IGNORE_ONCE
  10602. }
  10603. return a
  10604. },
  10605. get_body2: function () {
  10606. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10607. return this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer
  10608. },
  10609. get_body1: function () {
  10610. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10611. return this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer
  10612. },
  10613. get_shape2: function () {
  10614. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10615. return this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws1.outer : this.zpp_inner.ws2.outer
  10616. },
  10617. get_shape1: function () {
  10618. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10619. return this.zpp_inner.ws1.id >
  10620. this.zpp_inner.ws2.id ? this.zpp_inner.ws2.outer : this.zpp_inner.ws1.outer
  10621. },
  10622. get_fluidArbiter: function () {
  10623. return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID ? this.zpp_inner.fluidarb.outer_zn : null
  10624. },
  10625. get_collisionArbiter: function () {
  10626. return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.COL ? this.zpp_inner.colarb.outer_zn : null
  10627. },
  10628. isSensorArbiter: function () {
  10629. return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.SENSOR
  10630. },
  10631. isFluidArbiter: function () {
  10632. return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID
  10633. },
  10634. isCollisionArbiter: function () {
  10635. return this.zpp_inner.type ==
  10636. c.dynamics.ZPP_Arbiter.COL
  10637. },
  10638. get_type: function () {
  10639. return c.dynamics.ZPP_Arbiter.types[this.zpp_inner.type]
  10640. },
  10641. get_isSleeping: function () {
  10642. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10643. return this.zpp_inner.sleeping
  10644. },
  10645. __class__: h.dynamics.Arbiter
  10646. };
  10647. h.dynamics.ArbiterIterator = function () {
  10648. this.zpp_next = null;
  10649. this.zpp_critical = !1;
  10650. this.zpp_i = 0;
  10651. this.zpp_inner = null;
  10652. if (!c.util.ZPP_ArbiterList.internal) throw "Error: Cannot instantiate ArbiterIterator derp!";
  10653. };
  10654. s["nape.dynamics.ArbiterIterator"] =
  10655. h.dynamics.ArbiterIterator;
  10656. h.dynamics.ArbiterIterator.__name__ = ["nape", "dynamics", "ArbiterIterator"];
  10657. h.dynamics.ArbiterIterator.get = function (a) {
  10658. var b = null == h.dynamics.ArbiterIterator.zpp_pool ? function (a) {
  10659. c.util.ZPP_ArbiterList.internal = !0;
  10660. a = new h.dynamics.ArbiterIterator;
  10661. c.util.ZPP_ArbiterList.internal = !1;
  10662. return a
  10663. }(this) : function (a) {
  10664. a = h.dynamics.ArbiterIterator.zpp_pool;
  10665. h.dynamics.ArbiterIterator.zpp_pool = a.zpp_next;
  10666. return a
  10667. }(this);
  10668. b.zpp_i = 0;
  10669. b.zpp_inner = a;
  10670. b.zpp_critical = !1;
  10671. return b
  10672. };
  10673. h.dynamics.ArbiterIterator.prototype = {
  10674. next: function () {
  10675. this.zpp_critical = !1;
  10676. return this.zpp_inner.at(this.zpp_i++)
  10677. },
  10678. hasNext: function () {
  10679. this.zpp_inner.zpp_inner.valmod();
  10680. var a = this.zpp_inner.zpp_gl();
  10681. this.zpp_critical = !0;
  10682. if (this.zpp_i < a) return !0;
  10683. this.zpp_next = h.dynamics.ArbiterIterator.zpp_pool;
  10684. h.dynamics.ArbiterIterator.zpp_pool = this;
  10685. this.zpp_inner = null;
  10686. return !1
  10687. },
  10688. __class__: h.dynamics.ArbiterIterator
  10689. };
  10690. h.dynamics.ArbiterList = function () {
  10691. this.zpp_inner = null;
  10692. this.zpp_inner = new c.util.ZPP_ArbiterList;
  10693. this.zpp_inner.outer = this
  10694. };
  10695. s["nape.dynamics.ArbiterList"] =
  10696. h.dynamics.ArbiterList;
  10697. h.dynamics.ArbiterList.__name__ = ["nape", "dynamics", "ArbiterList"];
  10698. h.dynamics.ArbiterList.fromArray = function (a) {
  10699. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  10700. for (var b = new h.dynamics.ArbiterList, d = 0; d < a.length;) {
  10701. var c = a[d];
  10702. ++d;
  10703. b.push(c)
  10704. }
  10705. return b
  10706. };
  10707. h.dynamics.ArbiterList.prototype = {
  10708. filter: function (a) {
  10709. if (null == a) throw "Error: Cannot select elements of list with null";
  10710. for (var b = 0; b < this.zpp_gl();) {
  10711. var d = this.at(b);
  10712. try {
  10713. a(d) ? b++ : this.remove(d)
  10714. } catch (c) {
  10715. break
  10716. }
  10717. }
  10718. return this
  10719. },
  10720. foreach: function (a) {
  10721. if (null == a) throw "Error: Cannot execute null on list elements";
  10722. for (var b = this.iterator(); b.hasNext();) try {
  10723. var d = a,
  10724. c = void 0;
  10725. b.zpp_critical = !1;
  10726. c = b.zpp_inner.at(b.zpp_i++);
  10727. d(c)
  10728. } catch (e) {
  10729. b.zpp_next = h.dynamics.ArbiterIterator.zpp_pool;
  10730. h.dynamics.ArbiterIterator.zpp_pool = b;
  10731. b.zpp_inner = null;
  10732. break
  10733. }
  10734. return this
  10735. },
  10736. toString: function () {
  10737. for (var a = "[", b = !0, d = this.iterator(); d.hasNext();) {
  10738. var c = d.next();
  10739. b || (a += ",");
  10740. a += null == c ? "NULL" : c.toString();
  10741. b = !1
  10742. }
  10743. return a + "]"
  10744. },
  10745. merge: function (a) {
  10746. if (null == a) throw "Error: Cannot merge with null list";
  10747. for (a = a.iterator(); a.hasNext();) {
  10748. var b = a.next();
  10749. this.has(b) || this.add(b)
  10750. }
  10751. },
  10752. copy: function (a) {
  10753. null == a && (a = !1);
  10754. for (var b = new h.dynamics.ArbiterList, d = this.iterator(); d.hasNext();) {
  10755. var c = d.next();
  10756. b.push(a ? function (a) {
  10757. throw "Error: Arbiter is not a copyable type";
  10758. }(this) : c)
  10759. }
  10760. return b
  10761. },
  10762. iterator: function () {
  10763. this.zpp_vm();
  10764. return h.dynamics.ArbiterIterator.get(this)
  10765. },
  10766. empty: function () {
  10767. return 0 == this.zpp_gl()
  10768. },
  10769. clear: function () {
  10770. if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
  10771. if (this.zpp_inner.reverse_flag)
  10772. for (; !this.empty();) this.pop();
  10773. else
  10774. for (; !this.empty();) this.shift()
  10775. },
  10776. remove: function (a) {
  10777. if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
  10778. this.zpp_inner.modify_test();
  10779. this.zpp_vm();
  10780. var b;
  10781. b = !1;
  10782. for (var d = this.zpp_inner.inner.head; null != d;) {
  10783. if (d.elt == a.zpp_inner) {
  10784. b = !0;
  10785. break
  10786. }
  10787. d = d.next
  10788. }
  10789. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  10790. return b
  10791. },
  10792. add: function (a) {
  10793. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  10794. },
  10795. shift: function () {
  10796. if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
  10797. this.zpp_inner.modify_test();
  10798. if (this.empty()) throw "Error: Cannot remove from empty list";
  10799. this.zpp_vm();
  10800. var a = null;
  10801. if (this.zpp_inner.reverse_flag) {
  10802. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  10803. var b = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
  10804. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  10805. d = a.wrapper();
  10806. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  10807. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  10808. } else a = this.zpp_inner.inner.head.elt, d = a.wrapper(), null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  10809. this.zpp_inner.invalidate();
  10810. return d = a.wrapper()
  10811. },
  10812. pop: function () {
  10813. if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
  10814. this.zpp_inner.modify_test();
  10815. if (this.empty()) throw "Error: Cannot remove from empty list";
  10816. this.zpp_vm();
  10817. var a = null;
  10818. if (this.zpp_inner.reverse_flag) {
  10819. var a = this.zpp_inner.inner.head.elt,
  10820. b = a.wrapper();
  10821. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  10822. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  10823. } else {
  10824. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  10825. var d = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
  10826. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  10827. b = a.wrapper();
  10828. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  10829. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  10830. }
  10831. this.zpp_inner.invalidate();
  10832. return b = a.wrapper()
  10833. },
  10834. unshift: function (a) {
  10835. if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
  10836. this.zpp_inner.modify_test();
  10837. this.zpp_vm();
  10838. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  10839. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = this.empty() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(),
  10840. null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  10841. return b
  10842. },
  10843. push: function (a) {
  10844. if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
  10845. this.zpp_inner.modify_test();
  10846. this.zpp_vm();
  10847. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  10848. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = this.empty() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite,
  10849. a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  10850. return b
  10851. },
  10852. at: function (a) {
  10853. this.zpp_vm();
  10854. if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
  10855. this.zpp_inner.reverse_flag && (a = this.zpp_gl() - 1 - a);
  10856. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite)
  10857. for (this.zpp_inner.at_index = 0, this.zpp_inner.at_ite = this.zpp_inner.inner.head;;) {
  10858. var b = this.zpp_inner.at_ite.elt;
  10859. if (b.active) break;
  10860. this.zpp_inner.at_ite = this.zpp_inner.at_ite.next
  10861. }
  10862. for (; this.zpp_inner.at_index !=
  10863. a;)
  10864. for (this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;;) {
  10865. b = this.zpp_inner.at_ite.elt;
  10866. if (b.active) break;
  10867. this.zpp_inner.at_ite = this.zpp_inner.at_ite.next
  10868. }
  10869. return this.zpp_inner.at_ite.elt.wrapper()
  10870. },
  10871. has: function (a) {
  10872. this.zpp_vm();
  10873. return this.zpp_inner.inner.has(a.zpp_inner)
  10874. },
  10875. zpp_vm: function () {
  10876. this.zpp_inner.valmod()
  10877. },
  10878. zpp_gl: function () {
  10879. this.zpp_inner.valmod();
  10880. if (this.zpp_inner.zip_length) {
  10881. this.zpp_inner.zip_length = !1;
  10882. this.zpp_inner.user_length = 0;
  10883. for (var a = this.zpp_inner.inner.head; null !=
  10884. a;) a.elt.active && this.zpp_inner.user_length++, a = a.next
  10885. }
  10886. return this.zpp_inner.user_length
  10887. },
  10888. get_length: function () {
  10889. return this.zpp_gl()
  10890. },
  10891. __class__: h.dynamics.ArbiterList
  10892. };
  10893. h.dynamics.ArbiterType = function () {
  10894. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ArbiterType derp!";
  10895. };
  10896. s["nape.dynamics.ArbiterType"] = h.dynamics.ArbiterType;
  10897. h.dynamics.ArbiterType.__name__ = ["nape", "dynamics", "ArbiterType"];
  10898. h.dynamics.ArbiterType.get_COLLISION = function () {
  10899. null == c.util.ZPP_Flags.ArbiterType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_COLLISION = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1);
  10900. return c.util.ZPP_Flags.ArbiterType_COLLISION
  10901. };
  10902. h.dynamics.ArbiterType.get_SENSOR = function () {
  10903. null == c.util.ZPP_Flags.ArbiterType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_SENSOR = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1);
  10904. return c.util.ZPP_Flags.ArbiterType_SENSOR
  10905. };
  10906. h.dynamics.ArbiterType.get_FLUID = function () {
  10907. null == c.util.ZPP_Flags.ArbiterType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_FLUID = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1);
  10908. return c.util.ZPP_Flags.ArbiterType_FLUID
  10909. };
  10910. h.dynamics.ArbiterType.prototype = {
  10911. toString: function () {
  10912. null == c.util.ZPP_Flags.ArbiterType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_COLLISION = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1);
  10913. var a;
  10914. this == c.util.ZPP_Flags.ArbiterType_COLLISION ? a = "COLLISION" : (null == c.util.ZPP_Flags.ArbiterType_SENSOR && (c.util.ZPP_Flags.internal = !0,
  10915. c.util.ZPP_Flags.ArbiterType_SENSOR = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.ArbiterType_SENSOR ? a = "SENSOR" : (null == c.util.ZPP_Flags.ArbiterType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_FLUID = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.ArbiterType_FLUID ? "FLUID" : ""));
  10916. return a
  10917. },
  10918. __class__: h.dynamics.ArbiterType
  10919. };
  10920. h.dynamics.CollisionArbiter = function () {
  10921. if (!c.dynamics.ZPP_Arbiter.internal) throw "Error: Cannot instantiate CollisionArbiter derp!";
  10922. h.dynamics.Arbiter.call(this)
  10923. };
  10924. s["nape.dynamics.CollisionArbiter"] = h.dynamics.CollisionArbiter;
  10925. h.dynamics.CollisionArbiter.__name__ = ["nape", "dynamics", "CollisionArbiter"];
  10926. h.dynamics.CollisionArbiter.__super__ = h.dynamics.Arbiter;
  10927. h.dynamics.CollisionArbiter.prototype = I(h.dynamics.Arbiter.prototype, {
  10928. set_rollingFriction: function (a) {
  10929. if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::rollingFriction is only mutable during a pre-handler";
  10930. if (a != a) throw "Error: CollisionArbiter::rollingFriction cannot be NaN";
  10931. if (0 > a) throw "Error: CollisionArbiter::rollingFriction cannot be negative";
  10932. var b = this.zpp_inner.colarb;
  10933. b.rfric = a;
  10934. b.userdef_rfric = !0;
  10935. return this.get_rollingFriction()
  10936. },
  10937. get_rollingFriction: function () {
  10938. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10939. var a = this.zpp_inner.colarb;
  10940. a.invalidated && (a.invalidated = !1, a.userdef_restitution || (a.restitution = a.s1.material.elasticity <= Math.NEGATIVE_INFINITY || a.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : a.s1.material.elasticity >= Math.POSITIVE_INFINITY ||
  10941. a.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (a.s1.material.elasticity + a.s2.material.elasticity) / 2, 0 > a.restitution && (a.restitution = 0), 1 < a.restitution && (a.restitution = 1)), a.userdef_dyn_fric || (a.dyn_fric = Math.sqrt(a.s1.material.dynamicFriction * a.s2.material.dynamicFriction)), a.userdef_stat_fric || (a.stat_fric = Math.sqrt(a.s1.material.staticFriction * a.s2.material.staticFriction)), a.userdef_rfric || (a.rfric = Math.sqrt(a.s1.material.rollingFriction * a.s2.material.rollingFriction)));
  10942. return a.rfric
  10943. },
  10944. set_staticFriction: function (a) {
  10945. if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::staticFriction is only mutable during a pre-handler";
  10946. if (a != a) throw "Error: CollisionArbiter::staticFriction cannot be NaN";
  10947. if (0 > a) throw "Error: CollisionArbiter::staticFriction cannot be negative";
  10948. var b = this.zpp_inner.colarb;
  10949. b.stat_fric = a;
  10950. b.userdef_stat_fric = !0;
  10951. return this.get_staticFriction()
  10952. },
  10953. get_staticFriction: function () {
  10954. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10955. var a = this.zpp_inner.colarb;
  10956. a.invalidated && (a.invalidated = !1, a.userdef_restitution || (a.restitution = a.s1.material.elasticity <= Math.NEGATIVE_INFINITY || a.s2.material.elasticity <=
  10957. Math.NEGATIVE_INFINITY ? 0 : a.s1.material.elasticity >= Math.POSITIVE_INFINITY || a.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (a.s1.material.elasticity + a.s2.material.elasticity) / 2, 0 > a.restitution && (a.restitution = 0), 1 < a.restitution && (a.restitution = 1)), a.userdef_dyn_fric || (a.dyn_fric = Math.sqrt(a.s1.material.dynamicFriction * a.s2.material.dynamicFriction)), a.userdef_stat_fric || (a.stat_fric = Math.sqrt(a.s1.material.staticFriction * a.s2.material.staticFriction)), a.userdef_rfric || (a.rfric = Math.sqrt(a.s1.material.rollingFriction *
  10958. a.s2.material.rollingFriction)));
  10959. return a.stat_fric
  10960. },
  10961. set_dynamicFriction: function (a) {
  10962. if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::dynamicFriction is only mutable during a pre-handler";
  10963. if (a != a) throw "Error: CollisionArbiter::dynamicFriction cannot be NaN";
  10964. if (0 > a) throw "Error: CollisionArbiter::dynamicFriction cannot be negative";
  10965. var b = this.zpp_inner.colarb;
  10966. b.dyn_fric = a;
  10967. b.userdef_dyn_fric = !0;
  10968. return this.get_dynamicFriction()
  10969. },
  10970. get_dynamicFriction: function () {
  10971. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10972. var a = this.zpp_inner.colarb;
  10973. a.invalidated && (a.invalidated = !1, a.userdef_restitution || (a.restitution = a.s1.material.elasticity <= Math.NEGATIVE_INFINITY || a.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : a.s1.material.elasticity >= Math.POSITIVE_INFINITY || a.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (a.s1.material.elasticity + a.s2.material.elasticity) / 2, 0 > a.restitution && (a.restitution = 0), 1 < a.restitution && (a.restitution = 1)), a.userdef_dyn_fric || (a.dyn_fric = Math.sqrt(a.s1.material.dynamicFriction * a.s2.material.dynamicFriction)),
  10974. a.userdef_stat_fric || (a.stat_fric = Math.sqrt(a.s1.material.staticFriction * a.s2.material.staticFriction)), a.userdef_rfric || (a.rfric = Math.sqrt(a.s1.material.rollingFriction * a.s2.material.rollingFriction)));
  10975. return a.dyn_fric
  10976. },
  10977. set_elasticity: function (a) {
  10978. if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::elasticity is only mutable during a pre-handler";
  10979. if (a != a) throw "Error: CollisionArbiter::elasticity cannot be NaN";
  10980. if (0 > a) throw "Error: CollisionArbiter::elasticity cannot be negative";
  10981. var b =
  10982. this.zpp_inner.colarb;
  10983. b.restitution = a;
  10984. b.userdef_restitution = !0;
  10985. return this.get_elasticity()
  10986. },
  10987. get_elasticity: function () {
  10988. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10989. var a = this.zpp_inner.colarb;
  10990. a.invalidated && (a.invalidated = !1, a.userdef_restitution || (a.restitution = a.s1.material.elasticity <= Math.NEGATIVE_INFINITY || a.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : a.s1.material.elasticity >= Math.POSITIVE_INFINITY || a.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (a.s1.material.elasticity +
  10991. a.s2.material.elasticity) / 2, 0 > a.restitution && (a.restitution = 0), 1 < a.restitution && (a.restitution = 1)), a.userdef_dyn_fric || (a.dyn_fric = Math.sqrt(a.s1.material.dynamicFriction * a.s2.material.dynamicFriction)), a.userdef_stat_fric || (a.stat_fric = Math.sqrt(a.s1.material.staticFriction * a.s2.material.staticFriction)), a.userdef_rfric || (a.rfric = Math.sqrt(a.s1.material.rollingFriction * a.s2.material.rollingFriction)));
  10992. return a.restitution
  10993. },
  10994. rollingImpulse: function (a, b) {
  10995. null == b && (b = !1);
  10996. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  10997. var d;
  10998. if (d = null != a) {
  10999. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11000. if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  11001. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11002. d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  11003. }
  11004. }
  11005. if (d) throw "Error: Arbiter does not relate to body";
  11006. d = this.zpp_inner.colarb;
  11007. return !b || d.oc1.fresh ? d.oc1.wrapper().rollingImpulse(a) : 0
  11008. },
  11009. totalImpulse: function (a,
  11010. b) {
  11011. null == b && (b = !1);
  11012. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11013. var d;
  11014. if (d = null != a) {
  11015. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11016. if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  11017. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11018. d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  11019. }
  11020. }
  11021. if (d) throw "Error: Arbiter does not relate to body";
  11022. var c =
  11023. 0,
  11024. e = 0,
  11025. f = 0,
  11026. l = this.zpp_inner.colarb;
  11027. if (!b || l.oc1.fresh) {
  11028. d = l.oc1.wrapper().totalImpulse(a);
  11029. var m = 1,
  11030. u = m;
  11031. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11032. d.zpp_inner.validate();
  11033. c += d.zpp_inner.x * u;
  11034. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11035. d.zpp_inner.validate();
  11036. e += d.zpp_inner.y * u;
  11037. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11038. d.zpp_inner.validate();
  11039. f += d.zpp_inner.z * m;
  11040. d.dispose()
  11041. }
  11042. if (l.hc2 && (!b || l.oc2.fresh)) {
  11043. d =
  11044. l.oc2.wrapper().totalImpulse(a);
  11045. u = m = 1;
  11046. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11047. d.zpp_inner.validate();
  11048. c += d.zpp_inner.x * u;
  11049. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11050. d.zpp_inner.validate();
  11051. e += d.zpp_inner.y * u;
  11052. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11053. d.zpp_inner.validate();
  11054. f += d.zpp_inner.z * m;
  11055. d.dispose()
  11056. }
  11057. return h.geom.Vec3.get(c, e, f)
  11058. },
  11059. tangentImpulse: function (a, b) {
  11060. null == b && (b = !1);
  11061. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11062. var d;
  11063. if (d = null != a) {
  11064. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11065. if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  11066. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11067. d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  11068. }
  11069. }
  11070. if (d) throw "Error: Arbiter does not relate to body";
  11071. var c = 0,
  11072. e = 0,
  11073. f = 0,
  11074. l = this.zpp_inner.colarb;
  11075. if (!b || l.oc1.fresh) {
  11076. d = l.oc1.wrapper().tangentImpulse(a);
  11077. var m = 1,
  11078. u = m;
  11079. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11080. d.zpp_inner.validate();
  11081. c += d.zpp_inner.x * u;
  11082. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11083. d.zpp_inner.validate();
  11084. e += d.zpp_inner.y * u;
  11085. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11086. d.zpp_inner.validate();
  11087. f += d.zpp_inner.z * m;
  11088. d.dispose()
  11089. }
  11090. if (l.hc2 && (!b || l.oc2.fresh)) {
  11091. d = l.oc2.wrapper().tangentImpulse(a);
  11092. u = m = 1;
  11093. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11094. d.zpp_inner.validate();
  11095. c += d.zpp_inner.x * u;
  11096. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11097. d.zpp_inner.validate();
  11098. e += d.zpp_inner.y * u;
  11099. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11100. d.zpp_inner.validate();
  11101. f += d.zpp_inner.z * m;
  11102. d.dispose()
  11103. }
  11104. return h.geom.Vec3.get(c, e, f)
  11105. },
  11106. normalImpulse: function (a, b) {
  11107. null == b && (b = !1);
  11108. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11109. var d;
  11110. if (d = null != a) {
  11111. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11112. if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  11113. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11114. d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  11115. }
  11116. }
  11117. if (d) throw "Error: Arbiter does not relate to body";
  11118. var c = 0,
  11119. e = 0,
  11120. f = 0,
  11121. l = this.zpp_inner.colarb;
  11122. if (!b || l.oc1.fresh) {
  11123. d = l.oc1.wrapper().normalImpulse(a);
  11124. var m = 1,
  11125. u = m;
  11126. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11127. d.zpp_inner.validate();
  11128. c += d.zpp_inner.x * u;
  11129. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11130. d.zpp_inner.validate();
  11131. e += d.zpp_inner.y * u;
  11132. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11133. d.zpp_inner.validate();
  11134. f += d.zpp_inner.z * m;
  11135. d.dispose()
  11136. }
  11137. if (l.hc2 && (!b || l.oc2.fresh)) {
  11138. d = l.oc2.wrapper().normalImpulse(a);
  11139. u = m = 1;
  11140. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11141. d.zpp_inner.validate();
  11142. c += d.zpp_inner.x * u;
  11143. if (null != d &&
  11144. d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11145. d.zpp_inner.validate();
  11146. e += d.zpp_inner.y * u;
  11147. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11148. d.zpp_inner.validate();
  11149. f += d.zpp_inner.z * m;
  11150. d.dispose()
  11151. }
  11152. return h.geom.Vec3.get(c, e, f)
  11153. },
  11154. secondVertex: function () {
  11155. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11156. return null != this.zpp_inner.colarb.__ref_edge1 != (null != this.zpp_inner.colarb.__ref_edge2) ? 1 == this.zpp_inner.colarb.__ref_vertex : !1
  11157. },
  11158. firstVertex: function () {
  11159. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11160. return null != this.zpp_inner.colarb.__ref_edge1 != (null != this.zpp_inner.colarb.__ref_edge2) ? -1 == this.zpp_inner.colarb.__ref_vertex : !1
  11161. },
  11162. get_referenceEdge2: function () {
  11163. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11164. var a = this.zpp_inner.colarb.__ref_edge1,
  11165. b;
  11166. if (b = null != a) {
  11167. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11168. if (!(b = (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws1.outer : this.zpp_inner.ws2.outer).zpp_inner.type != c.util.ZPP_Flags.id_ShapeType_POLYGON)) {
  11169. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11170. b = (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws1.outer : this.zpp_inner.ws2.outer).zpp_inner != a.polygon
  11171. }
  11172. }
  11173. b && (a = this.zpp_inner.colarb.__ref_edge2);
  11174. return null == a ? null : a.wrapper()
  11175. },
  11176. get_referenceEdge1: function () {
  11177. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11178. var a = this.zpp_inner.colarb.__ref_edge1,
  11179. b;
  11180. if (b = null != a) {
  11181. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11182. if (!(b = (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws2.outer : this.zpp_inner.ws1.outer).zpp_inner.type !=
  11183. c.util.ZPP_Flags.id_ShapeType_POLYGON)) {
  11184. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11185. b = (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws2.outer : this.zpp_inner.ws1.outer).zpp_inner != a.polygon
  11186. }
  11187. }
  11188. b && (a = this.zpp_inner.colarb.__ref_edge2);
  11189. return null == a ? null : a.wrapper()
  11190. },
  11191. get_radius: function () {
  11192. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11193. return this.zpp_inner.colarb.radius
  11194. },
  11195. get_normal: function () {
  11196. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11197. null == this.zpp_inner.colarb.wrap_normal && this.zpp_inner.colarb.getnormal();
  11198. return this.zpp_inner.colarb.wrap_normal
  11199. },
  11200. get_contacts: function () {
  11201. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11202. null == this.zpp_inner.colarb.wrap_contacts && this.zpp_inner.colarb.setupcontacts();
  11203. return this.zpp_inner.colarb.wrap_contacts
  11204. },
  11205. __class__: h.dynamics.CollisionArbiter
  11206. });
  11207. h.dynamics.Contact = function () {
  11208. this.zpp_inner = null;
  11209. if (!c.dynamics.ZPP_Contact.internal) throw "Error: Cannot instantiate Contact derp!";
  11210. };
  11211. s["nape.dynamics.Contact"] = h.dynamics.Contact;
  11212. h.dynamics.Contact.__name__ = ["nape", "dynamics", "Contact"];
  11213. h.dynamics.Contact.prototype = {
  11214. toString: function () {
  11215. return null == this.zpp_inner.arbiter || this.zpp_inner.arbiter.cleared ? "{object-pooled}" : "{Contact}"
  11216. },
  11217. get_friction: function () {
  11218. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11219. return this.zpp_inner.inner.friction
  11220. },
  11221. totalImpulse: function (a) {
  11222. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11223. var b = this.zpp_inner.arbiter.colarb,
  11224. d = this.zpp_inner.inner,
  11225. c = d.jnAcc,
  11226. e = d.jtAcc,
  11227. f = b.jrAcc;
  11228. if (null == a) return h.geom.Vec3.get(b.nx * c - b.ny * e, b.ny * c + b.nx * e, f);
  11229. if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
  11230. var l = b.nx * c - b.ny * e,
  11231. c = b.ny * c + b.nx * e;
  11232. return a == b.b1.outer ? h.geom.Vec3.get(-l, -c, -(c * d.r1x - l * d.r1y) - f) : h.geom.Vec3.get(l, c, c * d.r2x - l * d.r2y + f)
  11233. },
  11234. rollingImpulse: function (a) {
  11235. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11236. var b = this.zpp_inner.arbiter.colarb,
  11237. d = this.zpp_inner.arbiter.colarb.jrAcc;
  11238. if (null == a) return d;
  11239. if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
  11240. return a == b.b1.outer ? -d : d
  11241. },
  11242. tangentImpulse: function (a) {
  11243. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11244. var b = this.zpp_inner.arbiter.colarb,
  11245. d = this.zpp_inner.inner,
  11246. c = d.jtAcc;
  11247. if (null == a) return h.geom.Vec3.get(-b.ny * c, b.nx * c);
  11248. if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
  11249. return a == b.b1.outer ? h.geom.Vec3.get(b.ny * c, -b.nx * c, -(d.r1x *
  11250. b.nx + d.r1y * b.ny) * c) : h.geom.Vec3.get(-b.ny * c, b.nx * c, (d.r2x * b.nx + d.r2y * b.ny) * c)
  11251. },
  11252. normalImpulse: function (a) {
  11253. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11254. var b = this.zpp_inner.arbiter.colarb,
  11255. d = this.zpp_inner.inner,
  11256. c = d.jnAcc;
  11257. if (null == a) return h.geom.Vec3.get(b.nx * c, b.ny * c);
  11258. if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
  11259. return a == b.b1.outer ? h.geom.Vec3.get(b.nx * -c, b.ny * -c, -(b.ny * d.r1x - b.nx * d.r1y) * c) : h.geom.Vec3.get(b.nx * c, b.ny * c, (b.ny *
  11260. d.r2x - b.nx * d.r2y) * c)
  11261. },
  11262. get_fresh: function () {
  11263. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11264. return this.zpp_inner.fresh
  11265. },
  11266. get_position: function () {
  11267. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11268. null == this.zpp_inner.wrap_position && this.zpp_inner.getposition();
  11269. return this.zpp_inner.wrap_position
  11270. },
  11271. get_penetration: function () {
  11272. if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
  11273. return -this.zpp_inner.dist
  11274. },
  11275. get_arbiter: function () {
  11276. return null ==
  11277. this.zpp_inner.arbiter ? null : this.zpp_inner.arbiter.outer.get_collisionArbiter()
  11278. },
  11279. __class__: h.dynamics.Contact
  11280. };
  11281. h.dynamics.ContactIterator = function () {
  11282. this.zpp_next = null;
  11283. this.zpp_critical = !1;
  11284. this.zpp_i = 0;
  11285. this.zpp_inner = null;
  11286. if (!c.util.ZPP_ContactList.internal) throw "Error: Cannot instantiate ContactIterator derp!";
  11287. };
  11288. s["nape.dynamics.ContactIterator"] = h.dynamics.ContactIterator;
  11289. h.dynamics.ContactIterator.__name__ = ["nape", "dynamics", "ContactIterator"];
  11290. h.dynamics.ContactIterator.get = function (a) {
  11291. var b = null ==
  11292. h.dynamics.ContactIterator.zpp_pool ? function (a) {
  11293. c.util.ZPP_ContactList.internal = !0;
  11294. a = new h.dynamics.ContactIterator;
  11295. c.util.ZPP_ContactList.internal = !1;
  11296. return a
  11297. }(this) : function (a) {
  11298. a = h.dynamics.ContactIterator.zpp_pool;
  11299. h.dynamics.ContactIterator.zpp_pool = a.zpp_next;
  11300. return a
  11301. }(this);
  11302. b.zpp_i = 0;
  11303. b.zpp_inner = a;
  11304. b.zpp_critical = !1;
  11305. return b
  11306. };
  11307. h.dynamics.ContactIterator.prototype = {
  11308. next: function () {
  11309. this.zpp_critical = !1;
  11310. return this.zpp_inner.at(this.zpp_i++)
  11311. },
  11312. hasNext: function () {
  11313. this.zpp_inner.zpp_inner.valmod();
  11314. var a =
  11315. this.zpp_inner.get_length();
  11316. this.zpp_critical = !0;
  11317. if (this.zpp_i < a) return !0;
  11318. this.zpp_next = h.dynamics.ContactIterator.zpp_pool;
  11319. h.dynamics.ContactIterator.zpp_pool = this;
  11320. this.zpp_inner = null;
  11321. return !1
  11322. },
  11323. __class__: h.dynamics.ContactIterator
  11324. };
  11325. h.dynamics.ContactList = function () {
  11326. this.zpp_inner = null;
  11327. this.zpp_inner = new c.util.ZPP_ContactList;
  11328. this.zpp_inner.outer = this
  11329. };
  11330. s["nape.dynamics.ContactList"] = h.dynamics.ContactList;
  11331. h.dynamics.ContactList.__name__ = ["nape", "dynamics", "ContactList"];
  11332. h.dynamics.ContactList.fromArray =
  11333. function (a) {
  11334. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  11335. for (var b = new h.dynamics.ContactList, d = 0; d < a.length;) {
  11336. var c = a[d];
  11337. ++d;
  11338. b.push(c)
  11339. }
  11340. return b
  11341. };
  11342. h.dynamics.ContactList.prototype = {
  11343. filter: function (a) {
  11344. if (null == a) throw "Error: Cannot select elements of list with null";
  11345. for (var b = 0; b < this.get_length();) {
  11346. var d = this.at(b);
  11347. try {
  11348. a(d) ? b++ : this.remove(d)
  11349. } catch (c) {
  11350. break
  11351. }
  11352. }
  11353. return this
  11354. },
  11355. foreach: function (a) {
  11356. if (null == a) throw "Error: Cannot execute null on list elements";
  11357. var b;
  11358. this.zpp_inner.valmod();
  11359. for (b = h.dynamics.ContactIterator.get(this); b.hasNext();) try {
  11360. var d = a,
  11361. c;
  11362. b.zpp_critical = !1;
  11363. c = b.zpp_inner.at(b.zpp_i++);
  11364. d(c)
  11365. } catch (e) {
  11366. b.zpp_next = h.dynamics.ContactIterator.zpp_pool;
  11367. h.dynamics.ContactIterator.zpp_pool = b;
  11368. b.zpp_inner = null;
  11369. break
  11370. }
  11371. return this
  11372. },
  11373. toString: function () {
  11374. var a = "[",
  11375. b = !0,
  11376. d;
  11377. this.zpp_inner.valmod();
  11378. for (d = h.dynamics.ContactIterator.get(this); d.hasNext();) {
  11379. var c = d.next();
  11380. b || (a += ",");
  11381. a += null == c ? "NULL" : c.toString();
  11382. b = !1
  11383. }
  11384. return a + "]"
  11385. },
  11386. merge: function (a) {
  11387. if (null == a) throw "Error: Cannot merge with null list";
  11388. a.zpp_inner.valmod();
  11389. for (a = h.dynamics.ContactIterator.get(a); a.hasNext();) {
  11390. var b = a.next();
  11391. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  11392. }
  11393. },
  11394. copy: function (a) {
  11395. null == a && (a = !1);
  11396. var b = new h.dynamics.ContactList,
  11397. d;
  11398. this.zpp_inner.valmod();
  11399. for (d = h.dynamics.ContactIterator.get(this); d.hasNext();) {
  11400. var c = d.next();
  11401. b.push(a ? function (a) {
  11402. throw "Error: Contact is not a copyable type";
  11403. }(this) : c)
  11404. }
  11405. return b
  11406. },
  11407. iterator: function () {
  11408. this.zpp_inner.valmod();
  11409. return h.dynamics.ContactIterator.get(this)
  11410. },
  11411. empty: function () {
  11412. return 0 == this.get_length()
  11413. },
  11414. clear: function () {
  11415. if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
  11416. if (this.zpp_inner.reverse_flag)
  11417. for (; 0 != this.get_length();) this.pop();
  11418. else
  11419. for (; 0 != this.get_length();) this.shift()
  11420. },
  11421. remove: function (a) {
  11422. if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
  11423. this.zpp_inner.modify_test();
  11424. this.zpp_inner.valmod();
  11425. var b;
  11426. b = !1;
  11427. for (var d = this.zpp_inner.inner.next; null != d;) {
  11428. if (d == a.zpp_inner) {
  11429. b = !0;
  11430. break
  11431. }
  11432. d = d.next
  11433. }
  11434. b && (null != this.zpp_inner.subber &&
  11435. this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  11436. return b
  11437. },
  11438. add: function (a) {
  11439. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  11440. },
  11441. shift: function () {
  11442. if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
  11443. this.zpp_inner.modify_test();
  11444. if (0 == this.get_length()) throw "Error: Cannot remove from empty list";
  11445. this.zpp_inner.valmod();
  11446. var a = null;
  11447. if (this.zpp_inner.reverse_flag) {
  11448. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next &&
  11449. (this.zpp_inner.at_ite = null);
  11450. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  11451. a = null == b ? this.zpp_inner.inner.next : b.next,
  11452. d = a.wrapper();
  11453. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  11454. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  11455. } else a = this.zpp_inner.inner.next, d = a.wrapper(), null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  11456. this.zpp_inner.invalidate();
  11457. return d = a.wrapper()
  11458. },
  11459. pop: function () {
  11460. if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
  11461. this.zpp_inner.modify_test();
  11462. if (0 == this.get_length()) throw "Error: Cannot remove from empty list";
  11463. this.zpp_inner.valmod();
  11464. var a = null;
  11465. if (this.zpp_inner.reverse_flag) {
  11466. var a = this.zpp_inner.inner.next,
  11467. b = a.wrapper();
  11468. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  11469. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  11470. } else {
  11471. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  11472. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  11473. a = null == d ? this.zpp_inner.inner.next : d.next,
  11474. b = a.wrapper();
  11475. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  11476. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  11477. }
  11478. this.zpp_inner.invalidate();
  11479. return b = a.wrapper()
  11480. },
  11481. unshift: function (a) {
  11482. if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
  11483. this.zpp_inner.modify_test();
  11484. this.zpp_inner.valmod();
  11485. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  11486. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite =
  11487. 0 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  11488. return b
  11489. },
  11490. push: function (a) {
  11491. if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
  11492. this.zpp_inner.modify_test();
  11493. this.zpp_inner.valmod();
  11494. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
  11495. !0;
  11496. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = 0 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  11497. return b
  11498. },
  11499. at: function (a) {
  11500. this.zpp_inner.valmod();
  11501. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  11502. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  11503. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite)
  11504. for (this.zpp_inner.at_index = 0, this.zpp_inner.at_ite = this.zpp_inner.inner.next;;) {
  11505. var b = this.zpp_inner.at_ite;
  11506. if (b.active && b.arbiter.active) break;
  11507. this.zpp_inner.at_ite = this.zpp_inner.at_ite.next
  11508. }
  11509. for (; this.zpp_inner.at_index != a;)
  11510. for (this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;;) {
  11511. b = this.zpp_inner.at_ite;
  11512. if (b.active && b.arbiter.active) break;
  11513. this.zpp_inner.at_ite =
  11514. this.zpp_inner.at_ite.next
  11515. }
  11516. return this.zpp_inner.at_ite.wrapper()
  11517. },
  11518. has: function (a) {
  11519. this.zpp_inner.valmod();
  11520. return this.zpp_inner.inner.has(a.zpp_inner)
  11521. },
  11522. get_length: function () {
  11523. this.zpp_inner.valmod();
  11524. if (this.zpp_inner.zip_length) {
  11525. this.zpp_inner.zip_length = !1;
  11526. this.zpp_inner.user_length = 0;
  11527. for (var a = this.zpp_inner.inner.next; null != a;) {
  11528. var b = a;
  11529. b.active && b.arbiter.active && this.zpp_inner.user_length++;
  11530. a = a.next
  11531. }
  11532. }
  11533. return this.zpp_inner.user_length
  11534. },
  11535. __class__: h.dynamics.ContactList
  11536. };
  11537. h.dynamics.FluidArbiter =
  11538. function () {
  11539. if (!c.dynamics.ZPP_Arbiter.internal) throw "Error: Cannot instantiate FluidArbiter derp!";
  11540. h.dynamics.Arbiter.call(this)
  11541. };
  11542. s["nape.dynamics.FluidArbiter"] = h.dynamics.FluidArbiter;
  11543. h.dynamics.FluidArbiter.__name__ = ["nape", "dynamics", "FluidArbiter"];
  11544. h.dynamics.FluidArbiter.__super__ = h.dynamics.Arbiter;
  11545. h.dynamics.FluidArbiter.prototype = I(h.dynamics.Arbiter.prototype, {
  11546. totalImpulse: function (a, b) {
  11547. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11548. var d;
  11549. if (d = null != a) {
  11550. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11551. if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  11552. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11553. d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  11554. }
  11555. }
  11556. if (d) throw "Error: Arbiter does not relate to body";
  11557. d = this.buoyancyImpulse(a);
  11558. var c = this.dragImpulse(a),
  11559. e = c;
  11560. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11561. if (e.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  11562. var f = e.zpp_inner,
  11563. l;
  11564. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11565. e.zpp_inner.validate();
  11566. l = e.zpp_inner.x;
  11567. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11568. d.zpp_inner.validate();
  11569. f.x = l + d.zpp_inner.x;
  11570. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11571. e.zpp_inner.validate();
  11572. e.zpp_inner.x;
  11573. e = c;
  11574. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11575. if (e.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  11576. f = e.zpp_inner;
  11577. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11578. e.zpp_inner.validate();
  11579. l = e.zpp_inner.y;
  11580. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11581. d.zpp_inner.validate();
  11582. f.y = l + d.zpp_inner.y;
  11583. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11584. e.zpp_inner.validate();
  11585. e.zpp_inner.y;
  11586. e = c;
  11587. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11588. if (e.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  11589. f = e.zpp_inner;
  11590. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11591. e.zpp_inner.validate();
  11592. l = e.zpp_inner.z;
  11593. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11594. d.zpp_inner.validate();
  11595. f.z = l + d.zpp_inner.z;
  11596. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  11597. e.zpp_inner.validate();
  11598. e.zpp_inner.z;
  11599. d.dispose();
  11600. return c
  11601. },
  11602. dragImpulse: function (a) {
  11603. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11604. var b;
  11605. if (b = null !=
  11606. a) {
  11607. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11608. if (b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  11609. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11610. b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  11611. }
  11612. }
  11613. if (b) throw "Error: Arbiter does not relate to body";
  11614. b = this.zpp_inner.fluidarb;
  11615. a = null == a || a.zpp_inner == this.zpp_inner.b2 ? 1 : -1;
  11616. return h.geom.Vec3.get(b.dampx * a,
  11617. b.dampy * a, b.adamp * a)
  11618. },
  11619. buoyancyImpulse: function (a) {
  11620. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11621. var b;
  11622. if (b = null != a) {
  11623. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11624. if (b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
  11625. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11626. b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
  11627. }
  11628. }
  11629. if (b) throw "Error: Arbiter does not relate to body";
  11630. b = this.zpp_inner.fluidarb;
  11631. return null == a ? h.geom.Vec3.get(b.buoyx, b.buoyy, 0) : a.zpp_inner == this.zpp_inner.b2 ? h.geom.Vec3.get(b.buoyx, b.buoyy, b.buoyy * b.r2x - b.buoyx * b.r2y) : h.geom.Vec3.get(-b.buoyx, -b.buoyy, -(b.buoyy * b.r1x - b.buoyx * b.r1y))
  11632. },
  11633. set_overlap: function (a) {
  11634. if (!this.zpp_inner.fluidarb.mutable) throw "Error: Arbiter is mutable only within a pre-handler";
  11635. if (a != a) throw "Error: FluidArbiter::overlap cannot be NaN";
  11636. if (0 >= a || a == Math.POSITIVE_INFINITY) throw "Error: FluidArbiter::overlap must be strictly positive and non infinite";
  11637. this.zpp_inner.fluidarb.overlap = a;
  11638. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11639. return this.zpp_inner.fluidarb.overlap
  11640. },
  11641. get_overlap: function () {
  11642. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11643. return this.zpp_inner.fluidarb.overlap
  11644. },
  11645. set_position: function (a) {
  11646. if (!this.zpp_inner.fluidarb.mutable) throw "Error: Arbiter is mutable only within a pre-handler";
  11647. if (null == a) throw "Error: FluidArbiter::position cannot be null";
  11648. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11649. null == this.zpp_inner.fluidarb.wrap_position && this.zpp_inner.fluidarb.getposition();
  11650. this.zpp_inner.fluidarb.wrap_position.set(a);
  11651. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11652. null == this.zpp_inner.fluidarb.wrap_position && this.zpp_inner.fluidarb.getposition();
  11653. return this.zpp_inner.fluidarb.wrap_position
  11654. },
  11655. get_position: function () {
  11656. if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
  11657. null == this.zpp_inner.fluidarb.wrap_position && this.zpp_inner.fluidarb.getposition();
  11658. return this.zpp_inner.fluidarb.wrap_position
  11659. },
  11660. __class__: h.dynamics.FluidArbiter
  11661. });
  11662. h.dynamics.InteractionFilter = function (a, b, d, g, e, f) {
  11663. null == f && (f = -1);
  11664. null == e && (e = 1);
  11665. null == g && (g = -1);
  11666. null == d && (d = 1);
  11667. null == b && (b = -1);
  11668. null == a && (a = 1);
  11669. this.zpp_inner = null;
  11670. null == c.dynamics.ZPP_InteractionFilter.zpp_pool ? this.zpp_inner = new c.dynamics.ZPP_InteractionFilter : (this.zpp_inner = c.dynamics.ZPP_InteractionFilter.zpp_pool, c.dynamics.ZPP_InteractionFilter.zpp_pool = this.zpp_inner.next, this.zpp_inner.next = null);
  11671. null;
  11672. this.zpp_inner.outer =
  11673. this;
  11674. this.zpp_inner.collisionGroup != a && (this.zpp_inner.collisionGroup = a, this.zpp_inner.invalidate());
  11675. this.zpp_inner.collisionGroup;
  11676. this.zpp_inner.collisionMask != b && (this.zpp_inner.collisionMask = b, this.zpp_inner.invalidate());
  11677. this.zpp_inner.collisionMask;
  11678. this.zpp_inner.sensorGroup != d && (this.zpp_inner.sensorGroup = d, this.zpp_inner.invalidate());
  11679. this.zpp_inner.sensorGroup;
  11680. this.zpp_inner.sensorMask != g && (this.zpp_inner.sensorMask = g, this.zpp_inner.invalidate());
  11681. this.zpp_inner.sensorMask;
  11682. this.zpp_inner.fluidGroup !=
  11683. e && (this.zpp_inner.fluidGroup = e, this.zpp_inner.invalidate());
  11684. this.zpp_inner.fluidGroup;
  11685. this.zpp_inner.fluidMask != f && (this.zpp_inner.fluidMask = f, this.zpp_inner.invalidate());
  11686. this.zpp_inner.fluidMask
  11687. };
  11688. s["nape.dynamics.InteractionFilter"] = h.dynamics.InteractionFilter;
  11689. h.dynamics.InteractionFilter.__name__ = ["nape", "dynamics", "InteractionFilter"];
  11690. h.dynamics.InteractionFilter.prototype = {
  11691. toString: function () {
  11692. return "{ collision: " + $.hex(this.zpp_inner.collisionGroup, 8) + "~" + $.hex(this.zpp_inner.collisionMask,
  11693. 8) + " sensor: " + $.hex(this.zpp_inner.sensorGroup, 8) + "~" + $.hex(this.zpp_inner.sensorMask, 8) + " fluid: " + $.hex(this.zpp_inner.fluidGroup, 8) + "~" + $.hex(this.zpp_inner.fluidMask, 8) + " }"
  11694. },
  11695. copy: function () {
  11696. return new h.dynamics.InteractionFilter(this.zpp_inner.collisionGroup, this.zpp_inner.collisionMask, this.zpp_inner.sensorGroup, this.zpp_inner.sensorMask, this.zpp_inner.fluidGroup, this.zpp_inner.fluidMask)
  11697. },
  11698. shouldFlow: function (a) {
  11699. if (null == a) throw "Error: filter argument cannot be null for shouldFlow";
  11700. return this.zpp_inner.shouldFlow(a.zpp_inner)
  11701. },
  11702. shouldSense: function (a) {
  11703. if (null == a) throw "Error: filter argument cannot be null for shouldSense";
  11704. return this.zpp_inner.shouldSense(a.zpp_inner)
  11705. },
  11706. shouldCollide: function (a) {
  11707. if (null == a) throw "Error: filter argument cannot be null for shouldCollide";
  11708. return this.zpp_inner.shouldCollide(a.zpp_inner)
  11709. },
  11710. set_fluidMask: function (a) {
  11711. this.zpp_inner.fluidMask != a && (this.zpp_inner.fluidMask = a, this.zpp_inner.invalidate());
  11712. return this.zpp_inner.fluidMask
  11713. },
  11714. get_fluidMask: function () {
  11715. return this.zpp_inner.fluidMask
  11716. },
  11717. set_fluidGroup: function (a) {
  11718. this.zpp_inner.fluidGroup !=
  11719. a && (this.zpp_inner.fluidGroup = a, this.zpp_inner.invalidate());
  11720. return this.zpp_inner.fluidGroup
  11721. },
  11722. get_fluidGroup: function () {
  11723. return this.zpp_inner.fluidGroup
  11724. },
  11725. set_sensorMask: function (a) {
  11726. this.zpp_inner.sensorMask != a && (this.zpp_inner.sensorMask = a, this.zpp_inner.invalidate());
  11727. return this.zpp_inner.sensorMask
  11728. },
  11729. get_sensorMask: function () {
  11730. return this.zpp_inner.sensorMask
  11731. },
  11732. set_sensorGroup: function (a) {
  11733. this.zpp_inner.sensorGroup != a && (this.zpp_inner.sensorGroup = a, this.zpp_inner.invalidate());
  11734. return this.zpp_inner.sensorGroup
  11735. },
  11736. get_sensorGroup: function () {
  11737. return this.zpp_inner.sensorGroup
  11738. },
  11739. set_collisionMask: function (a) {
  11740. this.zpp_inner.collisionMask != a && (this.zpp_inner.collisionMask = a, this.zpp_inner.invalidate());
  11741. return this.zpp_inner.collisionMask
  11742. },
  11743. get_collisionMask: function () {
  11744. return this.zpp_inner.collisionMask
  11745. },
  11746. set_collisionGroup: function (a) {
  11747. this.zpp_inner.collisionGroup != a && (this.zpp_inner.collisionGroup = a, this.zpp_inner.invalidate());
  11748. return this.zpp_inner.collisionGroup
  11749. },
  11750. get_collisionGroup: function () {
  11751. return this.zpp_inner.collisionGroup
  11752. },
  11753. get_shapes: function () {
  11754. null == this.zpp_inner.wrap_shapes && (this.zpp_inner.wrap_shapes = c.util.ZPP_ShapeList.get(this.zpp_inner.shapes, !0));
  11755. return this.zpp_inner.wrap_shapes
  11756. },
  11757. get_userData: function () {
  11758. null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
  11759. return this.zpp_inner.userData
  11760. },
  11761. __class__: h.dynamics.InteractionFilter
  11762. };
  11763. h.dynamics.InteractionGroup = function (a) {
  11764. null == a && (a = !1);
  11765. this.zpp_inner = null;
  11766. this.zpp_inner = new c.dynamics.ZPP_InteractionGroup;
  11767. this.zpp_inner.outer = this;
  11768. this.zpp_inner.ignore !=
  11769. a && (this.zpp_inner.invalidate(!0), this.zpp_inner.ignore = a);
  11770. this.zpp_inner.ignore
  11771. };
  11772. s["nape.dynamics.InteractionGroup"] = h.dynamics.InteractionGroup;
  11773. h.dynamics.InteractionGroup.__name__ = ["nape", "dynamics", "InteractionGroup"];
  11774. h.dynamics.InteractionGroup.prototype = {
  11775. toString: function () {
  11776. var a = "InteractionGroup";
  11777. this.zpp_inner.ignore && (a += ":ignore");
  11778. return a
  11779. },
  11780. get_groups: function () {
  11781. null == this.zpp_inner.wrap_groups && (this.zpp_inner.wrap_groups = c.util.ZPP_InteractionGroupList.get(this.zpp_inner.groups, !0));
  11782. return this.zpp_inner.wrap_groups
  11783. },
  11784. get_interactors: function () {
  11785. null == this.zpp_inner.wrap_interactors && (this.zpp_inner.wrap_interactors = c.util.ZPP_InteractorList.get(this.zpp_inner.interactors, !0));
  11786. return this.zpp_inner.wrap_interactors
  11787. },
  11788. set_ignore: function (a) {
  11789. this.zpp_inner.ignore != a && (this.zpp_inner.invalidate(!0), this.zpp_inner.ignore = a);
  11790. return this.zpp_inner.ignore
  11791. },
  11792. get_ignore: function () {
  11793. return this.zpp_inner.ignore
  11794. },
  11795. set_group: function (a) {
  11796. if (a == this) throw "Error: Cannot assign InteractionGroup to itself";
  11797. this.zpp_inner.setGroup(null == a ? null : a.zpp_inner);
  11798. return null == this.zpp_inner.group ? null : this.zpp_inner.group.outer
  11799. },
  11800. get_group: function () {
  11801. return null == this.zpp_inner.group ? null : this.zpp_inner.group.outer
  11802. },
  11803. __class__: h.dynamics.InteractionGroup
  11804. };
  11805. h.dynamics.InteractionGroupIterator = function () {
  11806. this.zpp_next = null;
  11807. this.zpp_critical = !1;
  11808. this.zpp_i = 0;
  11809. this.zpp_inner = null;
  11810. if (!c.util.ZPP_InteractionGroupList.internal) throw "Error: Cannot instantiate InteractionGroupIterator derp!";
  11811. };
  11812. s["nape.dynamics.InteractionGroupIterator"] =
  11813. h.dynamics.InteractionGroupIterator;
  11814. h.dynamics.InteractionGroupIterator.__name__ = ["nape", "dynamics", "InteractionGroupIterator"];
  11815. h.dynamics.InteractionGroupIterator.get = function (a) {
  11816. var b = null == h.dynamics.InteractionGroupIterator.zpp_pool ? function (a) {
  11817. c.util.ZPP_InteractionGroupList.internal = !0;
  11818. a = new h.dynamics.InteractionGroupIterator;
  11819. c.util.ZPP_InteractionGroupList.internal = !1;
  11820. return a
  11821. }(this) : function (a) {
  11822. a = h.dynamics.InteractionGroupIterator.zpp_pool;
  11823. h.dynamics.InteractionGroupIterator.zpp_pool = a.zpp_next;
  11824. return a
  11825. }(this);
  11826. b.zpp_i = 0;
  11827. b.zpp_inner = a;
  11828. b.zpp_critical = !1;
  11829. return b
  11830. };
  11831. h.dynamics.InteractionGroupIterator.prototype = {
  11832. next: function () {
  11833. this.zpp_critical = !1;
  11834. return this.zpp_inner.at(this.zpp_i++)
  11835. },
  11836. hasNext: function () {
  11837. this.zpp_inner.zpp_inner.valmod();
  11838. var a = this.zpp_inner.get_length();
  11839. this.zpp_critical = !0;
  11840. if (this.zpp_i < a) return !0;
  11841. this.zpp_next = h.dynamics.InteractionGroupIterator.zpp_pool;
  11842. h.dynamics.InteractionGroupIterator.zpp_pool = this;
  11843. this.zpp_inner = null;
  11844. return !1
  11845. },
  11846. __class__: h.dynamics.InteractionGroupIterator
  11847. };
  11848. h.dynamics.InteractionGroupList = function () {
  11849. this.zpp_inner = null;
  11850. this.zpp_inner = new c.util.ZPP_InteractionGroupList;
  11851. this.zpp_inner.outer = this
  11852. };
  11853. s["nape.dynamics.InteractionGroupList"] = h.dynamics.InteractionGroupList;
  11854. h.dynamics.InteractionGroupList.__name__ = ["nape", "dynamics", "InteractionGroupList"];
  11855. h.dynamics.InteractionGroupList.fromArray = function (a) {
  11856. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  11857. for (var b = new h.dynamics.InteractionGroupList, d = 0; d < a.length;) {
  11858. var c = a[d];
  11859. ++d;
  11860. b.push(c)
  11861. }
  11862. return b
  11863. };
  11864. h.dynamics.InteractionGroupList.prototype = {
  11865. filter: function (a) {
  11866. if (null == a) throw "Error: Cannot select elements of list with null";
  11867. for (var b = 0; b < this.get_length();) {
  11868. var d = this.at(b);
  11869. try {
  11870. a(d) ? b++ : this.remove(d)
  11871. } catch (c) {
  11872. break
  11873. }
  11874. }
  11875. return this
  11876. },
  11877. foreach: function (a) {
  11878. if (null == a) throw "Error: Cannot execute null on list elements";
  11879. var b;
  11880. this.zpp_inner.valmod();
  11881. for (b = h.dynamics.InteractionGroupIterator.get(this); b.hasNext();) try {
  11882. var d = a,
  11883. c;
  11884. b.zpp_critical = !1;
  11885. c = b.zpp_inner.at(b.zpp_i++);
  11886. d(c)
  11887. } catch (e) {
  11888. b.zpp_next = h.dynamics.InteractionGroupIterator.zpp_pool;
  11889. h.dynamics.InteractionGroupIterator.zpp_pool = b;
  11890. b.zpp_inner = null;
  11891. break
  11892. }
  11893. return this
  11894. },
  11895. toString: function () {
  11896. var a = "[",
  11897. b = !0,
  11898. d;
  11899. this.zpp_inner.valmod();
  11900. for (d = h.dynamics.InteractionGroupIterator.get(this); d.hasNext();) {
  11901. var c = d.next();
  11902. b || (a += ",");
  11903. a += null == c ? "NULL" : c.toString();
  11904. b = !1
  11905. }
  11906. return a + "]"
  11907. },
  11908. merge: function (a) {
  11909. if (null == a) throw "Error: Cannot merge with null list";
  11910. a.zpp_inner.valmod();
  11911. for (a = h.dynamics.InteractionGroupIterator.get(a); a.hasNext();) {
  11912. var b = a.next();
  11913. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) :
  11914. this.unshift(b))
  11915. }
  11916. },
  11917. copy: function (a) {
  11918. null == a && (a = !1);
  11919. var b = new h.dynamics.InteractionGroupList,
  11920. d;
  11921. this.zpp_inner.valmod();
  11922. for (d = h.dynamics.InteractionGroupIterator.get(this); d.hasNext();) {
  11923. var c = d.next();
  11924. b.push(a ? function (a) {
  11925. throw "Error: InteractionGroup is not a copyable type";
  11926. }(this) : c)
  11927. }
  11928. return b
  11929. },
  11930. iterator: function () {
  11931. this.zpp_inner.valmod();
  11932. return h.dynamics.InteractionGroupIterator.get(this)
  11933. },
  11934. empty: function () {
  11935. return null == this.zpp_inner.inner.head
  11936. },
  11937. clear: function () {
  11938. if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
  11939. if (this.zpp_inner.reverse_flag)
  11940. for (; null != this.zpp_inner.inner.head;) this.pop();
  11941. else
  11942. for (; null != this.zpp_inner.inner.head;) this.shift()
  11943. },
  11944. remove: function (a) {
  11945. if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
  11946. this.zpp_inner.modify_test();
  11947. this.zpp_inner.valmod();
  11948. var b;
  11949. b = !1;
  11950. for (var d = this.zpp_inner.inner.head; null != d;) {
  11951. if (d.elt == a.zpp_inner) {
  11952. b = !0;
  11953. break
  11954. }
  11955. d = d.next
  11956. }
  11957. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner),
  11958. this.zpp_inner.invalidate());
  11959. return b
  11960. },
  11961. add: function (a) {
  11962. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  11963. },
  11964. shift: function () {
  11965. if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
  11966. this.zpp_inner.modify_test();
  11967. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  11968. this.zpp_inner.valmod();
  11969. var a = null;
  11970. if (this.zpp_inner.reverse_flag) {
  11971. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  11972. var b = 1 == this.get_length() ?
  11973. null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  11974. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  11975. d = a.outer;
  11976. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  11977. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  11978. } else a = this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  11979. this.zpp_inner.invalidate();
  11980. return d = a.outer
  11981. },
  11982. pop: function () {
  11983. if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
  11984. this.zpp_inner.modify_test();
  11985. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  11986. this.zpp_inner.valmod();
  11987. var a = null;
  11988. if (this.zpp_inner.reverse_flag) {
  11989. var a = this.zpp_inner.inner.head.elt,
  11990. b = a.outer;
  11991. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  11992. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  11993. } else {
  11994. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  11995. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
  11996. 2),
  11997. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  11998. b = a.outer;
  11999. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  12000. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  12001. }
  12002. this.zpp_inner.invalidate();
  12003. return b = a.outer
  12004. },
  12005. unshift: function (a) {
  12006. if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
  12007. this.zpp_inner.modify_test();
  12008. this.zpp_inner.valmod();
  12009. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  12010. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite =
  12011. null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  12012. return b
  12013. },
  12014. push: function (a) {
  12015. if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
  12016. this.zpp_inner.modify_test();
  12017. this.zpp_inner.valmod();
  12018. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
  12019. !0;
  12020. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  12021. return b
  12022. },
  12023. at: function (a) {
  12024. this.zpp_inner.valmod();
  12025. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  12026. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  12027. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  12028. else
  12029. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  12030. return this.zpp_inner.at_ite.elt.outer
  12031. },
  12032. has: function (a) {
  12033. this.zpp_inner.valmod();
  12034. return this.zpp_inner.inner.has(a.zpp_inner)
  12035. },
  12036. get_length: function () {
  12037. this.zpp_inner.valmod();
  12038. this.zpp_inner.zip_length &&
  12039. (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  12040. return this.zpp_inner.user_length
  12041. },
  12042. __class__: h.dynamics.InteractionGroupList
  12043. };
  12044. h.geom = {};
  12045. h.geom.AABB = function (a, b, d, g) {
  12046. null == g && (g = 0);
  12047. null == d && (d = 0);
  12048. null == b && (b = 0);
  12049. null == a && (a = 0);
  12050. this.zpp_inner = null;
  12051. if (a != a || b != b) throw "Error: AABB position cannot be NaN";
  12052. if (d != d || g != g) throw "Error: AABB dimensions cannot be NaN";
  12053. this.zpp_inner = c.geom.ZPP_AABB.get(a, b, a + d, b + g);
  12054. this.zpp_inner.outer = this
  12055. };
  12056. s["nape.geom.AABB"] = h.geom.AABB;
  12057. h.geom.AABB.__name__ = ["nape", "geom", "AABB"];
  12058. h.geom.AABB.fromRect = function (a) {
  12059. if (null == a) throw "Error: Cannot create AABB from null Rectangle";
  12060. return new h.geom.AABB(a.x, a.y, a.width, a.height)
  12061. };
  12062. h.geom.AABB.prototype = {
  12063. toString: function () {
  12064. this.zpp_inner.validate();
  12065. return this.zpp_inner.toString()
  12066. },
  12067. set_height: function (a) {
  12068. if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
  12069. this.zpp_inner.validate();
  12070. if (this.zpp_inner.height() != a) {
  12071. if (a != a) throw "Error: AABB::height cannot be NaN";
  12072. if (0 > a) throw "Error: AABB::height (" +
  12073. a + ") must be >= 0";
  12074. var b = this.zpp_inner;
  12075. this.zpp_inner.validate();
  12076. b.maxy = this.zpp_inner.miny + a;
  12077. this.zpp_inner.invalidate()
  12078. }
  12079. this.zpp_inner.validate();
  12080. return this.zpp_inner.height()
  12081. },
  12082. get_height: function () {
  12083. this.zpp_inner.validate();
  12084. return this.zpp_inner.height()
  12085. },
  12086. set_width: function (a) {
  12087. if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
  12088. this.zpp_inner.validate();
  12089. if (this.zpp_inner.width() != a) {
  12090. if (a != a) throw "Error: AABB::width cannot be NaN";
  12091. if (0 > a) throw "Error: AABB::width (" + a + ") must be >= 0";
  12092. var b = this.zpp_inner;
  12093. this.zpp_inner.validate();
  12094. b.maxx = this.zpp_inner.minx + a;
  12095. this.zpp_inner.invalidate()
  12096. }
  12097. this.zpp_inner.validate();
  12098. return this.zpp_inner.width()
  12099. },
  12100. get_width: function () {
  12101. this.zpp_inner.validate();
  12102. return this.zpp_inner.width()
  12103. },
  12104. set_y: function (a) {
  12105. if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
  12106. this.zpp_inner.validate();
  12107. if (this.zpp_inner.miny != a) {
  12108. if (a != a) throw "Error: AABB::y cannot be NaN";
  12109. this.zpp_inner.maxy += a - this.zpp_inner.miny;
  12110. this.zpp_inner.miny = a;
  12111. this.zpp_inner.invalidate()
  12112. }
  12113. this.zpp_inner.validate();
  12114. return this.zpp_inner.miny
  12115. },
  12116. get_y: function () {
  12117. this.zpp_inner.validate();
  12118. return this.zpp_inner.miny
  12119. },
  12120. set_x: function (a) {
  12121. if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
  12122. this.zpp_inner.validate();
  12123. if (this.zpp_inner.minx != a) {
  12124. if (a != a) throw "Error: AABB::x cannot be NaN";
  12125. this.zpp_inner.maxx += a - this.zpp_inner.minx;
  12126. this.zpp_inner.minx = a;
  12127. this.zpp_inner.invalidate()
  12128. }
  12129. this.zpp_inner.validate();
  12130. return this.zpp_inner.minx
  12131. },
  12132. get_x: function () {
  12133. this.zpp_inner.validate();
  12134. return this.zpp_inner.minx
  12135. },
  12136. set_max: function (a) {
  12137. if (null !=
  12138. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12139. if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
  12140. if (null == a) throw "Error: Cannot assign null to AABB::max";
  12141. this.zpp_inner.validate();
  12142. var b;
  12143. b = this.zpp_inner.minx;
  12144. this.zpp_inner.validate();
  12145. (b = b != this.zpp_inner.minx) || (this.zpp_inner.validate(), b = this.zpp_inner.miny, this.zpp_inner.validate(), b = b != this.zpp_inner.miny);
  12146. if (b) throw "Error: AABB::max components cannot be NaN";
  12147. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12148. a.zpp_inner.validate();
  12149. if (a.zpp_inner.x < this.zpp_inner.getmin().get_x()) throw "Error: Assignment would cause negative width";
  12150. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12151. a.zpp_inner.validate();
  12152. if (a.zpp_inner.y < this.zpp_inner.getmin().get_y()) throw "Error: Assignment would cause negative height";
  12153. this.zpp_inner.getmax().set(a);
  12154. return this.zpp_inner.getmax()
  12155. },
  12156. get_max: function () {
  12157. return this.zpp_inner.getmax()
  12158. },
  12159. set_min: function (a) {
  12160. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12161. if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
  12162. if (null == a) throw "Error: Cannot assign null to AABB::min";
  12163. var b;
  12164. this.zpp_inner.validate();
  12165. b = this.zpp_inner.minx;
  12166. this.zpp_inner.validate();
  12167. (b = b != this.zpp_inner.minx) || (this.zpp_inner.validate(), b = this.zpp_inner.miny, this.zpp_inner.validate(), b = b != this.zpp_inner.miny);
  12168. if (b) throw "Error: AABB::min components cannot be NaN";
  12169. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12170. a.zpp_inner.validate();
  12171. if (a.zpp_inner.x >
  12172. this.zpp_inner.getmax().get_x()) throw "Error: Assignment would cause negative width";
  12173. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12174. a.zpp_inner.validate();
  12175. if (a.zpp_inner.y > this.zpp_inner.getmax().get_y()) throw "Error: Assignment would cause negative height";
  12176. this.zpp_inner.getmin().set(a);
  12177. return this.zpp_inner.getmin()
  12178. },
  12179. get_min: function () {
  12180. return this.zpp_inner.getmin()
  12181. },
  12182. toRect: function () {
  12183. var a = k.geom.Rectangle;
  12184. this.zpp_inner.validate();
  12185. var b = this.zpp_inner.minx;
  12186. this.zpp_inner.validate();
  12187. var d = this.zpp_inner.miny;
  12188. this.zpp_inner.validate();
  12189. var c = this.zpp_inner.width(),
  12190. e;
  12191. this.zpp_inner.validate();
  12192. e = this.zpp_inner.height();
  12193. return new a(b, d, c, e)
  12194. },
  12195. copy: function () {
  12196. this.zpp_inner.validate();
  12197. return this.zpp_inner.copy().wrapper()
  12198. },
  12199. __class__: h.geom.AABB
  12200. };
  12201. h.geom.ConvexResult = function () {
  12202. this.zpp_inner = null;
  12203. if (!c.geom.ZPP_ConvexRayResult.internal) throw "Error: ConvexResult cannot be instantiated derp!";
  12204. };
  12205. s["nape.geom.ConvexResult"] = h.geom.ConvexResult;
  12206. h.geom.ConvexResult.__name__ = ["nape", "geom",
  12207. "ConvexResult"
  12208. ];
  12209. h.geom.ConvexResult.prototype = {
  12210. toString: function () {
  12211. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12212. var a = "{ shape: " + K.string(function (a) {
  12213. if (null != a.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12214. return a.zpp_inner.shape
  12215. }(this)) + " toi: ";
  12216. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12217. return a + this.zpp_inner.toiDistance + " }"
  12218. },
  12219. dispose: function () {
  12220. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12221. this.zpp_inner.free()
  12222. },
  12223. get_shape: function () {
  12224. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12225. return this.zpp_inner.shape
  12226. },
  12227. get_toi: function () {
  12228. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12229. return this.zpp_inner.toiDistance
  12230. },
  12231. get_position: function () {
  12232. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12233. return this.zpp_inner.position
  12234. },
  12235. get_normal: function () {
  12236. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  12237. return this.zpp_inner.normal
  12238. },
  12239. __class__: h.geom.ConvexResult
  12240. };
  12241. h.geom.ConvexResultIterator = function () {
  12242. this.zpp_next = null;
  12243. this.zpp_critical = !1;
  12244. this.zpp_i = 0;
  12245. this.zpp_inner = null;
  12246. if (!c.util.ZPP_ConvexResultList.internal) throw "Error: Cannot instantiate ConvexResultIterator derp!";
  12247. };
  12248. s["nape.geom.ConvexResultIterator"] = h.geom.ConvexResultIterator;
  12249. h.geom.ConvexResultIterator.__name__ = ["nape", "geom", "ConvexResultIterator"];
  12250. h.geom.ConvexResultIterator.get = function (a) {
  12251. var b = null == h.geom.ConvexResultIterator.zpp_pool ?
  12252. function (a) {
  12253. c.util.ZPP_ConvexResultList.internal = !0;
  12254. a = new h.geom.ConvexResultIterator;
  12255. c.util.ZPP_ConvexResultList.internal = !1;
  12256. return a
  12257. }(this) : function (a) {
  12258. a = h.geom.ConvexResultIterator.zpp_pool;
  12259. h.geom.ConvexResultIterator.zpp_pool = a.zpp_next;
  12260. return a
  12261. }(this);
  12262. b.zpp_i = 0;
  12263. b.zpp_inner = a;
  12264. b.zpp_critical = !1;
  12265. return b
  12266. };
  12267. h.geom.ConvexResultIterator.prototype = {
  12268. next: function () {
  12269. this.zpp_critical = !1;
  12270. return this.zpp_inner.at(this.zpp_i++)
  12271. },
  12272. hasNext: function () {
  12273. this.zpp_inner.zpp_inner.valmod();
  12274. var a = this.zpp_inner.get_length();
  12275. this.zpp_critical = !0;
  12276. if (this.zpp_i < a) return !0;
  12277. this.zpp_next = h.geom.ConvexResultIterator.zpp_pool;
  12278. h.geom.ConvexResultIterator.zpp_pool = this;
  12279. this.zpp_inner = null;
  12280. return !1
  12281. },
  12282. __class__: h.geom.ConvexResultIterator
  12283. };
  12284. h.geom.ConvexResultList = function () {
  12285. this.zpp_inner = null;
  12286. this.zpp_inner = new c.util.ZPP_ConvexResultList;
  12287. this.zpp_inner.outer = this
  12288. };
  12289. s["nape.geom.ConvexResultList"] = h.geom.ConvexResultList;
  12290. h.geom.ConvexResultList.__name__ = ["nape", "geom", "ConvexResultList"];
  12291. h.geom.ConvexResultList.fromArray = function (a) {
  12292. if (null ==
  12293. a) throw "Error: Cannot convert null Array to Nape list";
  12294. for (var b = new h.geom.ConvexResultList, d = 0; d < a.length;) {
  12295. var c = a[d];
  12296. ++d;
  12297. b.push(c)
  12298. }
  12299. return b
  12300. };
  12301. h.geom.ConvexResultList.prototype = {
  12302. filter: function (a) {
  12303. if (null == a) throw "Error: Cannot select elements of list with null";
  12304. for (var b = 0; b < this.get_length();) {
  12305. var d = this.at(b);
  12306. try {
  12307. a(d) ? b++ : this.remove(d)
  12308. } catch (c) {
  12309. break
  12310. }
  12311. }
  12312. return this
  12313. },
  12314. foreach: function (a) {
  12315. if (null == a) throw "Error: Cannot execute null on list elements";
  12316. var b;
  12317. this.zpp_inner.valmod();
  12318. for (b = h.geom.ConvexResultIterator.get(this); b.hasNext();) try {
  12319. var d =
  12320. a,
  12321. c;
  12322. b.zpp_critical = !1;
  12323. c = b.zpp_inner.at(b.zpp_i++);
  12324. d(c)
  12325. } catch (e) {
  12326. b.zpp_next = h.geom.ConvexResultIterator.zpp_pool;
  12327. h.geom.ConvexResultIterator.zpp_pool = b;
  12328. b.zpp_inner = null;
  12329. break
  12330. }
  12331. return this
  12332. },
  12333. toString: function () {
  12334. var a = "[",
  12335. b = !0,
  12336. d;
  12337. this.zpp_inner.valmod();
  12338. for (d = h.geom.ConvexResultIterator.get(this); d.hasNext();) {
  12339. var c = d.next();
  12340. b || (a += ",");
  12341. a += null == c ? "NULL" : c.toString();
  12342. b = !1
  12343. }
  12344. return a + "]"
  12345. },
  12346. merge: function (a) {
  12347. if (null == a) throw "Error: Cannot merge with null list";
  12348. a.zpp_inner.valmod();
  12349. for (a = h.geom.ConvexResultIterator.get(a); a.hasNext();) {
  12350. var b =
  12351. a.next();
  12352. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  12353. }
  12354. },
  12355. copy: function (a) {
  12356. null == a && (a = !1);
  12357. var b = new h.geom.ConvexResultList,
  12358. d;
  12359. this.zpp_inner.valmod();
  12360. for (d = h.geom.ConvexResultIterator.get(this); d.hasNext();) {
  12361. var c = d.next();
  12362. b.push(a ? function (a) {
  12363. throw "Error: ConvexResult is not a copyable type";
  12364. }(this) : c)
  12365. }
  12366. return b
  12367. },
  12368. iterator: function () {
  12369. this.zpp_inner.valmod();
  12370. return h.geom.ConvexResultIterator.get(this)
  12371. },
  12372. empty: function () {
  12373. return null == this.zpp_inner.inner.head
  12374. },
  12375. clear: function () {
  12376. if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
  12377. if (this.zpp_inner.reverse_flag)
  12378. for (; null != this.zpp_inner.inner.head;) this.pop();
  12379. else
  12380. for (; null != this.zpp_inner.inner.head;) this.shift()
  12381. },
  12382. remove: function (a) {
  12383. if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
  12384. this.zpp_inner.modify_test();
  12385. this.zpp_inner.valmod();
  12386. var b;
  12387. b = !1;
  12388. for (var d = this.zpp_inner.inner.head; null != d;) {
  12389. if (d.elt == a) {
  12390. b = !0;
  12391. break
  12392. }
  12393. d = d.next
  12394. }
  12395. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a), this.zpp_inner.invalidate());
  12396. return b
  12397. },
  12398. add: function (a) {
  12399. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  12400. },
  12401. shift: function () {
  12402. if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
  12403. this.zpp_inner.modify_test();
  12404. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  12405. this.zpp_inner.valmod();
  12406. var a = null;
  12407. if (this.zpp_inner.reverse_flag) {
  12408. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  12409. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
  12410. 2),
  12411. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt;
  12412. null != this.zpp_inner.subber && this.zpp_inner.subber(a);
  12413. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  12414. } else a = this.zpp_inner.inner.head.elt, null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  12415. this.zpp_inner.invalidate();
  12416. return a
  12417. },
  12418. pop: function () {
  12419. if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
  12420. this.zpp_inner.modify_test();
  12421. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  12422. this.zpp_inner.valmod();
  12423. var a = null;
  12424. if (this.zpp_inner.reverse_flag) a = this.zpp_inner.inner.head.elt, null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  12425. else {
  12426. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  12427. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  12428. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt;
  12429. null != this.zpp_inner.subber && this.zpp_inner.subber(a);
  12430. this.zpp_inner.dontremove ||
  12431. this.zpp_inner.inner.erase(b)
  12432. }
  12433. this.zpp_inner.invalidate();
  12434. return a
  12435. },
  12436. unshift: function (a) {
  12437. if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
  12438. this.zpp_inner.modify_test();
  12439. this.zpp_inner.valmod();
  12440. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  12441. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite,
  12442. a)) : this.zpp_inner.inner.add(a), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  12443. return b
  12444. },
  12445. push: function (a) {
  12446. if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
  12447. this.zpp_inner.modify_test();
  12448. this.zpp_inner.valmod();
  12449. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  12450. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
  12451. 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  12452. return b
  12453. },
  12454. at: function (a) {
  12455. this.zpp_inner.valmod();
  12456. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  12457. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  12458. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  12459. else
  12460. for (; this.zpp_inner.at_index !=
  12461. a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  12462. return this.zpp_inner.at_ite.elt
  12463. },
  12464. has: function (a) {
  12465. this.zpp_inner.valmod();
  12466. return this.zpp_inner.inner.has(a)
  12467. },
  12468. get_length: function () {
  12469. this.zpp_inner.valmod();
  12470. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  12471. return this.zpp_inner.user_length
  12472. },
  12473. __class__: h.geom.ConvexResultList
  12474. };
  12475. h.geom.Geom = function () {};
  12476. s["nape.geom.Geom"] = h.geom.Geom;
  12477. h.geom.Geom.__name__ = ["nape",
  12478. "geom", "Geom"
  12479. ];
  12480. h.geom.Geom.distanceBody = function (a, b, d, g) {
  12481. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12482. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12483. d.zpp_inner.immutable();
  12484. g.zpp_inner.immutable();
  12485. if (a.zpp_inner.wrap_shapes.empty() || b.zpp_inner.wrap_shapes.empty()) throw "Error: Bodies cannot be empty in calculating distances";
  12486. for (var e = a.zpp_inner.shapes.head; null != e;) {
  12487. var f = e.elt;
  12488. c.geom.ZPP_Geom.validateShape(f);
  12489. e = e.next
  12490. }
  12491. for (e = b.zpp_inner.shapes.head; null !=
  12492. e;) f = e.elt, c.geom.ZPP_Geom.validateShape(f), e = e.next;
  12493. return c.geom.ZPP_SweepDistance.distanceBody(a.zpp_inner, b.zpp_inner, d.zpp_inner, g.zpp_inner)
  12494. };
  12495. h.geom.Geom.distance = function (a, b, d, g) {
  12496. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12497. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12498. d.zpp_inner.immutable();
  12499. g.zpp_inner.immutable();
  12500. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null) || null == (null != b.zpp_inner.body ? b.zpp_inner.body.outer :
  12501. null)) throw "Error: Shape must be part of a Body to calculate distances";
  12502. c.geom.ZPP_Geom.validateShape(a.zpp_inner);
  12503. c.geom.ZPP_Geom.validateShape(b.zpp_inner);
  12504. var e;
  12505. null == c.geom.ZPP_Vec2.zpp_pool ? e = new c.geom.ZPP_Vec2 : (e = c.geom.ZPP_Vec2.zpp_pool, c.geom.ZPP_Vec2.zpp_pool = e.next, e.next = null);
  12506. e.weak = !1;
  12507. a = c.geom.ZPP_SweepDistance.distance(a.zpp_inner, b.zpp_inner, d.zpp_inner, g.zpp_inner, e, 1E100);
  12508. null != e.outer && (e.outer.zpp_inner = null, e.outer = null);
  12509. e._isimmutable = null;
  12510. e._validate = null;
  12511. e._invalidate = null;
  12512. e.next = c.geom.ZPP_Vec2.zpp_pool;
  12513. c.geom.ZPP_Vec2.zpp_pool = e;
  12514. return a
  12515. };
  12516. h.geom.Geom.intersectsBody = function (a, b) {
  12517. if (a.zpp_inner.wrap_shapes.empty() || b.zpp_inner.wrap_shapes.empty()) throw "Error: Bodies must have shapes to test for intersection.";
  12518. for (var d = a.zpp_inner.shapes.head; null != d;) {
  12519. var g = d.elt;
  12520. c.geom.ZPP_Geom.validateShape(g);
  12521. d = d.next
  12522. }
  12523. for (d = b.zpp_inner.shapes.head; null != d;) g = d.elt, c.geom.ZPP_Geom.validateShape(g), d = d.next;
  12524. if (a.zpp_inner.aabb.intersect(b.zpp_inner.aabb))
  12525. for (d = a.zpp_inner.shapes.head; null !=
  12526. d;) {
  12527. for (var g = d.elt, e = b.zpp_inner.shapes.head; null != e;) {
  12528. if (c.geom.ZPP_Collide.testCollide_safe(g, e.elt)) return !0;
  12529. e = e.next
  12530. }
  12531. d = d.next
  12532. }
  12533. return !1
  12534. };
  12535. h.geom.Geom.intersects = function (a, b) {
  12536. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null) || null == (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null)) throw "Error: Shape must be part of a Body to calculate intersection";
  12537. c.geom.ZPP_Geom.validateShape(a.zpp_inner);
  12538. c.geom.ZPP_Geom.validateShape(b.zpp_inner);
  12539. return a.zpp_inner.aabb.intersect(b.zpp_inner.aabb) &&
  12540. c.geom.ZPP_Collide.testCollide_safe(a.zpp_inner, b.zpp_inner)
  12541. };
  12542. h.geom.Geom.contains = function (a, b) {
  12543. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null) || null == (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null)) throw "Error: Shape must be part of a Body to calculate containment";
  12544. c.geom.ZPP_Geom.validateShape(a.zpp_inner);
  12545. c.geom.ZPP_Geom.validateShape(b.zpp_inner);
  12546. return c.geom.ZPP_Collide.containTest(a.zpp_inner, b.zpp_inner)
  12547. };
  12548. h.geom.GeomPoly = function (a) {
  12549. this.zpp_pool = this.zpp_inner = null;
  12550. this.zpp_inner =
  12551. new c.geom.ZPP_GeomPoly(this);
  12552. if (null != a) {
  12553. if (F.Boot.__instanceof(a, Array))
  12554. for (var b = a, d = 0; d < b.length;) {
  12555. var g = b[d];
  12556. ++d;
  12557. if (null == g) throw "Error: Array<Vec2> contains null objects";
  12558. if (!F.Boot.__instanceof(g, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
  12559. var e = g;
  12560. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12561. this.zpp_inner.vertices = function (a) {
  12562. var b = c.geom.ZPP_GeomVert.get(function (a) {
  12563. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12564. e.zpp_inner.validate();
  12565. return e.zpp_inner.x
  12566. }(a), function (a) {
  12567. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12568. e.zpp_inner.validate();
  12569. return e.zpp_inner.y
  12570. }(a));
  12571. null == a.zpp_inner.vertices ? a.zpp_inner.vertices = b.prev = b.next = b : (b.prev = a.zpp_inner.vertices, b.next = a.zpp_inner.vertices.next, a.zpp_inner.vertices.next.prev = b, a.zpp_inner.vertices.next = b);
  12572. return b
  12573. }(this)
  12574. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  12575. for (b = a.iterator(); b.hasNext();) {
  12576. e = b.next();
  12577. if (null == e) throw "Error: Vec2List contains null objects";
  12578. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12579. this.zpp_inner.vertices = function (a) {
  12580. var b = c.geom.ZPP_GeomVert.get(function (a) {
  12581. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12582. e.zpp_inner.validate();
  12583. return e.zpp_inner.x
  12584. }(a), function (a) {
  12585. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12586. e.zpp_inner.validate();
  12587. return e.zpp_inner.y
  12588. }(a));
  12589. null == a.zpp_inner.vertices ? a.zpp_inner.vertices = b.prev = b.next = b : (b.prev = a.zpp_inner.vertices,
  12590. b.next = a.zpp_inner.vertices.next, a.zpp_inner.vertices.next.prev = b, a.zpp_inner.vertices.next = b);
  12591. return b
  12592. }(this)
  12593. } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
  12594. b = a;
  12595. if (null != b && b.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12596. b = b.zpp_inner.vertices;
  12597. if (null != b) {
  12598. g = b;
  12599. do e = h.geom.Vec2.get(g.x, g.y, null), g = g.next, this.zpp_inner.vertices = function (a) {
  12600. var b = c.geom.ZPP_GeomVert.get(function (a) {
  12601. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12602. e.zpp_inner.validate();
  12603. return e.zpp_inner.x
  12604. }(a), function (a) {
  12605. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12606. e.zpp_inner.validate();
  12607. return e.zpp_inner.y
  12608. }(a));
  12609. null == a.zpp_inner.vertices ? a.zpp_inner.vertices = b.prev = b.next = b : (b.prev = a.zpp_inner.vertices, b.next = a.zpp_inner.vertices.next, a.zpp_inner.vertices.next.prev = b, a.zpp_inner.vertices.next = b);
  12610. return b
  12611. }(this), e.dispose(); while (g != b)
  12612. }
  12613. } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
  12614. this.skipForward(1);
  12615. if (F.Boot.__instanceof(a, Array))
  12616. for (b = a, g = 0; g < b.length;) {
  12617. a = b[g];
  12618. if (d = a.zpp_inner.weak) a.dispose(), d = !0;
  12619. d ? b.splice(g, 1) : g++
  12620. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  12621. for (b = a, null != b.zpp_inner._validate && b.zpp_inner._validate(), b = b.zpp_inner.inner, g = null, a = b.head; null != a;) d = a.elt, d.outer.zpp_inner.weak ? (a = b.erase(g), d.outer.zpp_inner.weak ? (d.outer.dispose(), !0) : !1) : (g = a, a = a.next)
  12622. }
  12623. };
  12624. s["nape.geom.GeomPoly"] = h.geom.GeomPoly;
  12625. h.geom.GeomPoly.__name__ = ["nape", "geom", "GeomPoly"];
  12626. h.geom.GeomPoly.get =
  12627. function (a) {
  12628. var b;
  12629. null == c.util.ZPP_PubPool.poolGeomPoly ? b = new h.geom.GeomPoly : (b = c.util.ZPP_PubPool.poolGeomPoly, c.util.ZPP_PubPool.poolGeomPoly = b.zpp_pool, b.zpp_pool = null, b.zpp_disp = !1, b == c.util.ZPP_PubPool.nextGeomPoly && (c.util.ZPP_PubPool.nextGeomPoly = null));
  12630. if (null != a) {
  12631. if (F.Boot.__instanceof(a, Array))
  12632. for (var d = a, g = 0; g < d.length;) {
  12633. var e = d[g];
  12634. ++g;
  12635. if (null == e) throw "Error: Array<Vec2> contains null objects";
  12636. if (!F.Boot.__instanceof(e, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
  12637. var f =
  12638. e;
  12639. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12640. b.zpp_inner.vertices = function (a) {
  12641. a = c.geom.ZPP_GeomVert.get(function (a) {
  12642. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12643. f.zpp_inner.validate();
  12644. return f.zpp_inner.x
  12645. }(a), function (a) {
  12646. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12647. f.zpp_inner.validate();
  12648. return f.zpp_inner.y
  12649. }(a));
  12650. null == b.zpp_inner.vertices ? b.zpp_inner.vertices = a.prev = a.next = a : (a.prev = b.zpp_inner.vertices,
  12651. a.next = b.zpp_inner.vertices.next, b.zpp_inner.vertices.next.prev = a, b.zpp_inner.vertices.next = a);
  12652. return a
  12653. }(this)
  12654. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  12655. for (d = a.iterator(); d.hasNext();) {
  12656. f = d.next();
  12657. if (null == f) throw "Error: Vec2List contains null objects";
  12658. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12659. b.zpp_inner.vertices = function (a) {
  12660. a = c.geom.ZPP_GeomVert.get(function (a) {
  12661. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12662. f.zpp_inner.validate();
  12663. return f.zpp_inner.x
  12664. }(a), function (a) {
  12665. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12666. f.zpp_inner.validate();
  12667. return f.zpp_inner.y
  12668. }(a));
  12669. null == b.zpp_inner.vertices ? b.zpp_inner.vertices = a.prev = a.next = a : (a.prev = b.zpp_inner.vertices, a.next = b.zpp_inner.vertices.next, b.zpp_inner.vertices.next.prev = a, b.zpp_inner.vertices.next = a);
  12670. return a
  12671. }(this)
  12672. } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
  12673. d = a;
  12674. if (null != d && d.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12675. d = d.zpp_inner.vertices;
  12676. if (null != d) {
  12677. e = d;
  12678. do f = h.geom.Vec2.get(e.x, e.y, null), e = e.next, b.zpp_inner.vertices = function (a) {
  12679. a = c.geom.ZPP_GeomVert.get(function (a) {
  12680. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12681. f.zpp_inner.validate();
  12682. return f.zpp_inner.x
  12683. }(a), function (a) {
  12684. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12685. f.zpp_inner.validate();
  12686. return f.zpp_inner.y
  12687. }(a));
  12688. null == b.zpp_inner.vertices ? b.zpp_inner.vertices = a.prev = a.next = a : (a.prev = b.zpp_inner.vertices,
  12689. a.next = b.zpp_inner.vertices.next, b.zpp_inner.vertices.next.prev = a, b.zpp_inner.vertices.next = a);
  12690. return a
  12691. }(this), f.dispose(); while (e != d)
  12692. }
  12693. } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
  12694. b.skipForward(1);
  12695. if (F.Boot.__instanceof(a, Array))
  12696. for (d = a, e = 0; e < d.length;) {
  12697. a = d[e];
  12698. if (g = a.zpp_inner.weak) a.dispose(), g = !0;
  12699. g ? d.splice(e, 1) : e++
  12700. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  12701. for (d = a, null != d.zpp_inner._validate && d.zpp_inner._validate(),
  12702. d = d.zpp_inner.inner, e = null, a = d.head; null != a;) g = a.elt, g.outer.zpp_inner.weak ? (a = d.erase(e), g.outer.zpp_inner.weak ? (g.outer.dispose(), !0) : !1) : (e = a, a = a.next)
  12703. }
  12704. return b
  12705. };
  12706. h.geom.GeomPoly.prototype = {
  12707. right: function () {
  12708. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12709. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12710. if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable rightmmost vertex";
  12711. var a = this.zpp_inner.vertices,
  12712. b = this.zpp_inner.vertices.next,
  12713. d = this.zpp_inner.vertices;
  12714. if (null != b) {
  12715. do {
  12716. var c = b;
  12717. c.x > a.x && (a = c);
  12718. b = b.next
  12719. } while (b != d)
  12720. }
  12721. null == a.wrap && (a.wrap = h.geom.Vec2.get(a.x, a.y, null), a.wrap.zpp_inner._inuse = !0, a.wrap.zpp_inner._invalidate = A(a, a.modwrap), a.wrap.zpp_inner._validate = A(a, a.getwrap));
  12722. return a.wrap
  12723. },
  12724. left: function () {
  12725. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12726. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12727. if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable leftmost vertex";
  12728. var a = this.zpp_inner.vertices,
  12729. b = this.zpp_inner.vertices.next,
  12730. d = this.zpp_inner.vertices;
  12731. if (null != b) {
  12732. do {
  12733. var c = b;
  12734. c.x < a.x && (a = c);
  12735. b = b.next
  12736. } while (b != d)
  12737. }
  12738. null == a.wrap && (a.wrap = h.geom.Vec2.get(a.x, a.y, null), a.wrap.zpp_inner._inuse = !0, a.wrap.zpp_inner._invalidate = A(a, a.modwrap), a.wrap.zpp_inner._validate = A(a, a.getwrap));
  12739. return a.wrap
  12740. },
  12741. bottom: function () {
  12742. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12743. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12744. if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable bottommost vertex";
  12745. var a = this.zpp_inner.vertices,
  12746. b = this.zpp_inner.vertices.next,
  12747. d = this.zpp_inner.vertices;
  12748. if (null != b) {
  12749. do {
  12750. var c = b;
  12751. c.y > a.y && (a = c);
  12752. b = b.next
  12753. } while (b != d)
  12754. }
  12755. null == a.wrap && (a.wrap = h.geom.Vec2.get(a.x, a.y, null), a.wrap.zpp_inner._inuse = !0, a.wrap.zpp_inner._invalidate = A(a, a.modwrap), a.wrap.zpp_inner._validate = A(a, a.getwrap));
  12756. return a.wrap
  12757. },
  12758. top: function () {
  12759. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12760. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12761. if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable topmost vertex";
  12762. var a = this.zpp_inner.vertices,
  12763. b = this.zpp_inner.vertices.next,
  12764. d = this.zpp_inner.vertices;
  12765. if (null != b) {
  12766. do {
  12767. var c = b;
  12768. c.y < a.y && (a = c);
  12769. b = b.next
  12770. } while (b != d)
  12771. }
  12772. null == a.wrap && (a.wrap = h.geom.Vec2.get(a.x, a.y, null), a.wrap.zpp_inner._inuse = !0, a.wrap.zpp_inner._invalidate = A(a, a.modwrap), a.wrap.zpp_inner._validate = A(a, a.getwrap));
  12773. return a.wrap
  12774. },
  12775. bounds: function () {
  12776. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12777. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12778. if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable bounds";
  12779. var a = 1E100,
  12780. b = 1E100,
  12781. d = -1E100,
  12782. c = -1E100,
  12783. e = this.zpp_inner.vertices,
  12784. f = this.zpp_inner.vertices;
  12785. if (null != e) {
  12786. do {
  12787. var l = e;
  12788. l.x < a && (a = l.x);
  12789. l.y < b && (b = l.y);
  12790. l.x > d && (d = l.x);
  12791. l.y > c && (c = l.y);
  12792. e = e.next
  12793. } while (e != f)
  12794. }
  12795. return new h.geom.AABB(a, b, d - a, c - b)
  12796. },
  12797. transform: function (a) {
  12798. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12799. if (null ==
  12800. a) throw "Error: Cannot transform by null matrix";
  12801. var b = this.zpp_inner.vertices,
  12802. d = this.zpp_inner.vertices;
  12803. if (null != b) {
  12804. do {
  12805. var c = b,
  12806. e = a.zpp_inner.a * c.x + a.zpp_inner.b * c.y + a.zpp_inner.tx;
  12807. c.y = a.zpp_inner.c * c.x + a.zpp_inner.d * c.y + a.zpp_inner.ty;
  12808. c.x = e;
  12809. b = b.next
  12810. } while (b != d)
  12811. }
  12812. return this
  12813. },
  12814. cut: function (a, b, d, g, e) {
  12815. null == g && (g = !1);
  12816. null == d && (d = !1);
  12817. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12818. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12819. if (null != this.zpp_inner.vertices &&
  12820. null != this.zpp_inner.vertices.next && this.zpp_inner.vertices.prev != this.zpp_inner.vertices.next && !c.geom.ZPP_Simple.isSimple(this.zpp_inner.vertices)) throw "Error: Cut requires a truly simple polygon";
  12821. if (null == a || null == b) throw "Error: Cannot cut with null start/end's";
  12822. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12823. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  12824. d = c.geom.ZPP_Cutter.run(this.zpp_inner.vertices, a, b, d, g, e);
  12825. a.zpp_inner.weak ?
  12826. (a.dispose(), !0) : !1;
  12827. b.zpp_inner.weak ? (b.dispose(), !0) : !1;
  12828. return d
  12829. },
  12830. inflate: function (a) {
  12831. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12832. var b = h.geom.GeomPoly.get(),
  12833. d = this.winding();
  12834. null == c.util.ZPP_Flags.Winding_CLOCKWISE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_CLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1);
  12835. d == c.util.ZPP_Flags.Winding_CLOCKWISE && (a = -a);
  12836. var g = this.zpp_inner.vertices,
  12837. d = this.zpp_inner.vertices;
  12838. if (null != g) {
  12839. do {
  12840. var e = g,
  12841. f = e.prev,
  12842. l =
  12843. e.next,
  12844. m = 0,
  12845. u = 0,
  12846. p = 0,
  12847. C = 0,
  12848. m = e.x - f.x,
  12849. u = e.y - f.y,
  12850. p = l.x - e.x,
  12851. C = l.y - e.y,
  12852. r = l = f = 0,
  12853. k = 0,
  12854. f = m,
  12855. l = u,
  12856. w = f * f + l * l,
  12857. w = 1 / Math.sqrt(w),
  12858. f = f * w,
  12859. l = l * w,
  12860. w = f,
  12861. f = -l,
  12862. l = w,
  12863. w = a,
  12864. f = f * w,
  12865. l = l * w,
  12866. r = p,
  12867. k = C,
  12868. w = r * r + k * k,
  12869. w = 1 / Math.sqrt(w),
  12870. r = r * w,
  12871. k = k * w,
  12872. w = r,
  12873. r = -k,
  12874. k = w,
  12875. w = a,
  12876. r = r * w,
  12877. k = k * w,
  12878. t = w = 0,
  12879. w = r - f,
  12880. t = k - l,
  12881. r = C * w - p * t,
  12882. w = 0 == r ? 0 : r / (C * m - p * u),
  12883. C = p = 0,
  12884. p = e.x + f,
  12885. C = e.y + l,
  12886. e = w,
  12887. p = p + m * e,
  12888. C = C + u * e;
  12889. b.push(h.geom.Vec2.get(p, C, null));
  12890. g = g.next
  12891. } while (g != d)
  12892. }
  12893. return b.skipForward(1)
  12894. },
  12895. triangularDecomposition: function (a, b) {
  12896. null == a && (a = !1);
  12897. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12898. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) throw "Error: Cannot decompose a degenerate polygon";
  12899. for (var d = c.geom.ZPP_Monotone.decompose(this.zpp_inner.vertices, function (a) {
  12900. null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly = new c.geom.ZPP_PartitionedPoly);
  12901. return c.geom.ZPP_Monotone.sharedPPoly
  12902. }(this)).extract_partitions(function (a) {
  12903. null == c.geom.ZPP_PartitionedPoly.sharedPPList && (c.geom.ZPP_PartitionedPoly.sharedPPList =
  12904. new c.util.ZNPList_ZPP_PartitionedPoly);
  12905. return c.geom.ZPP_PartitionedPoly.sharedPPList
  12906. }(this)), g = null == b ? new h.geom.GeomPolyList : b; null != d.head;) {
  12907. var e = d.pop_unsafe();
  12908. c.geom.ZPP_Triangular.triangulate(e);
  12909. a && c.geom.ZPP_Triangular.optimise(e);
  12910. var f = e.extract(function (a) {
  12911. null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList = new c.util.ZNPList_ZPP_GeomVert);
  12912. return c.geom.ZPP_PartitionedPoly.sharedGVList
  12913. }(this));
  12914. e.next = c.geom.ZPP_PartitionedPoly.zpp_pool;
  12915. for (c.geom.ZPP_PartitionedPoly.zpp_pool =
  12916. e; null != f.head;) {
  12917. var e = f.pop_unsafe(),
  12918. l = h.geom.GeomPoly.get();
  12919. l.zpp_inner.vertices = e;
  12920. g.zpp_inner.reverse_flag ? g.push(l) : g.unshift(l)
  12921. }
  12922. }
  12923. return g
  12924. },
  12925. convexDecomposition: function (a, b) {
  12926. null == a && (a = !1);
  12927. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12928. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) throw "Error: Cannot decompose a degenerate polygon";
  12929. for (var d = c.geom.ZPP_Monotone.decompose(this.zpp_inner.vertices,
  12930. function (a) {
  12931. null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly = new c.geom.ZPP_PartitionedPoly);
  12932. return c.geom.ZPP_Monotone.sharedPPoly
  12933. }(this)).extract_partitions(function (a) {
  12934. null == c.geom.ZPP_PartitionedPoly.sharedPPList && (c.geom.ZPP_PartitionedPoly.sharedPPList = new c.util.ZNPList_ZPP_PartitionedPoly);
  12935. return c.geom.ZPP_PartitionedPoly.sharedPPList
  12936. }(this)), g = null == b ? new h.geom.GeomPolyList : b; null != d.head;) {
  12937. var e = d.pop_unsafe();
  12938. c.geom.ZPP_Triangular.triangulate(e);
  12939. a && c.geom.ZPP_Triangular.optimise(e);
  12940. c.geom.ZPP_Convex.optimise(e);
  12941. var f = e.extract(function (a) {
  12942. null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList = new c.util.ZNPList_ZPP_GeomVert);
  12943. return c.geom.ZPP_PartitionedPoly.sharedGVList
  12944. }(this));
  12945. e.next = c.geom.ZPP_PartitionedPoly.zpp_pool;
  12946. for (c.geom.ZPP_PartitionedPoly.zpp_pool = e; null != f.head;) {
  12947. var e = f.pop_unsafe(),
  12948. l = h.geom.GeomPoly.get();
  12949. l.zpp_inner.vertices = e;
  12950. g.zpp_inner.reverse_flag ? g.push(l) : g.unshift(l)
  12951. }
  12952. }
  12953. return g
  12954. },
  12955. monotoneDecomposition: function (a) {
  12956. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12957. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) throw "Error: Cannot decompose a degenerate polygon";
  12958. var b = c.geom.ZPP_Monotone.decompose(this.zpp_inner.vertices, function (a) {
  12959. null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly = new c.geom.ZPP_PartitionedPoly);
  12960. return c.geom.ZPP_Monotone.sharedPPoly
  12961. }(this)).extract(function (a) {
  12962. null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList =
  12963. new c.util.ZNPList_ZPP_GeomVert);
  12964. return c.geom.ZPP_PartitionedPoly.sharedGVList
  12965. }(this));
  12966. for (a = null == a ? new h.geom.GeomPolyList : a; null != b.head;) {
  12967. var d = b.pop_unsafe(),
  12968. g = h.geom.GeomPoly.get();
  12969. g.zpp_inner.vertices = d;
  12970. a.zpp_inner.reverse_flag ? a.push(g) : a.unshift(g)
  12971. }
  12972. return a
  12973. },
  12974. simpleDecomposition: function (a) {
  12975. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12976. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) throw "Error: Cannot decompose a degenerate polygon";
  12977. var b = c.geom.ZPP_Simple.decompose(this.zpp_inner.vertices, function (a) {
  12978. null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList = new c.util.ZNPList_ZPP_GeomVert);
  12979. return c.geom.ZPP_PartitionedPoly.sharedGVList
  12980. }(this));
  12981. for (a = null == a ? new h.geom.GeomPolyList : a; null != b.head;) {
  12982. var d = b.pop_unsafe(),
  12983. g = h.geom.GeomPoly.get();
  12984. g.zpp_inner.vertices = d;
  12985. a.zpp_inner.reverse_flag ? a.push(g) : a.unshift(g)
  12986. }
  12987. return a
  12988. },
  12989. simplify: function (a) {
  12990. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  12991. if (0 >= a) throw "Error: Epsilon should be > 0 for simplifying a GeomPoly";
  12992. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) return this.copy();
  12993. a = c.geom.ZPP_Simplify.simplify(this.zpp_inner.vertices, a);
  12994. var b = h.geom.GeomPoly.get();
  12995. b.zpp_inner.vertices = a;
  12996. return b
  12997. },
  12998. isDegenerate: function () {
  12999. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13000. return null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next ||
  13001. this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next ? !0 : this.area() < h.Config.epsilon
  13002. },
  13003. isMonotone: function () {
  13004. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13005. return null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next ? !0 : c.geom.ZPP_Monotone.isMonotone(this.zpp_inner.vertices)
  13006. },
  13007. isSimple: function () {
  13008. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13009. return null == this.zpp_inner.vertices ||
  13010. null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next ? !0 : c.geom.ZPP_Simple.isSimple(this.zpp_inner.vertices)
  13011. },
  13012. isConvex: function () {
  13013. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13014. var a;
  13015. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) a = !0;
  13016. else {
  13017. var b = a = !1,
  13018. d = !0,
  13019. c = this.zpp_inner.vertices,
  13020. e = this.zpp_inner.vertices;
  13021. if (null != c) {
  13022. do {
  13023. var f = c,
  13024. l = f.prev,
  13025. m = f.next,
  13026. h = 0,
  13027. p = 0,
  13028. h = m.x - f.x,
  13029. p = m.y - f.y,
  13030. C = m = 0,
  13031. m = f.x - l.x,
  13032. C = f.y - l.y,
  13033. f = C * h - m * p;
  13034. 0 < f ? b = !0 : 0 > f && (a = !0);
  13035. if (b && a) {
  13036. d = !1;
  13037. break
  13038. }
  13039. c = c.next
  13040. } while (c != e)
  13041. }
  13042. a = d
  13043. }
  13044. return a
  13045. },
  13046. isClockwise: function () {
  13047. var a = this.winding();
  13048. null == c.util.ZPP_Flags.Winding_CLOCKWISE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_CLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1);
  13049. return a == c.util.ZPP_Flags.Winding_CLOCKWISE
  13050. },
  13051. contains: function (a) {
  13052. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13053. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13054. if (null == a) throw "Error: GeomPoly::contains point cannot be null";
  13055. var b;
  13056. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13057. a.zpp_inner.validate();
  13058. b = a.zpp_inner.x;
  13059. var d;
  13060. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13061. a.zpp_inner.validate();
  13062. d = a.zpp_inner.y;
  13063. var c = !1,
  13064. e = this.zpp_inner.vertices,
  13065. f = this.zpp_inner.vertices;
  13066. if (null != e) {
  13067. do {
  13068. var l = e,
  13069. m = l.prev;
  13070. (l.y < d && m.y >= d || m.y < d && l.y >= d) && (l.x <= b || m.x <= b) && l.x + (d - l.y) / (m.y - l.y) * (m.x - l.x) < b && (c = !c);
  13071. e =
  13072. e.next
  13073. } while (e != f)
  13074. }
  13075. b = c;
  13076. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  13077. return b
  13078. },
  13079. winding: function () {
  13080. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13081. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) return null == c.util.ZPP_Flags.Winding_UNDEFINED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_UNDEFINED = new h.geom.Winding, c.util.ZPP_Flags.internal = !1), c.util.ZPP_Flags.Winding_UNDEFINED;
  13082. var a;
  13083. a =
  13084. 0;
  13085. var b = this.zpp_inner.vertices,
  13086. d = this.zpp_inner.vertices;
  13087. if (null != b) {
  13088. do {
  13089. var g = b;
  13090. a += g.x * (g.next.y - g.prev.y);
  13091. b = b.next
  13092. } while (b != d)
  13093. }
  13094. a *= 0.5;
  13095. 0 < a ? (null == c.util.ZPP_Flags.Winding_CLOCKWISE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_CLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.Winding_CLOCKWISE) : 0 == a ? (null == c.util.ZPP_Flags.Winding_UNDEFINED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_UNDEFINED = new h.geom.Winding, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.Winding_UNDEFINED) :
  13096. (null == c.util.ZPP_Flags.Winding_ANTICLOCKWISE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_ANTICLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.Winding_ANTICLOCKWISE);
  13097. return a
  13098. },
  13099. area: function () {
  13100. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13101. var a;
  13102. if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) a = 0;
  13103. else {
  13104. a = 0;
  13105. var b = this.zpp_inner.vertices,
  13106. d = this.zpp_inner.vertices;
  13107. if (null != b) {
  13108. do {
  13109. var c = b;
  13110. a += c.x * (c.next.y - c.prev.y);
  13111. b = b.next
  13112. } while (b != d)
  13113. }
  13114. a *= 0.5;
  13115. a = 0 > a ? -a : a
  13116. }
  13117. return a
  13118. },
  13119. toString: function () {
  13120. var a = "GeomPoly[",
  13121. b = this.zpp_inner.vertices,
  13122. d = this.zpp_inner.vertices;
  13123. if (null != b) {
  13124. do {
  13125. var c = b;
  13126. c != this.zpp_inner.vertices && (a += ",");
  13127. a += "{" + c.x + "," + c.y + "}";
  13128. b = b.next
  13129. } while (b != d)
  13130. }
  13131. return a + "]"
  13132. },
  13133. dispose: function () {
  13134. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13135. this.clear();
  13136. this.zpp_pool = null;
  13137. null != c.util.ZPP_PubPool.nextGeomPoly ? c.util.ZPP_PubPool.nextGeomPoly.zpp_pool =
  13138. this : c.util.ZPP_PubPool.poolGeomPoly = this;
  13139. c.util.ZPP_PubPool.nextGeomPoly = this;
  13140. this.zpp_disp = !0
  13141. },
  13142. copy: function () {
  13143. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13144. var a = h.geom.GeomPoly.get(),
  13145. b = this.zpp_inner.vertices,
  13146. d = this.zpp_inner.vertices;
  13147. if (null != b) {
  13148. do {
  13149. var g = b,
  13150. e = a.zpp_inner,
  13151. f = void 0,
  13152. g = c.geom.ZPP_GeomVert.get(g.x, g.y);
  13153. null == a.zpp_inner.vertices ? a.zpp_inner.vertices = g.prev = g.next = g : (g.prev = a.zpp_inner.vertices, g.next = a.zpp_inner.vertices.next, a.zpp_inner.vertices.next.prev =
  13154. g, a.zpp_inner.vertices.next = g);
  13155. f = g;
  13156. e.vertices = f;
  13157. b = b.next
  13158. } while (b != d)
  13159. }
  13160. return a.skipForward(1)
  13161. },
  13162. clear: function () {
  13163. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13164. for (; null != this.zpp_inner.vertices;) {
  13165. var a = this.zpp_inner.vertices,
  13166. b = this.zpp_inner,
  13167. d;
  13168. null != this.zpp_inner.vertices && this.zpp_inner.vertices.prev == this.zpp_inner.vertices ? (this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null, d = this.zpp_inner.vertices = null) : (d = this.zpp_inner.vertices.next, this.zpp_inner.vertices.prev.next =
  13169. this.zpp_inner.vertices.next, this.zpp_inner.vertices.next.prev = this.zpp_inner.vertices.prev, this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null, this.zpp_inner.vertices = null);
  13170. b.vertices = d;
  13171. null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
  13172. a.prev = a.next = null;
  13173. a.next = c.geom.ZPP_GeomVert.zpp_pool;
  13174. c.geom.ZPP_GeomVert.zpp_pool = a
  13175. }
  13176. return this
  13177. },
  13178. erase: function (a) {
  13179. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13180. for (; 0 != a && null != this.zpp_inner.vertices;) {
  13181. var b =
  13182. this.zpp_inner.vertices;
  13183. if (0 < a) {
  13184. var d = this.zpp_inner,
  13185. g;
  13186. null != this.zpp_inner.vertices && this.zpp_inner.vertices.prev == this.zpp_inner.vertices ? (this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null, g = this.zpp_inner.vertices = null) : g = function (a) {
  13187. var b = a.zpp_inner.vertices.next;
  13188. a.zpp_inner.vertices.prev.next = a.zpp_inner.vertices.next;
  13189. a.zpp_inner.vertices.next.prev = a.zpp_inner.vertices.prev;
  13190. a.zpp_inner.vertices.next = a.zpp_inner.vertices.prev = null;
  13191. a.zpp_inner.vertices = null;
  13192. return b
  13193. }(this);
  13194. d.vertices =
  13195. g;
  13196. a--
  13197. } else 0 > a && (d = this.zpp_inner, g = null != this.zpp_inner.vertices && this.zpp_inner.vertices.prev == this.zpp_inner.vertices ? this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null : function (a) {
  13198. var b = a.zpp_inner.vertices.prev;
  13199. a.zpp_inner.vertices.prev.next = a.zpp_inner.vertices.next;
  13200. a.zpp_inner.vertices.next.prev = a.zpp_inner.vertices.prev;
  13201. a.zpp_inner.vertices.next = a.zpp_inner.vertices.prev = null;
  13202. a.zpp_inner.vertices = null;
  13203. return b
  13204. }(this), d.vertices = g, a++);
  13205. null != b.wrap && (b.wrap.zpp_inner._inuse = !1,
  13206. b.wrap.dispose(), b.wrap = null);
  13207. b.prev = b.next = null;
  13208. b.next = c.geom.ZPP_GeomVert.zpp_pool;
  13209. c.geom.ZPP_GeomVert.zpp_pool = b
  13210. }
  13211. return this
  13212. },
  13213. skipBackwards: function (a) {
  13214. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13215. return this.skipForward(-a)
  13216. },
  13217. skipForward: function (a) {
  13218. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13219. if (null != this.zpp_inner.vertices)
  13220. if (0 < a)
  13221. for (; 0 < a--;) this.zpp_inner.vertices = this.zpp_inner.vertices.next;
  13222. else if (0 > a)
  13223. for (; 0 > a++;) this.zpp_inner.vertices =
  13224. this.zpp_inner.vertices.prev;
  13225. return this
  13226. },
  13227. shift: function () {
  13228. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13229. if (null == this.zpp_inner.vertices) throw "Error: Cannot shift from empty polygon";
  13230. var a = this.zpp_inner.vertices,
  13231. b = this.zpp_inner,
  13232. d;
  13233. null != this.zpp_inner.vertices && this.zpp_inner.vertices.prev == this.zpp_inner.vertices ? (this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null, d = this.zpp_inner.vertices = null) : (d = this.zpp_inner.vertices.next, this.zpp_inner.vertices.prev.next =
  13234. this.zpp_inner.vertices.next, this.zpp_inner.vertices.next.prev = this.zpp_inner.vertices.prev, this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null, this.zpp_inner.vertices = null);
  13235. b.vertices = d;
  13236. null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
  13237. a.prev = a.next = null;
  13238. a.next = c.geom.ZPP_GeomVert.zpp_pool;
  13239. c.geom.ZPP_GeomVert.zpp_pool = a;
  13240. return this
  13241. },
  13242. unshift: function (a) {
  13243. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13244. if (null == a) throw "Error: Cannot unshift null vertex";
  13245. this.zpp_inner.vertices = function (b) {
  13246. var d = c.geom.ZPP_GeomVert.get(function (b) {
  13247. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13248. a.zpp_inner.validate();
  13249. return a.zpp_inner.x
  13250. }(b), function (b) {
  13251. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13252. a.zpp_inner.validate();
  13253. return a.zpp_inner.y
  13254. }(b));
  13255. null == b.zpp_inner.vertices ? b.zpp_inner.vertices = d.prev = d.next = d : (d.next = b.zpp_inner.vertices, d.prev = b.zpp_inner.vertices.prev, b.zpp_inner.vertices.prev.next =
  13256. d, b.zpp_inner.vertices.prev = d);
  13257. return d
  13258. }(this);
  13259. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  13260. return this
  13261. },
  13262. pop: function () {
  13263. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13264. if (null == this.zpp_inner.vertices) throw "Error: Cannot pop from empty polygon";
  13265. var a = this.zpp_inner.vertices,
  13266. b = this.zpp_inner,
  13267. d;
  13268. null != this.zpp_inner.vertices && this.zpp_inner.vertices.prev == this.zpp_inner.vertices ? d = this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null : (d = this.zpp_inner.vertices.prev, this.zpp_inner.vertices.prev.next =
  13269. this.zpp_inner.vertices.next, this.zpp_inner.vertices.next.prev = this.zpp_inner.vertices.prev, this.zpp_inner.vertices.next = this.zpp_inner.vertices.prev = null, this.zpp_inner.vertices = null);
  13270. b.vertices = d;
  13271. null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
  13272. a.prev = a.next = null;
  13273. a.next = c.geom.ZPP_GeomVert.zpp_pool;
  13274. c.geom.ZPP_GeomVert.zpp_pool = a;
  13275. return this
  13276. },
  13277. push: function (a) {
  13278. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13279. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13280. if (null == a) throw "Error: Cannot push null vertex";
  13281. this.zpp_inner.vertices = function (b) {
  13282. var d = c.geom.ZPP_GeomVert.get(function (b) {
  13283. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13284. a.zpp_inner.validate();
  13285. return a.zpp_inner.x
  13286. }(b), function (b) {
  13287. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13288. a.zpp_inner.validate();
  13289. return a.zpp_inner.y
  13290. }(b));
  13291. null == b.zpp_inner.vertices ? b.zpp_inner.vertices = d.prev = d.next = d : (d.prev = b.zpp_inner.vertices, d.next = b.zpp_inner.vertices.next,
  13292. b.zpp_inner.vertices.next.prev = d, b.zpp_inner.vertices.next = d);
  13293. return d
  13294. }(this);
  13295. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  13296. return this
  13297. },
  13298. current: function () {
  13299. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13300. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13301. if (null == this.zpp_inner.vertices) throw "Error: GeomPoly is empty";
  13302. return this.zpp_inner.vertices.wrapper()
  13303. },
  13304. backwardsIterator: function () {
  13305. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13306. return c.geom.ZPP_GeomVertexIterator.get(this.zpp_inner.vertices, !1)
  13307. },
  13308. forwardIterator: function () {
  13309. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13310. return c.geom.ZPP_GeomVertexIterator.get(this.zpp_inner.vertices, !0)
  13311. },
  13312. iterator: function () {
  13313. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13314. return c.geom.ZPP_GeomVertexIterator.get(this.zpp_inner.vertices, !0)
  13315. },
  13316. size: function () {
  13317. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13318. var a = 0,
  13319. b = this.zpp_inner.vertices,
  13320. d = this.zpp_inner.vertices;
  13321. if (null != b) {
  13322. do a++, b = b.next; while (b != d)
  13323. }
  13324. return a
  13325. },
  13326. empty: function () {
  13327. if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  13328. return null == this.zpp_inner.vertices
  13329. },
  13330. __class__: h.geom.GeomPoly
  13331. };
  13332. h.geom.GeomPolyIterator = function () {
  13333. this.zpp_next = null;
  13334. this.zpp_critical = !1;
  13335. this.zpp_i = 0;
  13336. this.zpp_inner = null;
  13337. if (!c.util.ZPP_GeomPolyList.internal) throw "Error: Cannot instantiate GeomPolyIterator derp!";
  13338. };
  13339. s["nape.geom.GeomPolyIterator"] =
  13340. h.geom.GeomPolyIterator;
  13341. h.geom.GeomPolyIterator.__name__ = ["nape", "geom", "GeomPolyIterator"];
  13342. h.geom.GeomPolyIterator.get = function (a) {
  13343. var b = null == h.geom.GeomPolyIterator.zpp_pool ? function (a) {
  13344. c.util.ZPP_GeomPolyList.internal = !0;
  13345. a = new h.geom.GeomPolyIterator;
  13346. c.util.ZPP_GeomPolyList.internal = !1;
  13347. return a
  13348. }(this) : function (a) {
  13349. a = h.geom.GeomPolyIterator.zpp_pool;
  13350. h.geom.GeomPolyIterator.zpp_pool = a.zpp_next;
  13351. return a
  13352. }(this);
  13353. b.zpp_i = 0;
  13354. b.zpp_inner = a;
  13355. b.zpp_critical = !1;
  13356. return b
  13357. };
  13358. h.geom.GeomPolyIterator.prototype = {
  13359. next: function () {
  13360. this.zpp_critical = !1;
  13361. return this.zpp_inner.at(this.zpp_i++)
  13362. },
  13363. hasNext: function () {
  13364. this.zpp_inner.zpp_inner.valmod();
  13365. var a = this.zpp_inner.get_length();
  13366. this.zpp_critical = !0;
  13367. if (this.zpp_i < a) return !0;
  13368. this.zpp_next = h.geom.GeomPolyIterator.zpp_pool;
  13369. h.geom.GeomPolyIterator.zpp_pool = this;
  13370. this.zpp_inner = null;
  13371. return !1
  13372. },
  13373. __class__: h.geom.GeomPolyIterator
  13374. };
  13375. h.geom.GeomPolyList = function () {
  13376. this.zpp_inner = null;
  13377. this.zpp_inner = new c.util.ZPP_GeomPolyList;
  13378. this.zpp_inner.outer = this
  13379. };
  13380. s["nape.geom.GeomPolyList"] = h.geom.GeomPolyList;
  13381. h.geom.GeomPolyList.__name__ = ["nape", "geom", "GeomPolyList"];
  13382. h.geom.GeomPolyList.fromArray = function (a) {
  13383. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  13384. for (var b = new h.geom.GeomPolyList, d = 0; d < a.length;) {
  13385. var c = a[d];
  13386. ++d;
  13387. b.push(c)
  13388. }
  13389. return b
  13390. };
  13391. h.geom.GeomPolyList.prototype = {
  13392. filter: function (a) {
  13393. if (null == a) throw "Error: Cannot select elements of list with null";
  13394. for (var b = 0; b < this.get_length();) {
  13395. var d = this.at(b);
  13396. try {
  13397. a(d) ? b++ : this.remove(d)
  13398. } catch (c) {
  13399. break
  13400. }
  13401. }
  13402. return this
  13403. },
  13404. foreach: function (a) {
  13405. if (null == a) throw "Error: Cannot execute null on list elements";
  13406. var b;
  13407. this.zpp_inner.valmod();
  13408. for (b = h.geom.GeomPolyIterator.get(this); b.hasNext();) try {
  13409. var d = a,
  13410. c;
  13411. b.zpp_critical = !1;
  13412. c = b.zpp_inner.at(b.zpp_i++);
  13413. d(c)
  13414. } catch (e) {
  13415. b.zpp_next = h.geom.GeomPolyIterator.zpp_pool;
  13416. h.geom.GeomPolyIterator.zpp_pool = b;
  13417. b.zpp_inner = null;
  13418. break
  13419. }
  13420. return this
  13421. },
  13422. toString: function () {
  13423. var a = "[",
  13424. b = !0,
  13425. d;
  13426. this.zpp_inner.valmod();
  13427. for (d = h.geom.GeomPolyIterator.get(this); d.hasNext();) {
  13428. var c = d.next();
  13429. b || (a += ",");
  13430. a += null == c ? "NULL" : c.toString();
  13431. b = !1
  13432. }
  13433. return a + "]"
  13434. },
  13435. merge: function (a) {
  13436. if (null == a) throw "Error: Cannot merge with null list";
  13437. a.zpp_inner.valmod();
  13438. for (a = h.geom.GeomPolyIterator.get(a); a.hasNext();) {
  13439. var b = a.next();
  13440. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  13441. }
  13442. },
  13443. copy: function (a) {
  13444. null == a && (a = !1);
  13445. var b = new h.geom.GeomPolyList,
  13446. d;
  13447. this.zpp_inner.valmod();
  13448. for (d = h.geom.GeomPolyIterator.get(this); d.hasNext();) {
  13449. var c = d.next();
  13450. b.push(a ? function (a) {
  13451. throw "Error: GeomPoly is not a copyable type";
  13452. }(this) : c)
  13453. }
  13454. return b
  13455. },
  13456. iterator: function () {
  13457. this.zpp_inner.valmod();
  13458. return h.geom.GeomPolyIterator.get(this)
  13459. },
  13460. empty: function () {
  13461. return null ==
  13462. this.zpp_inner.inner.head
  13463. },
  13464. clear: function () {
  13465. if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
  13466. if (this.zpp_inner.reverse_flag)
  13467. for (; null != this.zpp_inner.inner.head;) this.pop();
  13468. else
  13469. for (; null != this.zpp_inner.inner.head;) this.shift()
  13470. },
  13471. remove: function (a) {
  13472. if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
  13473. this.zpp_inner.modify_test();
  13474. this.zpp_inner.valmod();
  13475. var b;
  13476. b = !1;
  13477. for (var d = this.zpp_inner.inner.head; null != d;) {
  13478. if (d.elt == a.zpp_inner) {
  13479. b = !0;
  13480. break
  13481. }
  13482. d = d.next
  13483. }
  13484. b && (null != this.zpp_inner.subber &&
  13485. this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  13486. return b
  13487. },
  13488. add: function (a) {
  13489. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  13490. },
  13491. shift: function () {
  13492. if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
  13493. this.zpp_inner.modify_test();
  13494. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  13495. this.zpp_inner.valmod();
  13496. var a = null;
  13497. if (this.zpp_inner.reverse_flag) {
  13498. null != this.zpp_inner.at_ite &&
  13499. null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  13500. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  13501. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  13502. d = a.outer;
  13503. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  13504. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  13505. } else a = this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  13506. this.zpp_inner.invalidate();
  13507. return d = a.outer
  13508. },
  13509. pop: function () {
  13510. if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
  13511. this.zpp_inner.modify_test();
  13512. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  13513. this.zpp_inner.valmod();
  13514. var a = null;
  13515. if (this.zpp_inner.reverse_flag) {
  13516. var a = this.zpp_inner.inner.head.elt,
  13517. b = a.outer;
  13518. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  13519. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  13520. } else {
  13521. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite =
  13522. null);
  13523. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  13524. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  13525. b = a.outer;
  13526. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  13527. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  13528. }
  13529. this.zpp_inner.invalidate();
  13530. return b = a.outer
  13531. },
  13532. unshift: function (a) {
  13533. if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
  13534. this.zpp_inner.modify_test();
  13535. this.zpp_inner.valmod();
  13536. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
  13537. !0;
  13538. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  13539. return b
  13540. },
  13541. push: function (a) {
  13542. if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
  13543. this.zpp_inner.modify_test();
  13544. this.zpp_inner.valmod();
  13545. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  13546. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  13547. return b
  13548. },
  13549. at: function (a) {
  13550. this.zpp_inner.valmod();
  13551. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  13552. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  13553. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  13554. else
  13555. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  13556. return this.zpp_inner.at_ite.elt.outer
  13557. },
  13558. has: function (a) {
  13559. this.zpp_inner.valmod();
  13560. return this.zpp_inner.inner.has(a.zpp_inner)
  13561. },
  13562. get_length: function () {
  13563. this.zpp_inner.valmod();
  13564. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  13565. return this.zpp_inner.user_length
  13566. },
  13567. __class__: h.geom.GeomPolyList
  13568. };
  13569. h.geom.GeomVertexIterator = function () {
  13570. if (!c.geom.ZPP_GeomVertexIterator.internal) throw "Error: Cannot instantiate GeomVertexIterator";
  13571. };
  13572. s["nape.geom.GeomVertexIterator"] = h.geom.GeomVertexIterator;
  13573. h.geom.GeomVertexIterator.__name__ = ["nape", "geom", "GeomVertexIterator"];
  13574. h.geom.GeomVertexIterator.prototype = {
  13575. next: function () {
  13576. if (null ==
  13577. this.zpp_inner) throw "Error: Iterator has been disposed";
  13578. var a = this.zpp_inner.ptr.wrapper();
  13579. this.zpp_inner.ptr = this.zpp_inner.forward ? this.zpp_inner.ptr.next : this.zpp_inner.ptr.prev;
  13580. return a
  13581. },
  13582. hasNext: function () {
  13583. if (null == this.zpp_inner) throw "Error: Iterator has been disposed";
  13584. var a = this.zpp_inner.ptr != this.zpp_inner.start || this.zpp_inner.first;
  13585. this.zpp_inner.first = !1;
  13586. if (!a) {
  13587. var b = this.zpp_inner;
  13588. b.outer.zpp_inner = null;
  13589. b.ptr = b.start = null;
  13590. b.next = c.geom.ZPP_GeomVertexIterator.zpp_pool;
  13591. c.geom.ZPP_GeomVertexIterator.zpp_pool =
  13592. b
  13593. }
  13594. return a
  13595. },
  13596. __class__: h.geom.GeomVertexIterator
  13597. };
  13598. h.geom.MarchingSquares = function () {};
  13599. s["nape.geom.MarchingSquares"] = h.geom.MarchingSquares;
  13600. h.geom.MarchingSquares.__name__ = ["nape", "geom", "MarchingSquares"];
  13601. h.geom.MarchingSquares.run = function (a, b, d, g, e, f, l) {
  13602. null == f && (f = !0);
  13603. null == g && (g = 2);
  13604. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13605. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13606. if (null == a) throw "Error: MarchingSquares requires an iso function to operate";
  13607. if (null == b) throw "Error: MarchingSquares requires an AABB to define bounds of surface extraction";
  13608. if (null == d) throw "Error: MarchingSquares requires a Vec2 to define cell size for surface extraction";
  13609. var m;
  13610. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13611. d.zpp_inner.validate();
  13612. if (!(m = 0 >= d.zpp_inner.x)) {
  13613. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13614. d.zpp_inner.validate();
  13615. m = 0 >= d.zpp_inner.y
  13616. }
  13617. if (m) throw "Error: MarchingSquares cannot operate with non-positive cell dimensions";
  13618. if (0 > g) throw "Error: MarchingSquares cannot use a negative quality value for interpolation";
  13619. if (m = null != e) {
  13620. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13621. e.zpp_inner.validate();
  13622. if (!(m = 0 >= e.zpp_inner.x)) {
  13623. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13624. e.zpp_inner.validate();
  13625. m = 0 >= e.zpp_inner.y
  13626. }
  13627. }
  13628. if (m) throw "Error: MarchingSquares cannot with non-positive sub-grid dimensions";
  13629. l = null != l ? l : new h.geom.GeomPolyList;
  13630. if (null == e) c.geom.ZPP_MarchingSquares.run(a,
  13631. function (a) {
  13632. b.zpp_inner.validate();
  13633. return b.zpp_inner.minx
  13634. }(this), function (a) {
  13635. b.zpp_inner.validate();
  13636. return b.zpp_inner.miny
  13637. }(this), b.zpp_inner.getmax().get_x(), b.zpp_inner.getmax().get_y(), d, g, f, l);
  13638. else {
  13639. b.zpp_inner.validate();
  13640. m = b.zpp_inner.width();
  13641. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13642. e.zpp_inner.validate();
  13643. var u = m / e.zpp_inner.x;
  13644. b.zpp_inner.validate();
  13645. m = b.zpp_inner.height();
  13646. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13647. e.zpp_inner.validate();
  13648. var p = m / e.zpp_inner.y;
  13649. m = u | 0;
  13650. var C = p | 0;
  13651. m != u && m++;
  13652. C != p && C++;
  13653. for (u = 0; u < m;) {
  13654. var r = u++;
  13655. b.zpp_inner.validate();
  13656. p = b.zpp_inner.minx;
  13657. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13658. e.zpp_inner.validate();
  13659. p += e.zpp_inner.x * r;
  13660. if (r == m - 1) r = b.zpp_inner.getmax().get_x();
  13661. else {
  13662. r = p;
  13663. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13664. e.zpp_inner.validate();
  13665. r += e.zpp_inner.x
  13666. }
  13667. for (var k = 0; k < C;) {
  13668. var w = k++;
  13669. b.zpp_inner.validate();
  13670. var t = b.zpp_inner.miny;
  13671. if (null != e &&
  13672. e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13673. e.zpp_inner.validate();
  13674. t += e.zpp_inner.y * w;
  13675. if (w == C - 1) w = b.zpp_inner.getmax().get_y();
  13676. else {
  13677. w = t;
  13678. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13679. e.zpp_inner.validate();
  13680. w += e.zpp_inner.y
  13681. }
  13682. c.geom.ZPP_MarchingSquares.run(a, p, t, r, w, d, g, f, l)
  13683. }
  13684. }
  13685. }
  13686. d.zpp_inner.weak ? (d.dispose(), !0) : !1;
  13687. null != e && (e.zpp_inner.weak ? (e.dispose(), !0) : !1);
  13688. return l
  13689. };
  13690. h.geom.Mat23 = function (a, b, d, g, e, f) {
  13691. null == f && (f = 0);
  13692. null == e && (e = 0);
  13693. null == g &&
  13694. (g = 1);
  13695. null == d && (d = 0);
  13696. null == b && (b = 0);
  13697. null == a && (a = 1);
  13698. this.zpp_inner = null;
  13699. this.zpp_inner = c.geom.ZPP_Mat23.get();
  13700. this.zpp_inner.outer = this;
  13701. if (a != a) throw "Error: Mat23::a cannot be NaN";
  13702. this.zpp_inner.a = a;
  13703. this.zpp_inner.invalidate();
  13704. this.zpp_inner.a;
  13705. if (b != b) throw "Error: Mat23::b cannot be NaN";
  13706. this.zpp_inner.b = b;
  13707. this.zpp_inner.invalidate();
  13708. this.zpp_inner.b;
  13709. if (e != e) throw "Error: Mat23::tx cannot be NaN";
  13710. this.zpp_inner.tx = e;
  13711. this.zpp_inner.invalidate();
  13712. this.zpp_inner.tx;
  13713. if (d != d) throw "Error: Mat23::c cannot be NaN";
  13714. this.zpp_inner.c = d;
  13715. this.zpp_inner.invalidate();
  13716. this.zpp_inner.c;
  13717. if (g != g) throw "Error: Mat23::d cannot be NaN";
  13718. this.zpp_inner.d = g;
  13719. this.zpp_inner.invalidate();
  13720. this.zpp_inner.d;
  13721. if (f != f) throw "Error: Mat23::ty cannot be NaN";
  13722. this.zpp_inner.ty = f;
  13723. this.zpp_inner.invalidate();
  13724. this.zpp_inner.ty
  13725. };
  13726. s["nape.geom.Mat23"] = h.geom.Mat23;
  13727. h.geom.Mat23.__name__ = ["nape", "geom", "Mat23"];
  13728. h.geom.Mat23.fromMatrix = function (a) {
  13729. return new h.geom.Mat23(a.a, a.c, a.b, a.d, a.tx, a.ty)
  13730. };
  13731. h.geom.Mat23.rotation = function (a) {
  13732. if (a != a) throw "Error: Cannot create rotation matrix with NaN angle";
  13733. var b = Math.cos(a);
  13734. a = Math.sin(a);
  13735. return new h.geom.Mat23(b, -a, a, b, 0, 0)
  13736. };
  13737. h.geom.Mat23.translation = function (a, b) {
  13738. return new h.geom.Mat23(1, 0, 0, 1, a, b)
  13739. };
  13740. h.geom.Mat23.scale = function (a, b) {
  13741. return new h.geom.Mat23(a, 0, 0, b, 0, 0)
  13742. };
  13743. h.geom.Mat23.prototype = {
  13744. orthogonalise: function () {
  13745. if (!this.orthogonal()) {
  13746. var a = Math.sqrt(this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.c * this.zpp_inner.c),
  13747. b = Math.sqrt(this.zpp_inner.b * this.zpp_inner.b + this.zpp_inner.d * this.zpp_inner.d);
  13748. if (a * a < h.Config.epsilon || b * b < h.Config.epsilon) throw "Error: Matrix is singular and cannot be orthogonalised";
  13749. var a = 1 / a,
  13750. b = 1 / b,
  13751. d = this;
  13752. d.set_a(d.zpp_inner.a * a);
  13753. d = this;
  13754. d.set_c(d.zpp_inner.c * a);
  13755. d = this;
  13756. d.set_b(d.zpp_inner.b * b);
  13757. d = this;
  13758. d.set_d(d.zpp_inner.d * b);
  13759. b = 0.25 * Math.PI - 0.5 * Math.acos((this.zpp_inner.a * this.zpp_inner.b + this.zpp_inner.c * this.zpp_inner.d) / 1);
  13760. 0 < this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c && (b = -b);
  13761. var a = Math.sin(b),
  13762. b = Math.cos(b),
  13763. d = this.zpp_inner.a * b - this.zpp_inner.c * a,
  13764. c = this.zpp_inner.b * b + this.zpp_inner.d * a;
  13765. this.set_c(this.zpp_inner.c * b + this.zpp_inner.a * a);
  13766. if (d != d) throw "Error: Mat23::a cannot be NaN";
  13767. this.zpp_inner.a = d;
  13768. this.zpp_inner.invalidate();
  13769. this.zpp_inner.a;
  13770. this.set_d(this.zpp_inner.d * b - this.zpp_inner.b * a);
  13771. if (c != c) throw "Error: Mat23::b cannot be NaN";
  13772. this.zpp_inner.b = c;
  13773. this.zpp_inner.invalidate();
  13774. this.zpp_inner.b;
  13775. this.zpp_inner.invalidate()
  13776. }
  13777. return this
  13778. },
  13779. equiorthogonalise: function () {
  13780. if (!this.equiorthogonal()) {
  13781. var a = Math.sqrt(this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.c * this.zpp_inner.c),
  13782. b = Math.sqrt(this.zpp_inner.b * this.zpp_inner.b + this.zpp_inner.d * this.zpp_inner.d);
  13783. if (a * a < h.Config.epsilon ||
  13784. b * b < h.Config.epsilon) throw "Error: Matrix is singular and cannot be equiorthogonalised";
  13785. var d = (a + b) / 2,
  13786. a = d / a,
  13787. b = d / b,
  13788. c = this;
  13789. c.set_a(c.zpp_inner.a * a);
  13790. c = this;
  13791. c.set_c(c.zpp_inner.c * a);
  13792. c = this;
  13793. c.set_b(c.zpp_inner.b * b);
  13794. c = this;
  13795. c.set_d(c.zpp_inner.d * b);
  13796. b = 0.25 * Math.PI - 0.5 * Math.acos((this.zpp_inner.a * this.zpp_inner.b + this.zpp_inner.c * this.zpp_inner.d) / (d * d));
  13797. 0 < this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c && (b = -b);
  13798. a = Math.sin(b);
  13799. b = Math.cos(b);
  13800. d = this.zpp_inner.a * b - this.zpp_inner.c * a;
  13801. c = this.zpp_inner.b *
  13802. b + this.zpp_inner.d * a;
  13803. this.set_c(this.zpp_inner.c * b + this.zpp_inner.a * a);
  13804. if (d != d) throw "Error: Mat23::a cannot be NaN";
  13805. this.zpp_inner.a = d;
  13806. this.zpp_inner.invalidate();
  13807. this.zpp_inner.a;
  13808. this.set_d(this.zpp_inner.d * b - this.zpp_inner.b * a);
  13809. if (c != c) throw "Error: Mat23::b cannot be NaN";
  13810. this.zpp_inner.b = c;
  13811. this.zpp_inner.invalidate();
  13812. this.zpp_inner.b;
  13813. this.zpp_inner.invalidate()
  13814. }
  13815. return this
  13816. },
  13817. orthogonal: function () {
  13818. var a = this.zpp_inner.a * this.zpp_inner.b + this.zpp_inner.c * this.zpp_inner.d;
  13819. if (a * a < h.Config.epsilon) {
  13820. var a =
  13821. this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.b * this.zpp_inner.b - 1,
  13822. b = this.zpp_inner.c * this.zpp_inner.c + this.zpp_inner.d * this.zpp_inner.d - 1;
  13823. return a * a < h.Config.epsilon && b * b < h.Config.epsilon
  13824. }
  13825. return !1
  13826. },
  13827. equiorthogonal: function () {
  13828. if (this.singular()) return !1;
  13829. var a = this.zpp_inner.a * this.zpp_inner.b + this.zpp_inner.c * this.zpp_inner.d;
  13830. return a * a < h.Config.epsilon ? (a = this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.b * this.zpp_inner.b - this.zpp_inner.c * this.zpp_inner.c - this.zpp_inner.d * this.zpp_inner.d, a * a <
  13831. h.Config.epsilon) : !1
  13832. },
  13833. toString: function () {
  13834. return "{ a: " + this.zpp_inner.a + " b: " + this.zpp_inner.b + " c: " + this.zpp_inner.c + " d: " + this.zpp_inner.d + " tx: " + this.zpp_inner.tx + " ty: " + this.zpp_inner.ty + " }"
  13835. },
  13836. inverseTransform: function (a, b, d) {
  13837. null == d && (d = !1);
  13838. null == b && (b = !1);
  13839. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13840. if (null == a) throw "Error: Cannot transform null Vec2";
  13841. if (this.singular()) throw "Error: Matrix is singular and inverse transformation cannot be performed";
  13842. var c =
  13843. 1 / (this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c);
  13844. if (b) d = h.geom.Vec2.get((function (b) {
  13845. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13846. a.zpp_inner.validate();
  13847. return a.zpp_inner.x
  13848. }(this) * this.zpp_inner.d - function (b) {
  13849. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13850. a.zpp_inner.validate();
  13851. return a.zpp_inner.y
  13852. }(this) * this.zpp_inner.b) * c, (function (b) {
  13853. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13854. a.zpp_inner.validate();
  13855. return a.zpp_inner.y
  13856. }(this) * this.zpp_inner.a - function (b) {
  13857. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13858. a.zpp_inner.validate();
  13859. return a.zpp_inner.x
  13860. }(this) * this.zpp_inner.c) * c, d);
  13861. else {
  13862. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13863. a.zpp_inner.validate();
  13864. b = a.zpp_inner.x - this.zpp_inner.tx;
  13865. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13866. a.zpp_inner.validate();
  13867. var e = a.zpp_inner.y - this.zpp_inner.ty;
  13868. d = h.geom.Vec2.get((b * this.zpp_inner.d - e * this.zpp_inner.b) * c, (e * this.zpp_inner.a - b * this.zpp_inner.c) * c, d)
  13869. }
  13870. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  13871. return d
  13872. },
  13873. transform: function (a, b, d) {
  13874. null == d && (d = !1);
  13875. null == b && (b = !1);
  13876. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13877. if (null == a) throw "Error: Cannot transform null Vec2";
  13878. b = b ? h.geom.Vec2.get(function (b) {
  13879. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13880. a.zpp_inner.validate();
  13881. return a.zpp_inner.x
  13882. }(this) *
  13883. this.zpp_inner.a + function (b) {
  13884. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13885. a.zpp_inner.validate();
  13886. return a.zpp_inner.y
  13887. }(this) * this.zpp_inner.b, function (b) {
  13888. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13889. a.zpp_inner.validate();
  13890. return a.zpp_inner.x
  13891. }(this) * this.zpp_inner.c + function (b) {
  13892. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13893. a.zpp_inner.validate();
  13894. return a.zpp_inner.y
  13895. }(this) * this.zpp_inner.d, d) : h.geom.Vec2.get(function (b) {
  13896. if (null !=
  13897. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13898. a.zpp_inner.validate();
  13899. return a.zpp_inner.x
  13900. }(this) * this.zpp_inner.a + function (b) {
  13901. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13902. a.zpp_inner.validate();
  13903. return a.zpp_inner.y
  13904. }(this) * this.zpp_inner.b + this.zpp_inner.tx, function (b) {
  13905. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13906. a.zpp_inner.validate();
  13907. return a.zpp_inner.x
  13908. }(this) * this.zpp_inner.c + function (b) {
  13909. if (null != a &&
  13910. a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  13911. a.zpp_inner.validate();
  13912. return a.zpp_inner.y
  13913. }(this) * this.zpp_inner.d + this.zpp_inner.ty, d);
  13914. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  13915. return b
  13916. },
  13917. concat: function (a) {
  13918. if (null == a) throw "Error: Cannot concatenate with null Mat23";
  13919. return new h.geom.Mat23(a.zpp_inner.a * this.zpp_inner.a + a.zpp_inner.b * this.zpp_inner.c, a.zpp_inner.a * this.zpp_inner.b + a.zpp_inner.b * this.zpp_inner.d, a.zpp_inner.c * this.zpp_inner.a + a.zpp_inner.d * this.zpp_inner.c, a.zpp_inner.c *
  13920. this.zpp_inner.b + a.zpp_inner.d * this.zpp_inner.d, a.zpp_inner.a * this.zpp_inner.tx + a.zpp_inner.b * this.zpp_inner.ty + a.zpp_inner.tx, a.zpp_inner.c * this.zpp_inner.tx + a.zpp_inner.d * this.zpp_inner.ty + a.zpp_inner.ty)
  13921. },
  13922. transpose: function () {
  13923. return new h.geom.Mat23(this.zpp_inner.a, this.zpp_inner.c, this.zpp_inner.b, this.zpp_inner.d, -this.zpp_inner.a * this.zpp_inner.tx - this.zpp_inner.c * this.zpp_inner.ty, -this.zpp_inner.b * this.zpp_inner.tx - this.zpp_inner.d * this.zpp_inner.ty)
  13924. },
  13925. inverse: function () {
  13926. if (this.singular()) throw "Error: Matrix is singular and cannot be inverted";
  13927. var a = 1 / (this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c);
  13928. return new h.geom.Mat23(this.zpp_inner.d * a, -this.zpp_inner.b * a, -this.zpp_inner.c * a, this.zpp_inner.a * a, (this.zpp_inner.b * this.zpp_inner.ty - this.zpp_inner.d * this.zpp_inner.tx) * a, (this.zpp_inner.c * this.zpp_inner.tx - this.zpp_inner.a * this.zpp_inner.ty) * a)
  13929. },
  13930. singular: function () {
  13931. var a = this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.b * this.zpp_inner.b + this.zpp_inner.c * this.zpp_inner.c + this.zpp_inner.d * this.zpp_inner.d,
  13932. b = this.zpp_inner.a *
  13933. this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c;
  13934. 0 > b && (b = -b);
  13935. return a > h.Config.illConditionedThreshold * b
  13936. },
  13937. get_determinant: function () {
  13938. return this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c
  13939. },
  13940. toMatrix: function (a) {
  13941. null == a && (a = new k.geom.Matrix);
  13942. a.a = this.zpp_inner.a;
  13943. a.b = this.zpp_inner.c;
  13944. a.c = this.zpp_inner.b;
  13945. a.d = this.zpp_inner.d;
  13946. a.tx = this.zpp_inner.tx;
  13947. a.ty = this.zpp_inner.ty;
  13948. return a
  13949. },
  13950. reset: function () {
  13951. return this.setAs()
  13952. },
  13953. setAs: function (a, b, d, c, e, f) {
  13954. null == f && (f = 0);
  13955. null == e && (e = 0);
  13956. null ==
  13957. c && (c = 1);
  13958. null == d && (d = 0);
  13959. null == b && (b = 0);
  13960. null == a && (a = 1);
  13961. this.zpp_inner.setas(a, b, d, c, e, f);
  13962. this.zpp_inner.invalidate();
  13963. return this
  13964. },
  13965. set: function (a) {
  13966. if (null == a) throw "Error: Cannot set form null matrix";
  13967. this.zpp_inner.set(a.zpp_inner);
  13968. this.zpp_inner.invalidate();
  13969. return this
  13970. },
  13971. copy: function () {
  13972. return new h.geom.Mat23(this.zpp_inner.a, this.zpp_inner.b, this.zpp_inner.c, this.zpp_inner.d, this.zpp_inner.tx, this.zpp_inner.ty)
  13973. },
  13974. set_ty: function (a) {
  13975. if (a != a) throw "Error: Mat23::ty cannot be NaN";
  13976. this.zpp_inner.ty = a;
  13977. this.zpp_inner.invalidate();
  13978. return this.zpp_inner.ty
  13979. },
  13980. get_ty: function () {
  13981. return this.zpp_inner.ty
  13982. },
  13983. set_tx: function (a) {
  13984. if (a != a) throw "Error: Mat23::tx cannot be NaN";
  13985. this.zpp_inner.tx = a;
  13986. this.zpp_inner.invalidate();
  13987. return this.zpp_inner.tx
  13988. },
  13989. get_tx: function () {
  13990. return this.zpp_inner.tx
  13991. },
  13992. set_d: function (a) {
  13993. if (a != a) throw "Error: Mat23::d cannot be NaN";
  13994. this.zpp_inner.d = a;
  13995. this.zpp_inner.invalidate();
  13996. return this.zpp_inner.d
  13997. },
  13998. get_d: function () {
  13999. return this.zpp_inner.d
  14000. },
  14001. set_c: function (a) {
  14002. if (a != a) throw "Error: Mat23::c cannot be NaN";
  14003. this.zpp_inner.c = a;
  14004. this.zpp_inner.invalidate();
  14005. return this.zpp_inner.c
  14006. },
  14007. get_c: function () {
  14008. return this.zpp_inner.c
  14009. },
  14010. set_b: function (a) {
  14011. if (a != a) throw "Error: Mat23::b cannot be NaN";
  14012. this.zpp_inner.b = a;
  14013. this.zpp_inner.invalidate();
  14014. return this.zpp_inner.b
  14015. },
  14016. get_b: function () {
  14017. return this.zpp_inner.b
  14018. },
  14019. set_a: function (a) {
  14020. if (a != a) throw "Error: Mat23::a cannot be NaN";
  14021. this.zpp_inner.a = a;
  14022. this.zpp_inner.invalidate();
  14023. return this.zpp_inner.a
  14024. },
  14025. get_a: function () {
  14026. return this.zpp_inner.a
  14027. },
  14028. __class__: h.geom.Mat23
  14029. };
  14030. h.geom.MatMN =
  14031. function (a, b) {
  14032. this.zpp_inner = null;
  14033. if (0 >= a || 0 >= b) throw "Error: MatMN::dimensions cannot be < 1";
  14034. this.zpp_inner = new c.geom.ZPP_MatMN(a, b);
  14035. this.zpp_inner.outer = this
  14036. };
  14037. s["nape.geom.MatMN"] = h.geom.MatMN;
  14038. h.geom.MatMN.__name__ = ["nape", "geom", "MatMN"];
  14039. h.geom.MatMN.prototype = {
  14040. mul: function (a) {
  14041. if (this.zpp_inner.n != a.zpp_inner.m) throw "Error: Matrix dimensions aren't compatible";
  14042. for (var b = new h.geom.MatMN(this.zpp_inner.m, a.zpp_inner.n), d = 0, c = this.zpp_inner.m; d < c;)
  14043. for (var e = d++, f = 0, l = a.zpp_inner.n; f < l;) {
  14044. for (var m =
  14045. f++, u = 0, p = 0, C = this.zpp_inner.n; p < C;) {
  14046. var r = p++,
  14047. k;
  14048. if (0 > e || 0 > r || e >= this.zpp_inner.m || r >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
  14049. k = this.zpp_inner.x[e * this.zpp_inner.n + r];
  14050. if (0 > r || 0 > m || r >= a.zpp_inner.m || m >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  14051. u += k * a.zpp_inner.x[r * a.zpp_inner.n + m]
  14052. }
  14053. if (0 > e || 0 > m || e >= b.zpp_inner.m || m >= b.zpp_inner.n) throw "Error: MatMN indices out of range";
  14054. b.zpp_inner.x[e * b.zpp_inner.n + m] = u
  14055. }
  14056. return b
  14057. },
  14058. transpose: function () {
  14059. for (var a = new h.geom.MatMN(this.zpp_inner.n,
  14060. this.zpp_inner.m), b = 0, d = this.zpp_inner.m; b < d;)
  14061. for (var c = b++, e = 0, f = this.zpp_inner.n; e < f;) {
  14062. var l = e++;
  14063. if (0 > l || 0 > c || l >= a.zpp_inner.m || c >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
  14064. var m = a.zpp_inner.x,
  14065. u = l * a.zpp_inner.n + c,
  14066. p = void 0;
  14067. if (0 > c || 0 > l || c >= this.zpp_inner.m || l >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
  14068. p = this.zpp_inner.x[c * this.zpp_inner.n + l];
  14069. m[u] = p
  14070. }
  14071. return a
  14072. },
  14073. toString: function () {
  14074. for (var a = "{ ", b = !0, d = 0, c = this.zpp_inner.m; d < c;) {
  14075. var e = d++;
  14076. b || (a += "; ");
  14077. for (var b = !1, f = 0, l =
  14078. this.zpp_inner.n; f < l;) {
  14079. var m = f++,
  14080. h = void 0;
  14081. if (0 > e || 0 > m || e >= this.zpp_inner.m || m >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
  14082. h = this.zpp_inner.x[e * this.zpp_inner.n + m];
  14083. a += h + " "
  14084. }
  14085. }
  14086. return a + "}"
  14087. },
  14088. setx: function (a, b, d) {
  14089. if (0 > a || 0 > b || a >= this.zpp_inner.m || b >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
  14090. return this.zpp_inner.x[a * this.zpp_inner.n + b] = d
  14091. },
  14092. x: function (a, b) {
  14093. if (0 > a || 0 > b || a >= this.zpp_inner.m || b >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
  14094. return this.zpp_inner.x[a *
  14095. this.zpp_inner.n + b]
  14096. },
  14097. get_cols: function () {
  14098. return this.zpp_inner.n
  14099. },
  14100. get_rows: function () {
  14101. return this.zpp_inner.m
  14102. },
  14103. __class__: h.geom.MatMN
  14104. };
  14105. h.geom.Ray = function (a, b) {
  14106. this.zpp_inner = null;
  14107. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14108. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14109. this.zpp_inner = new c.geom.ZPP_Ray;
  14110. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14111. if (null == a) throw "Error: Ray::origin cannot be null";
  14112. this.zpp_inner.origin.set(a);
  14113. this.zpp_inner.origin;
  14114. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14115. if (null == b) throw "Error: Ray::direction cannot be null";
  14116. this.zpp_inner.direction.set(b);
  14117. this.zpp_inner.zip_dir = !0;
  14118. this.zpp_inner.direction;
  14119. this.zpp_inner.maxdist = Math.POSITIVE_INFINITY
  14120. };
  14121. s["nape.geom.Ray"] = h.geom.Ray;
  14122. h.geom.Ray.__name__ = ["nape", "geom", "Ray"];
  14123. h.geom.Ray.fromSegment = function (a, b) {
  14124. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14125. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14126. if (null == a) throw "Error: Ray::fromSegment::start is null";
  14127. if (null == b) throw "Error: Ray::fromSegment::end is null";
  14128. var d = b.sub(a, !0),
  14129. d = new h.geom.Ray(a, d);
  14130. d.set_maxDistance(Math.sqrt(c.geom.ZPP_VecMath.vec_dsq(function (b) {
  14131. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14132. a.zpp_inner.validate();
  14133. return a.zpp_inner.x
  14134. }(this), function (b) {
  14135. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14136. a.zpp_inner.validate();
  14137. return a.zpp_inner.y
  14138. }(this), function (a) {
  14139. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14140. b.zpp_inner.validate();
  14141. return b.zpp_inner.x
  14142. }(this), function (a) {
  14143. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14144. b.zpp_inner.validate();
  14145. return b.zpp_inner.y
  14146. }(this))));
  14147. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14148. b.zpp_inner.weak ? (b.dispose(), !0) : !1;
  14149. return d
  14150. };
  14151. h.geom.Ray.prototype = {
  14152. copy: function () {
  14153. var a = new h.geom.Ray(this.zpp_inner.origin,
  14154. this.zpp_inner.direction);
  14155. a.set_maxDistance(this.zpp_inner.maxdist);
  14156. return a
  14157. },
  14158. at: function (a, b) {
  14159. null == b && (b = !1);
  14160. this.zpp_inner.validate_dir();
  14161. return h.geom.Vec2.get(this.zpp_inner.origin.get_x() + a * this.zpp_inner.dirx, this.zpp_inner.origin.get_y() + a * this.zpp_inner.diry, b)
  14162. },
  14163. aabb: function () {
  14164. return this.zpp_inner.rayAABB().wrapper()
  14165. },
  14166. set_maxDistance: function (a) {
  14167. if (a != a) throw "Error: maxDistance cannot be NaN";
  14168. this.zpp_inner.maxdist = a;
  14169. return this.zpp_inner.maxdist
  14170. },
  14171. get_maxDistance: function () {
  14172. return this.zpp_inner.maxdist
  14173. },
  14174. set_direction: function (a) {
  14175. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14176. if (null == a) throw "Error: Ray::direction cannot be null";
  14177. this.zpp_inner.direction.set(a);
  14178. this.zpp_inner.zip_dir = !0;
  14179. return this.zpp_inner.direction
  14180. },
  14181. get_direction: function () {
  14182. return this.zpp_inner.direction
  14183. },
  14184. set_origin: function (a) {
  14185. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14186. if (null == a) throw "Error: Ray::origin cannot be null";
  14187. this.zpp_inner.origin.set(a);
  14188. return this.zpp_inner.origin
  14189. },
  14190. get_origin: function () {
  14191. return this.zpp_inner.origin
  14192. },
  14193. get_userData: function () {
  14194. null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
  14195. return this.zpp_inner.userData
  14196. },
  14197. __class__: h.geom.Ray
  14198. };
  14199. h.geom.RayResult = function () {
  14200. this.zpp_inner = null;
  14201. if (!c.geom.ZPP_ConvexRayResult.internal) throw "Error: RayResult cannot be instantiated derp!";
  14202. };
  14203. s["nape.geom.RayResult"] = h.geom.RayResult;
  14204. h.geom.RayResult.__name__ = ["nape", "geom", "RayResult"];
  14205. h.geom.RayResult.prototype = {
  14206. toString: function () {
  14207. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14208. var a = "{ shape: " + K.string(function (a) {
  14209. if (null != a.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14210. return a.zpp_inner.shape
  14211. }(this)) + " distance: ";
  14212. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14213. return a + this.zpp_inner.toiDistance + " ?inner: " + K.string(function (a) {
  14214. if (null != a.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14215. return a.zpp_inner.inner
  14216. }(this)) + " }"
  14217. },
  14218. dispose: function () {
  14219. if (null !=
  14220. this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14221. this.zpp_inner.free()
  14222. },
  14223. get_shape: function () {
  14224. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14225. return this.zpp_inner.shape
  14226. },
  14227. get_inner: function () {
  14228. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14229. return this.zpp_inner.inner
  14230. },
  14231. get_distance: function () {
  14232. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14233. return this.zpp_inner.toiDistance
  14234. },
  14235. get_normal: function () {
  14236. if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  14237. return this.zpp_inner.normal
  14238. },
  14239. __class__: h.geom.RayResult
  14240. };
  14241. h.geom.RayResultIterator = function () {
  14242. this.zpp_next = null;
  14243. this.zpp_critical = !1;
  14244. this.zpp_i = 0;
  14245. this.zpp_inner = null;
  14246. if (!c.util.ZPP_RayResultList.internal) throw "Error: Cannot instantiate RayResultIterator derp!";
  14247. };
  14248. s["nape.geom.RayResultIterator"] = h.geom.RayResultIterator;
  14249. h.geom.RayResultIterator.__name__ = ["nape", "geom", "RayResultIterator"];
  14250. h.geom.RayResultIterator.get = function (a) {
  14251. var b = null == h.geom.RayResultIterator.zpp_pool ? function (a) {
  14252. c.util.ZPP_RayResultList.internal = !0;
  14253. a = new h.geom.RayResultIterator;
  14254. c.util.ZPP_RayResultList.internal = !1;
  14255. return a
  14256. }(this) : function (a) {
  14257. a = h.geom.RayResultIterator.zpp_pool;
  14258. h.geom.RayResultIterator.zpp_pool = a.zpp_next;
  14259. return a
  14260. }(this);
  14261. b.zpp_i = 0;
  14262. b.zpp_inner = a;
  14263. b.zpp_critical = !1;
  14264. return b
  14265. };
  14266. h.geom.RayResultIterator.prototype = {
  14267. next: function () {
  14268. this.zpp_critical = !1;
  14269. return this.zpp_inner.at(this.zpp_i++)
  14270. },
  14271. hasNext: function () {
  14272. this.zpp_inner.zpp_inner.valmod();
  14273. var a = this.zpp_inner.get_length();
  14274. this.zpp_critical = !0;
  14275. if (this.zpp_i < a) return !0;
  14276. this.zpp_next = h.geom.RayResultIterator.zpp_pool;
  14277. h.geom.RayResultIterator.zpp_pool = this;
  14278. this.zpp_inner = null;
  14279. return !1
  14280. },
  14281. __class__: h.geom.RayResultIterator
  14282. };
  14283. h.geom.RayResultList = function () {
  14284. this.zpp_inner = null;
  14285. this.zpp_inner = new c.util.ZPP_RayResultList;
  14286. this.zpp_inner.outer = this
  14287. };
  14288. s["nape.geom.RayResultList"] = h.geom.RayResultList;
  14289. h.geom.RayResultList.__name__ = ["nape", "geom",
  14290. "RayResultList"
  14291. ];
  14292. h.geom.RayResultList.fromArray = function (a) {
  14293. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  14294. for (var b = new h.geom.RayResultList, d = 0; d < a.length;) {
  14295. var c = a[d];
  14296. ++d;
  14297. b.push(c)
  14298. }
  14299. return b
  14300. };
  14301. h.geom.RayResultList.prototype = {
  14302. filter: function (a) {
  14303. if (null == a) throw "Error: Cannot select elements of list with null";
  14304. for (var b = 0; b < this.get_length();) {
  14305. var d = this.at(b);
  14306. try {
  14307. a(d) ? b++ : this.remove(d)
  14308. } catch (c) {
  14309. break
  14310. }
  14311. }
  14312. return this
  14313. },
  14314. foreach: function (a) {
  14315. if (null == a) throw "Error: Cannot execute null on list elements";
  14316. var b;
  14317. this.zpp_inner.valmod();
  14318. for (b = h.geom.RayResultIterator.get(this); b.hasNext();) try {
  14319. var d = a,
  14320. c;
  14321. b.zpp_critical = !1;
  14322. c = b.zpp_inner.at(b.zpp_i++);
  14323. d(c)
  14324. } catch (e) {
  14325. b.zpp_next = h.geom.RayResultIterator.zpp_pool;
  14326. h.geom.RayResultIterator.zpp_pool = b;
  14327. b.zpp_inner = null;
  14328. break
  14329. }
  14330. return this
  14331. },
  14332. toString: function () {
  14333. var a = "[",
  14334. b = !0,
  14335. d;
  14336. this.zpp_inner.valmod();
  14337. for (d = h.geom.RayResultIterator.get(this); d.hasNext();) {
  14338. var c = d.next();
  14339. b || (a += ",");
  14340. a += null == c ? "NULL" : c.toString();
  14341. b = !1
  14342. }
  14343. return a + "]"
  14344. },
  14345. merge: function (a) {
  14346. if (null == a) throw "Error: Cannot merge with null list";
  14347. a.zpp_inner.valmod();
  14348. for (a = h.geom.RayResultIterator.get(a); a.hasNext();) {
  14349. var b = a.next();
  14350. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  14351. }
  14352. },
  14353. copy: function (a) {
  14354. null == a && (a = !1);
  14355. var b = new h.geom.RayResultList,
  14356. d;
  14357. this.zpp_inner.valmod();
  14358. for (d = h.geom.RayResultIterator.get(this); d.hasNext();) {
  14359. var c = d.next();
  14360. b.push(a ? function (a) {
  14361. throw "Error: RayResult is not a copyable type";
  14362. }(this) : c)
  14363. }
  14364. return b
  14365. },
  14366. iterator: function () {
  14367. this.zpp_inner.valmod();
  14368. return h.geom.RayResultIterator.get(this)
  14369. },
  14370. empty: function () {
  14371. return null ==
  14372. this.zpp_inner.inner.head
  14373. },
  14374. clear: function () {
  14375. if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
  14376. if (this.zpp_inner.reverse_flag)
  14377. for (; null != this.zpp_inner.inner.head;) this.pop();
  14378. else
  14379. for (; null != this.zpp_inner.inner.head;) this.shift()
  14380. },
  14381. remove: function (a) {
  14382. if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
  14383. this.zpp_inner.modify_test();
  14384. this.zpp_inner.valmod();
  14385. var b;
  14386. b = !1;
  14387. for (var d = this.zpp_inner.inner.head; null != d;) {
  14388. if (d.elt == a) {
  14389. b = !0;
  14390. break
  14391. }
  14392. d = d.next
  14393. }
  14394. b && (null != this.zpp_inner.subber &&
  14395. this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a), this.zpp_inner.invalidate());
  14396. return b
  14397. },
  14398. add: function (a) {
  14399. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  14400. },
  14401. shift: function () {
  14402. if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
  14403. this.zpp_inner.modify_test();
  14404. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  14405. this.zpp_inner.valmod();
  14406. var a = null;
  14407. if (this.zpp_inner.reverse_flag) {
  14408. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next &&
  14409. (this.zpp_inner.at_ite = null);
  14410. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  14411. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt;
  14412. null != this.zpp_inner.subber && this.zpp_inner.subber(a);
  14413. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  14414. } else a = this.zpp_inner.inner.head.elt, null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  14415. this.zpp_inner.invalidate();
  14416. return a
  14417. },
  14418. pop: function () {
  14419. if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
  14420. this.zpp_inner.modify_test();
  14421. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  14422. this.zpp_inner.valmod();
  14423. var a = null;
  14424. if (this.zpp_inner.reverse_flag) a = this.zpp_inner.inner.head.elt, null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  14425. else {
  14426. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  14427. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  14428. a = null ==
  14429. b ? this.zpp_inner.inner.head.elt : b.next.elt;
  14430. null != this.zpp_inner.subber && this.zpp_inner.subber(a);
  14431. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  14432. }
  14433. this.zpp_inner.invalidate();
  14434. return a
  14435. },
  14436. unshift: function (a) {
  14437. if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
  14438. this.zpp_inner.modify_test();
  14439. this.zpp_inner.valmod();
  14440. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  14441. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ?
  14442. null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a)) : this.zpp_inner.inner.add(a), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  14443. return b
  14444. },
  14445. push: function (a) {
  14446. if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
  14447. this.zpp_inner.modify_test();
  14448. this.zpp_inner.valmod();
  14449. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  14450. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a) :
  14451. (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  14452. return b
  14453. },
  14454. at: function (a) {
  14455. this.zpp_inner.valmod();
  14456. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  14457. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  14458. if (a < this.zpp_inner.at_index ||
  14459. null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  14460. else
  14461. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  14462. return this.zpp_inner.at_ite.elt
  14463. },
  14464. has: function (a) {
  14465. this.zpp_inner.valmod();
  14466. return this.zpp_inner.inner.has(a)
  14467. },
  14468. get_length: function () {
  14469. this.zpp_inner.valmod();
  14470. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  14471. return this.zpp_inner.user_length
  14472. },
  14473. __class__: h.geom.RayResultList
  14474. };
  14475. h.geom.Vec2 = function (a, b) {
  14476. null == b && (b = 0);
  14477. null == a && (a = 0);
  14478. this.zpp_inner = this.zpp_pool = null;
  14479. if (a != a || b != b) throw "Error: Vec2 components cannot be NaN";
  14480. this.zpp_inner = c.geom.ZPP_Vec2.get(a, b, null);
  14481. this.zpp_inner.outer = this
  14482. };
  14483. s["nape.geom.Vec2"] = h.geom.Vec2;
  14484. h.geom.Vec2.__name__ = ["nape", "geom", "Vec2"];
  14485. h.geom.Vec2.weak = function (a, b) {
  14486. null == b && (b = 0);
  14487. null == a && (a = 0);
  14488. return h.geom.Vec2.get(a, b, !0)
  14489. };
  14490. h.geom.Vec2.get = function (a, b, d) {
  14491. null == d && (d = !1);
  14492. null == b && (b = 0);
  14493. null == a && (a = 0);
  14494. if (a !=
  14495. a || b != b) throw "Error: Vec2 components cannot be NaN";
  14496. var g;
  14497. null == c.util.ZPP_PubPool.poolVec2 ? g = new h.geom.Vec2 : (g = c.util.ZPP_PubPool.poolVec2, c.util.ZPP_PubPool.poolVec2 = g.zpp_pool, g.zpp_pool = null, g.zpp_disp = !1, g == c.util.ZPP_PubPool.nextVec2 && (c.util.ZPP_PubPool.nextVec2 = null));
  14498. if (null == g.zpp_inner) g.zpp_inner = c.geom.ZPP_Vec2.get(a, b, null), g.zpp_inner.outer = g;
  14499. else {
  14500. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14501. g.zpp_inner.immutable();
  14502. if (a != a || b != b) throw "Error: Vec2 components cannot be NaN";
  14503. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14504. g.zpp_inner.validate();
  14505. var e;
  14506. if (!(e = g.zpp_inner.x != a)) {
  14507. if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14508. g.zpp_inner.validate();
  14509. e = g.zpp_inner.y != b
  14510. }
  14511. e && (g.zpp_inner.x = a, g.zpp_inner.y = b, g.zpp_inner.invalidate());
  14512. g
  14513. }
  14514. g.zpp_inner.weak = d;
  14515. return g
  14516. };
  14517. h.geom.Vec2.fromPoint = function (a, b) {
  14518. null == b && (b = !1);
  14519. if (null == a) throw "Error: Cannot create Vec2 from null Point object";
  14520. if (a.x != a.x || a.y != a.y) throw "Error: Error: Vec2 components cannot be NaN";
  14521. return h.geom.Vec2.get(a.x, a.y, b)
  14522. };
  14523. h.geom.Vec2.fromPolar = function (a, b, d) {
  14524. null == d && (d = !1);
  14525. if (a != a) throw "Error: Vec2::length cannot be NaN";
  14526. if (b != b) throw "Error: Vec2::angle cannot be NaN";
  14527. return h.geom.Vec2.get(a * Math.cos(b), a * Math.sin(b), d)
  14528. };
  14529. h.geom.Vec2.dsq = function (a, b) {
  14530. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14531. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14532. if (null == a || null == b) throw "Error: Cannot compute squared distance between null Vec2";
  14533. var d = c.geom.ZPP_VecMath.vec_dsq(function (b) {
  14534. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14535. a.zpp_inner.validate();
  14536. return a.zpp_inner.x
  14537. }(this), function (b) {
  14538. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14539. a.zpp_inner.validate();
  14540. return a.zpp_inner.y
  14541. }(this), function (a) {
  14542. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14543. b.zpp_inner.validate();
  14544. return b.zpp_inner.x
  14545. }(this), function (a) {
  14546. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14547. b.zpp_inner.validate();
  14548. return b.zpp_inner.y
  14549. }(this));
  14550. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14551. b.zpp_inner.weak ? (b.dispose(), !0) : !1;
  14552. return d
  14553. };
  14554. h.geom.Vec2.distance = function (a, b) {
  14555. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14556. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14557. if (null == a || null == b) throw "Error: Cannot compute squared distance between null Vec2";
  14558. var d = Math.sqrt(c.geom.ZPP_VecMath.vec_dsq(function (b) {
  14559. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14560. a.zpp_inner.validate();
  14561. return a.zpp_inner.x
  14562. }(this), function (b) {
  14563. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14564. a.zpp_inner.validate();
  14565. return a.zpp_inner.y
  14566. }(this), function (a) {
  14567. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14568. b.zpp_inner.validate();
  14569. return b.zpp_inner.x
  14570. }(this), function (a) {
  14571. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14572. b.zpp_inner.validate();
  14573. return b.zpp_inner.y
  14574. }(this)));
  14575. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14576. b.zpp_inner.weak ? (b.dispose(), !0) : !1;
  14577. return d
  14578. };
  14579. h.geom.Vec2.prototype = {
  14580. toString: function () {
  14581. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14582. this.zpp_inner.validate();
  14583. return this.zpp_inner.toString()
  14584. },
  14585. perp: function (a) {
  14586. null == a && (a = !1);
  14587. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14588. return h.geom.Vec2.get(- function (a) {
  14589. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14590. a.zpp_inner.validate();
  14591. return a.zpp_inner.y
  14592. }(this), function (a) {
  14593. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14594. a.zpp_inner.validate();
  14595. return a.zpp_inner.x
  14596. }(this), a)
  14597. },
  14598. cross: function (a) {
  14599. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14600. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14601. if (null == a) throw "Error: Cannot take cross product with null vector";
  14602. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14603. a.zpp_inner.validate();
  14604. var b = a.zpp_inner.y;
  14605. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14606. this.zpp_inner.validate();
  14607. b *= this.zpp_inner.x;
  14608. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14609. a.zpp_inner.validate();
  14610. var d = a.zpp_inner.x;
  14611. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14612. this.zpp_inner.validate();
  14613. b -= d * this.zpp_inner.y;
  14614. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14615. return b
  14616. },
  14617. dot: function (a) {
  14618. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14619. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14620. if (null == a) throw "Error: Cannot take dot product with null vector";
  14621. var b;
  14622. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14623. this.zpp_inner.validate();
  14624. b = this.zpp_inner.x;
  14625. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14626. a.zpp_inner.validate();
  14627. b *= a.zpp_inner.x;
  14628. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14629. this.zpp_inner.validate();
  14630. var d = this.zpp_inner.y;
  14631. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14632. a.zpp_inner.validate();
  14633. b += d * a.zpp_inner.y;
  14634. a.zpp_inner.weak ?
  14635. (a.dispose(), !0) : !1;
  14636. return b
  14637. },
  14638. muleq: function (a) {
  14639. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14640. this.zpp_inner.immutable();
  14641. if (a != a) throw "Error: Cannot multiply with NaN";
  14642. return this.setxy(function (a) {
  14643. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14644. a.zpp_inner.validate();
  14645. return a.zpp_inner.x
  14646. }(this) * a, function (a) {
  14647. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14648. a.zpp_inner.validate();
  14649. return a.zpp_inner.y
  14650. }(this) * a)
  14651. },
  14652. subeq: function (a) {
  14653. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14654. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14655. this.zpp_inner.immutable();
  14656. if (null == a) throw "Error: Cannot subtract null vectors";
  14657. this.setxy(function (a) {
  14658. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14659. a.zpp_inner.validate();
  14660. return a.zpp_inner.x
  14661. }(this) - function (b) {
  14662. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14663. a.zpp_inner.validate();
  14664. return a.zpp_inner.x
  14665. }(this), function (a) {
  14666. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14667. a.zpp_inner.validate();
  14668. return a.zpp_inner.y
  14669. }(this) - function (b) {
  14670. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14671. a.zpp_inner.validate();
  14672. return a.zpp_inner.y
  14673. }(this));
  14674. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14675. return this
  14676. },
  14677. addeq: function (a) {
  14678. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14679. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14680. this.zpp_inner.immutable();
  14681. if (null == a) throw "Error: Cannot add null vectors";
  14682. this.setxy(function (a) {
  14683. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14684. a.zpp_inner.validate();
  14685. return a.zpp_inner.x
  14686. }(this) + function (b) {
  14687. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14688. a.zpp_inner.validate();
  14689. return a.zpp_inner.x
  14690. }(this), function (a) {
  14691. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14692. a.zpp_inner.validate();
  14693. return a.zpp_inner.y
  14694. }(this) + function (b) {
  14695. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14696. a.zpp_inner.validate();
  14697. return a.zpp_inner.y
  14698. }(this));
  14699. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14700. return this
  14701. },
  14702. mul: function (a, b) {
  14703. null == b && (b = !1);
  14704. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14705. if (a != a) throw "Error: Cannot multiply with NaN";
  14706. return h.geom.Vec2.get(function (a) {
  14707. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14708. a.zpp_inner.validate();
  14709. return a.zpp_inner.x
  14710. }(this) * a, function (a) {
  14711. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14712. a.zpp_inner.validate();
  14713. return a.zpp_inner.y
  14714. }(this) * a, b)
  14715. },
  14716. sub: function (a, b) {
  14717. null == b &&
  14718. (b = !1);
  14719. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14720. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14721. if (null == a) throw "Error: Cannot subtract null vectors";
  14722. var d = h.geom.Vec2.get(function (a) {
  14723. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14724. a.zpp_inner.validate();
  14725. return a.zpp_inner.x
  14726. }(this) - function (b) {
  14727. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14728. a.zpp_inner.validate();
  14729. return a.zpp_inner.x
  14730. }(this),
  14731. function (a) {
  14732. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14733. a.zpp_inner.validate();
  14734. return a.zpp_inner.y
  14735. }(this) - function (b) {
  14736. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14737. a.zpp_inner.validate();
  14738. return a.zpp_inner.y
  14739. }(this), b);
  14740. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14741. return d
  14742. },
  14743. addMul: function (a, b, d) {
  14744. null == d && (d = !1);
  14745. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14746. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14747. if (null == a) throw "Error: Cannot add null vectors";
  14748. b = h.geom.Vec2.get(function (a) {
  14749. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14750. a.zpp_inner.validate();
  14751. return a.zpp_inner.x
  14752. }(this) + function (b) {
  14753. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14754. a.zpp_inner.validate();
  14755. return a.zpp_inner.x
  14756. }(this) * b, function (a) {
  14757. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14758. a.zpp_inner.validate();
  14759. return a.zpp_inner.y
  14760. }(this) + function (b) {
  14761. if (null !=
  14762. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14763. a.zpp_inner.validate();
  14764. return a.zpp_inner.y
  14765. }(this) * b, d);
  14766. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14767. return b
  14768. },
  14769. add: function (a, b) {
  14770. null == b && (b = !1);
  14771. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14772. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14773. if (null == a) throw "Error: Cannot add null vectors";
  14774. var d = h.geom.Vec2.get(function (a) {
  14775. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14776. a.zpp_inner.validate();
  14777. return a.zpp_inner.x
  14778. }(this) + function (b) {
  14779. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14780. a.zpp_inner.validate();
  14781. return a.zpp_inner.x
  14782. }(this), function (a) {
  14783. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14784. a.zpp_inner.validate();
  14785. return a.zpp_inner.y
  14786. }(this) + function (b) {
  14787. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14788. a.zpp_inner.validate();
  14789. return a.zpp_inner.y
  14790. }(this), b);
  14791. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14792. return d
  14793. },
  14794. unit: function (a) {
  14795. null == a && (a = !1);
  14796. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14797. if (0 == function (a) {
  14798. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14799. return Math.sqrt(function (a) {
  14800. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14801. a.zpp_inner.validate();
  14802. return a.zpp_inner.x
  14803. }(a) * function (a) {
  14804. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14805. a.zpp_inner.validate();
  14806. return a.zpp_inner.x
  14807. }(a) + function (a) {
  14808. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14809. a.zpp_inner.validate();
  14810. return a.zpp_inner.y
  14811. }(a) * function (a) {
  14812. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14813. a.zpp_inner.validate();
  14814. return a.zpp_inner.y
  14815. }(a))
  14816. }(this)) throw "Error: Cannot normalise vector of length 0";
  14817. var b = 1 / Math.sqrt(function (a) {
  14818. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14819. a.zpp_inner.validate();
  14820. return a.zpp_inner.x
  14821. }(this) * function (a) {
  14822. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14823. a.zpp_inner.validate();
  14824. return a.zpp_inner.x
  14825. }(this) +
  14826. function (a) {
  14827. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14828. a.zpp_inner.validate();
  14829. return a.zpp_inner.y
  14830. }(this) * function (a) {
  14831. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14832. a.zpp_inner.validate();
  14833. return a.zpp_inner.y
  14834. }(this));
  14835. return h.geom.Vec2.get(function (a) {
  14836. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14837. a.zpp_inner.validate();
  14838. return a.zpp_inner.x
  14839. }(this) * b, function (a) {
  14840. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14841. a.zpp_inner.validate();
  14842. return a.zpp_inner.y
  14843. }(this) * b, a)
  14844. },
  14845. normalise: function () {
  14846. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14847. this.zpp_inner.immutable();
  14848. if (0 == function (a) {
  14849. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14850. return Math.sqrt(function (a) {
  14851. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14852. a.zpp_inner.validate();
  14853. return a.zpp_inner.x
  14854. }(a) * function (a) {
  14855. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14856. a.zpp_inner.validate();
  14857. return a.zpp_inner.x
  14858. }(a) + function (a) {
  14859. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14860. a.zpp_inner.validate();
  14861. return a.zpp_inner.y
  14862. }(a) * function (a) {
  14863. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14864. a.zpp_inner.validate();
  14865. return a.zpp_inner.y
  14866. }(a))
  14867. }(this)) throw "Error: Cannot normalise vector of length 0";
  14868. var a;
  14869. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14870. this.zpp_inner.validate();
  14871. a = this.zpp_inner.x;
  14872. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14873. this.zpp_inner.validate();
  14874. a *= this.zpp_inner.x;
  14875. var b;
  14876. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14877. this.zpp_inner.validate();
  14878. b = this.zpp_inner.y;
  14879. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14880. this.zpp_inner.validate();
  14881. a = 1 / Math.sqrt(a + b * this.zpp_inner.y);
  14882. var d = this;
  14883. d.set_x(function (a) {
  14884. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14885. d.zpp_inner.validate();
  14886. return d.zpp_inner.x
  14887. }(this) * a);
  14888. d = this;
  14889. d.set_y(function (a) {
  14890. if (null !=
  14891. d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14892. d.zpp_inner.validate();
  14893. return d.zpp_inner.y
  14894. }(this) * a);
  14895. this.zpp_inner.invalidate();
  14896. return this
  14897. },
  14898. reflect: function (a, b) {
  14899. null == b && (b = !1);
  14900. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14901. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14902. if (0 == function (a) {
  14903. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14904. return Math.sqrt(function (a) {
  14905. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14906. a.zpp_inner.validate();
  14907. return a.zpp_inner.x
  14908. }(a) * function (a) {
  14909. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14910. a.zpp_inner.validate();
  14911. return a.zpp_inner.x
  14912. }(a) + function (a) {
  14913. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14914. a.zpp_inner.validate();
  14915. return a.zpp_inner.y
  14916. }(a) * function (a) {
  14917. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14918. a.zpp_inner.validate();
  14919. return a.zpp_inner.y
  14920. }(a))
  14921. }(this)) throw "Error: Cannot reflect in zero vector";
  14922. var d = function (a) {
  14923. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14924. return h.geom.Vec2.get(function (a) {
  14925. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14926. a.zpp_inner.validate();
  14927. return a.zpp_inner.x
  14928. }(a), function (a) {
  14929. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14930. a.zpp_inner.validate();
  14931. return a.zpp_inner.y
  14932. }(a), !0)
  14933. }(this).normalise(),
  14934. d = a.sub(d.muleq(2 * d.dot(a)), b);
  14935. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  14936. return d
  14937. },
  14938. rotate: function (a) {
  14939. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14940. this.zpp_inner.immutable();
  14941. if (a != a) throw "Error: Cannot rotate Vec2 by NaN";
  14942. if (0 != a % (2 * Math.PI)) {
  14943. var b = Math.sin(a);
  14944. a = Math.cos(a);
  14945. var d = a * this.zpp_inner.x - b * this.zpp_inner.y;
  14946. this.zpp_inner.y = this.zpp_inner.x * b + this.zpp_inner.y * a;
  14947. this.zpp_inner.x = d;
  14948. this.zpp_inner.invalidate()
  14949. }
  14950. return this
  14951. },
  14952. set_angle: function (a) {
  14953. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14954. this.zpp_inner.immutable();
  14955. if (a != a) throw "Error: Vec2::angle cannot be NaN";
  14956. var b = function (a) {
  14957. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14958. return Math.sqrt(function (a) {
  14959. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14960. a.zpp_inner.validate();
  14961. return a.zpp_inner.x
  14962. }(a) * function (a) {
  14963. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14964. a.zpp_inner.validate();
  14965. return a.zpp_inner.x
  14966. }(a) + function (a) {
  14967. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14968. a.zpp_inner.validate();
  14969. return a.zpp_inner.y
  14970. }(a) * function (a) {
  14971. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14972. a.zpp_inner.validate();
  14973. return a.zpp_inner.y
  14974. }(a))
  14975. }(this);
  14976. this.setxy(b * Math.cos(a), b * Math.sin(a));
  14977. return function (a) {
  14978. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14979. return function (a) {
  14980. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14981. a.zpp_inner.validate();
  14982. return a.zpp_inner.x
  14983. }(a) == function (a) {
  14984. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14985. a.zpp_inner.validate();
  14986. return a.zpp_inner.y
  14987. }(a) && 0 == function (a) {
  14988. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14989. a.zpp_inner.validate();
  14990. return a.zpp_inner.x
  14991. }(a) ? 0 : Math.atan2(function (a) {
  14992. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14993. a.zpp_inner.validate();
  14994. return a.zpp_inner.y
  14995. }(a), function (a) {
  14996. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  14997. a.zpp_inner.validate();
  14998. return a.zpp_inner.x
  14999. }(a))
  15000. }(this)
  15001. },
  15002. get_angle: function () {
  15003. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15004. var a;
  15005. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15006. this.zpp_inner.validate();
  15007. a = this.zpp_inner.x;
  15008. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15009. this.zpp_inner.validate();
  15010. if (a = a == this.zpp_inner.y) {
  15011. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15012. this.zpp_inner.validate();
  15013. a = 0 == this.zpp_inner.x
  15014. }
  15015. return a ? 0 : Math.atan2(function (a) {
  15016. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15017. a.zpp_inner.validate();
  15018. return a.zpp_inner.y
  15019. }(this), function (a) {
  15020. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15021. a.zpp_inner.validate();
  15022. return a.zpp_inner.x
  15023. }(this))
  15024. },
  15025. setxy: function (a, b) {
  15026. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15027. this.zpp_inner.immutable();
  15028. if (a != a || b != b) throw "Error: Vec2 components cannot be NaN";
  15029. var d;
  15030. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15031. this.zpp_inner.validate();
  15032. if (!(d = this.zpp_inner.x != a)) {
  15033. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15034. this.zpp_inner.validate();
  15035. d = this.zpp_inner.y != b
  15036. }
  15037. d && (this.zpp_inner.x =
  15038. a, this.zpp_inner.y = b, this.zpp_inner.invalidate());
  15039. return this
  15040. },
  15041. set: function (a) {
  15042. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15043. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15044. this.zpp_inner.immutable();
  15045. if (null == a) throw "Error: Cannot assign null Vec2";
  15046. var b = this.setxy(function (b) {
  15047. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15048. a.zpp_inner.validate();
  15049. return a.zpp_inner.x
  15050. }(this), function (b) {
  15051. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15052. a.zpp_inner.validate();
  15053. return a.zpp_inner.y
  15054. }(this));
  15055. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  15056. return b
  15057. },
  15058. lsq: function () {
  15059. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15060. var a;
  15061. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15062. this.zpp_inner.validate();
  15063. a = this.zpp_inner.x;
  15064. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15065. this.zpp_inner.validate();
  15066. a *= this.zpp_inner.x;
  15067. var b;
  15068. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15069. this.zpp_inner.validate();
  15070. b = this.zpp_inner.y;
  15071. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15072. this.zpp_inner.validate();
  15073. return a + b * this.zpp_inner.y
  15074. },
  15075. set_length: function (a) {
  15076. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15077. this.zpp_inner.immutable();
  15078. if (a != a) throw "Error: Vec2::length cannot be NaN";
  15079. var b;
  15080. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15081. this.zpp_inner.validate();
  15082. b = this.zpp_inner.x;
  15083. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15084. this.zpp_inner.validate();
  15085. b *= this.zpp_inner.x;
  15086. var d;
  15087. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15088. this.zpp_inner.validate();
  15089. d = this.zpp_inner.y;
  15090. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15091. this.zpp_inner.validate();
  15092. if (0 == b + d * this.zpp_inner.y) throw "Error: Cannot set length of a zero vector";
  15093. a /= Math.sqrt(function (a) {
  15094. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15095. a.zpp_inner.validate();
  15096. return a.zpp_inner.x
  15097. }(this) * function (a) {
  15098. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15099. a.zpp_inner.validate();
  15100. return a.zpp_inner.x
  15101. }(this) + function (a) {
  15102. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15103. a.zpp_inner.validate();
  15104. return a.zpp_inner.y
  15105. }(this) * function (a) {
  15106. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15107. a.zpp_inner.validate();
  15108. return a.zpp_inner.y
  15109. }(this));
  15110. var c = this;
  15111. c.set_x(function (a) {
  15112. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15113. c.zpp_inner.validate();
  15114. return c.zpp_inner.x
  15115. }(this) * a);
  15116. c = this;
  15117. c.set_y(function (a) {
  15118. if (null !=
  15119. c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15120. c.zpp_inner.validate();
  15121. return c.zpp_inner.y
  15122. }(this) * a);
  15123. this.zpp_inner.invalidate();
  15124. return function (a) {
  15125. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15126. return Math.sqrt(function (a) {
  15127. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15128. a.zpp_inner.validate();
  15129. return a.zpp_inner.x
  15130. }(a) * function (a) {
  15131. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15132. a.zpp_inner.validate();
  15133. return a.zpp_inner.x
  15134. }(a) +
  15135. function (a) {
  15136. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15137. a.zpp_inner.validate();
  15138. return a.zpp_inner.y
  15139. }(a) * function (a) {
  15140. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15141. a.zpp_inner.validate();
  15142. return a.zpp_inner.y
  15143. }(a))
  15144. }(this)
  15145. },
  15146. get_length: function () {
  15147. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15148. return Math.sqrt(function (a) {
  15149. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15150. a.zpp_inner.validate();
  15151. return a.zpp_inner.x
  15152. }(this) *
  15153. function (a) {
  15154. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15155. a.zpp_inner.validate();
  15156. return a.zpp_inner.x
  15157. }(this) + function (a) {
  15158. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15159. a.zpp_inner.validate();
  15160. return a.zpp_inner.y
  15161. }(this) * function (a) {
  15162. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15163. a.zpp_inner.validate();
  15164. return a.zpp_inner.y
  15165. }(this))
  15166. },
  15167. set_y: function (a) {
  15168. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15169. this.zpp_inner.immutable();
  15170. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15171. this.zpp_inner.validate();
  15172. if (this.zpp_inner.y != a) {
  15173. if (a != a) throw "Error: Vec2::y cannot be NaN";
  15174. this.zpp_inner.y = a;
  15175. this.zpp_inner.invalidate()
  15176. }
  15177. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15178. this.zpp_inner.validate();
  15179. return this.zpp_inner.y
  15180. },
  15181. get_y: function () {
  15182. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15183. this.zpp_inner.validate();
  15184. return this.zpp_inner.y
  15185. },
  15186. set_x: function (a) {
  15187. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15188. this.zpp_inner.immutable();
  15189. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15190. this.zpp_inner.validate();
  15191. if (this.zpp_inner.x != a) {
  15192. if (a != a) throw "Error: Vec2::x cannot be NaN";
  15193. this.zpp_inner.x = a;
  15194. this.zpp_inner.invalidate()
  15195. }
  15196. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15197. this.zpp_inner.validate();
  15198. return this.zpp_inner.x
  15199. },
  15200. get_x: function () {
  15201. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15202. this.zpp_inner.validate();
  15203. return this.zpp_inner.x
  15204. },
  15205. toPoint: function (a) {
  15206. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15207. null == a && (a = new k.geom.Point);
  15208. var b = a;
  15209. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15210. this.zpp_inner.validate();
  15211. b.x = this.zpp_inner.x;
  15212. b = a;
  15213. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15214. this.zpp_inner.validate();
  15215. b.y = this.zpp_inner.y;
  15216. return a
  15217. },
  15218. copy: function (a) {
  15219. null == a && (a = !1);
  15220. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15221. return h.geom.Vec2.get(function (a) {
  15222. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15223. a.zpp_inner.validate();
  15224. return a.zpp_inner.x
  15225. }(this), function (a) {
  15226. if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15227. a.zpp_inner.validate();
  15228. return a.zpp_inner.y
  15229. }(this), a)
  15230. },
  15231. dispose: function () {
  15232. if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15233. this.zpp_inner.immutable();
  15234. if (this.zpp_inner._inuse) throw "Error: This Vec2 is not disposable";
  15235. var a = this.zpp_inner;
  15236. this.zpp_inner = this.zpp_inner.outer = null;
  15237. var b = this;
  15238. b.zpp_pool = null;
  15239. null != c.util.ZPP_PubPool.nextVec2 ? c.util.ZPP_PubPool.nextVec2.zpp_pool =
  15240. b : c.util.ZPP_PubPool.poolVec2 = b;
  15241. c.util.ZPP_PubPool.nextVec2 = b;
  15242. b.zpp_disp = !0;
  15243. b = a;
  15244. null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
  15245. b._isimmutable = null;
  15246. b._validate = null;
  15247. b._invalidate = null;
  15248. b.next = c.geom.ZPP_Vec2.zpp_pool;
  15249. c.geom.ZPP_Vec2.zpp_pool = b
  15250. },
  15251. __class__: h.geom.Vec2
  15252. };
  15253. h.geom.Vec2Iterator = function () {
  15254. this.zpp_next = null;
  15255. this.zpp_critical = !1;
  15256. this.zpp_i = 0;
  15257. this.zpp_inner = null;
  15258. if (!c.util.ZPP_Vec2List.internal) throw "Error: Cannot instantiate Vec2Iterator derp!";
  15259. };
  15260. s["nape.geom.Vec2Iterator"] = h.geom.Vec2Iterator;
  15261. h.geom.Vec2Iterator.__name__ = ["nape", "geom", "Vec2Iterator"];
  15262. h.geom.Vec2Iterator.get = function (a) {
  15263. var b = null == h.geom.Vec2Iterator.zpp_pool ? function (a) {
  15264. c.util.ZPP_Vec2List.internal = !0;
  15265. a = new h.geom.Vec2Iterator;
  15266. c.util.ZPP_Vec2List.internal = !1;
  15267. return a
  15268. }(this) : function (a) {
  15269. a = h.geom.Vec2Iterator.zpp_pool;
  15270. h.geom.Vec2Iterator.zpp_pool = a.zpp_next;
  15271. return a
  15272. }(this);
  15273. b.zpp_i = 0;
  15274. b.zpp_inner = a;
  15275. b.zpp_critical = !1;
  15276. return b
  15277. };
  15278. h.geom.Vec2Iterator.prototype = {
  15279. next: function () {
  15280. this.zpp_critical = !1;
  15281. return this.zpp_inner.at(this.zpp_i++)
  15282. },
  15283. hasNext: function () {
  15284. this.zpp_inner.zpp_inner.valmod();
  15285. var a = this.zpp_inner.zpp_gl();
  15286. this.zpp_critical = !0;
  15287. if (this.zpp_i < a) return !0;
  15288. this.zpp_next = h.geom.Vec2Iterator.zpp_pool;
  15289. h.geom.Vec2Iterator.zpp_pool = this;
  15290. this.zpp_inner = null;
  15291. return !1
  15292. },
  15293. __class__: h.geom.Vec2Iterator
  15294. };
  15295. h.geom.Vec2List = function () {
  15296. this.zpp_inner = null;
  15297. this.zpp_inner = new c.util.ZPP_Vec2List;
  15298. this.zpp_inner.outer = this
  15299. };
  15300. s["nape.geom.Vec2List"] = h.geom.Vec2List;
  15301. h.geom.Vec2List.__name__ = ["nape", "geom", "Vec2List"];
  15302. h.geom.Vec2List.fromArray = function (a) {
  15303. if (null ==
  15304. a) throw "Error: Cannot convert null Array to Nape list";
  15305. for (var b = new h.geom.Vec2List, d = 0; d < a.length;) {
  15306. var c = a[d];
  15307. ++d;
  15308. b.push(c)
  15309. }
  15310. return b
  15311. };
  15312. h.geom.Vec2List.prototype = {
  15313. filter: function (a) {
  15314. if (null == a) throw "Error: Cannot select elements of list with null";
  15315. for (var b = 0; b < this.zpp_gl();) {
  15316. var d = this.at(b);
  15317. try {
  15318. a(d) ? b++ : this.remove(d)
  15319. } catch (c) {
  15320. break
  15321. }
  15322. }
  15323. return this
  15324. },
  15325. foreach: function (a) {
  15326. if (null == a) throw "Error: Cannot execute null on list elements";
  15327. for (var b = this.iterator(); b.hasNext();) try {
  15328. var d = a,
  15329. c = void 0;
  15330. b.zpp_critical = !1;
  15331. c = b.zpp_inner.at(b.zpp_i++);
  15332. d(c)
  15333. } catch (e) {
  15334. b.zpp_next = h.geom.Vec2Iterator.zpp_pool;
  15335. h.geom.Vec2Iterator.zpp_pool = b;
  15336. b.zpp_inner = null;
  15337. break
  15338. }
  15339. return this
  15340. },
  15341. toString: function () {
  15342. for (var a = "[", b = !0, d = this.iterator(); d.hasNext();) {
  15343. var c = d.next();
  15344. b || (a += ",");
  15345. a += null == c ? "NULL" : c.toString();
  15346. b = !1
  15347. }
  15348. return a + "]"
  15349. },
  15350. merge: function (a) {
  15351. if (null == a) throw "Error: Cannot merge with null list";
  15352. for (a = a.iterator(); a.hasNext();) {
  15353. var b = a.next();
  15354. this.has(b) || this.add(b)
  15355. }
  15356. },
  15357. copy: function (a) {
  15358. null == a && (a = !1);
  15359. for (var b = new h.geom.Vec2List,
  15360. d = this.iterator(); d.hasNext();) {
  15361. var c = d.next();
  15362. b.push(a ? function (a) {
  15363. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15364. return h.geom.Vec2.get(function (a) {
  15365. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15366. c.zpp_inner.validate();
  15367. return c.zpp_inner.x
  15368. }(a), function (a) {
  15369. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15370. c.zpp_inner.validate();
  15371. return c.zpp_inner.y
  15372. }(a), !1)
  15373. }(this) : c)
  15374. }
  15375. return b
  15376. },
  15377. iterator: function () {
  15378. this.zpp_vm();
  15379. return h.geom.Vec2Iterator.get(this)
  15380. },
  15381. empty: function () {
  15382. return 0 == this.zpp_gl()
  15383. },
  15384. clear: function () {
  15385. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  15386. if (this.zpp_inner.reverse_flag)
  15387. for (; !this.empty();) this.pop();
  15388. else
  15389. for (; !this.empty();) this.shift()
  15390. },
  15391. remove: function (a) {
  15392. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  15393. this.zpp_inner.modify_test();
  15394. this.zpp_vm();
  15395. var b;
  15396. b = !1;
  15397. for (var d = this.zpp_inner.inner.head; null != d;) {
  15398. if (d.elt == a.zpp_inner) {
  15399. b = !0;
  15400. break
  15401. }
  15402. d = d.next
  15403. }
  15404. b && (null != this.zpp_inner.subber &&
  15405. this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  15406. return b
  15407. },
  15408. add: function (a) {
  15409. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  15410. },
  15411. shift: function () {
  15412. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  15413. this.zpp_inner.modify_test();
  15414. if (this.empty()) throw "Error: Cannot remove from empty list";
  15415. this.zpp_vm();
  15416. var a = null;
  15417. if (this.zpp_inner.reverse_flag) {
  15418. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next &&
  15419. (this.zpp_inner.at_ite = null);
  15420. var b = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
  15421. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  15422. d = a.wrapper();
  15423. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  15424. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  15425. } else a = this.zpp_inner.inner.head.elt, d = a.wrapper(), null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  15426. this.zpp_inner.invalidate();
  15427. return d = a.wrapper()
  15428. },
  15429. pop: function () {
  15430. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  15431. this.zpp_inner.modify_test();
  15432. if (this.empty()) throw "Error: Cannot remove from empty list";
  15433. this.zpp_vm();
  15434. var a = null;
  15435. if (this.zpp_inner.reverse_flag) {
  15436. var a = this.zpp_inner.inner.head.elt,
  15437. b = a.wrapper();
  15438. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  15439. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  15440. } else {
  15441. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  15442. var d = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
  15443. a = null == d ? this.zpp_inner.inner.head.elt :
  15444. d.next.elt,
  15445. b = a.wrapper();
  15446. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  15447. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  15448. }
  15449. this.zpp_inner.invalidate();
  15450. return b = a.wrapper()
  15451. },
  15452. unshift: function (a) {
  15453. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  15454. this.zpp_inner.modify_test();
  15455. this.zpp_vm();
  15456. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  15457. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = this.empty() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() -
  15458. 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  15459. return b
  15460. },
  15461. push: function (a) {
  15462. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  15463. this.zpp_inner.modify_test();
  15464. this.zpp_vm();
  15465. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  15466. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite &&
  15467. (this.zpp_inner.push_ite = this.empty() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  15468. return b
  15469. },
  15470. at: function (a) {
  15471. this.zpp_vm();
  15472. if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
  15473. this.zpp_inner.reverse_flag && (a = this.zpp_gl() - 1 - a);
  15474. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index =
  15475. a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  15476. else
  15477. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  15478. return this.zpp_inner.at_ite.elt.wrapper()
  15479. },
  15480. has: function (a) {
  15481. this.zpp_vm();
  15482. return this.zpp_inner.inner.has(a.zpp_inner)
  15483. },
  15484. zpp_vm: function () {
  15485. this.zpp_inner.valmod()
  15486. },
  15487. zpp_gl: function () {
  15488. this.zpp_inner.valmod();
  15489. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  15490. return this.zpp_inner.user_length
  15491. },
  15492. get_length: function () {
  15493. return this.zpp_gl()
  15494. },
  15495. __class__: h.geom.Vec2List
  15496. };
  15497. h.geom.Vec3 = function (a, b, d) {
  15498. null == d && (d = 0);
  15499. null == b && (b = 0);
  15500. null == a && (a = 0);
  15501. this.zpp_inner = this.zpp_pool = null;
  15502. this.zpp_inner = new c.geom.ZPP_Vec3;
  15503. this.zpp_inner.outer = this;
  15504. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15505. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15506. this.zpp_inner.x = a;
  15507. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15508. this.zpp_inner.validate();
  15509. this.zpp_inner.x;
  15510. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15511. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15512. this.zpp_inner.y = b;
  15513. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15514. this.zpp_inner.validate();
  15515. this.zpp_inner.y;
  15516. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15517. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15518. this.zpp_inner.z = d;
  15519. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15520. this.zpp_inner.validate();
  15521. this.zpp_inner.z
  15522. };
  15523. s["nape.geom.Vec3"] = h.geom.Vec3;
  15524. h.geom.Vec3.__name__ = ["nape", "geom", "Vec3"];
  15525. h.geom.Vec3.get = function (a, b, d) {
  15526. null == d && (d = 0);
  15527. null == b && (b = 0);
  15528. null == a && (a = 0);
  15529. var g;
  15530. null == c.util.ZPP_PubPool.poolVec3 ? g = new h.geom.Vec3 : (g = c.util.ZPP_PubPool.poolVec3, c.util.ZPP_PubPool.poolVec3 = g.zpp_pool, g.zpp_pool = null, g.zpp_disp = !1, g == c.util.ZPP_PubPool.nextVec3 && (c.util.ZPP_PubPool.nextVec3 = null));
  15531. g.setxyz(a, b, d);
  15532. g.zpp_inner.immutable = !1;
  15533. g.zpp_inner._validate = null;
  15534. return g
  15535. };
  15536. h.geom.Vec3.prototype = {
  15537. toString: function () {
  15538. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15539. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15540. this.zpp_inner.validate();
  15541. var a = "{ x: " + this.zpp_inner.x + " y: ";
  15542. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15543. this.zpp_inner.validate();
  15544. a = a + this.zpp_inner.y + " z: ";
  15545. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15546. this.zpp_inner.validate();
  15547. return a + this.zpp_inner.z + " }"
  15548. },
  15549. xy: function (a) {
  15550. null == a && (a = !1);
  15551. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15552. return h.geom.Vec2.get(function (a) {
  15553. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15554. a.zpp_inner.validate();
  15555. return a.zpp_inner.x
  15556. }(this), function (a) {
  15557. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15558. a.zpp_inner.validate();
  15559. return a.zpp_inner.y
  15560. }(this), a)
  15561. },
  15562. setxyz: function (a, b, d) {
  15563. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15564. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15565. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15566. this.zpp_inner.x = a;
  15567. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15568. this.zpp_inner.validate();
  15569. this.zpp_inner.x;
  15570. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15571. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15572. this.zpp_inner.y = b;
  15573. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15574. this.zpp_inner.validate();
  15575. this.zpp_inner.y;
  15576. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15577. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15578. this.zpp_inner.z = d;
  15579. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15580. this.zpp_inner.validate();
  15581. this.zpp_inner.z;
  15582. return this
  15583. },
  15584. set: function (a) {
  15585. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15586. if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15587. if (null == a) throw "Error: Cannot assign null Vec3";
  15588. return this.setxyz(function (b) {
  15589. if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15590. a.zpp_inner.validate();
  15591. return a.zpp_inner.x
  15592. }(this), function (b) {
  15593. if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15594. a.zpp_inner.validate();
  15595. return a.zpp_inner.y
  15596. }(this), function (b) {
  15597. if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15598. a.zpp_inner.validate();
  15599. return a.zpp_inner.z
  15600. }(this))
  15601. },
  15602. lsq: function () {
  15603. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15604. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15605. this.zpp_inner.validate();
  15606. var a = this.zpp_inner.x;
  15607. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15608. this.zpp_inner.validate();
  15609. var a = a * this.zpp_inner.x,
  15610. b;
  15611. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15612. this.zpp_inner.validate();
  15613. b = this.zpp_inner.y;
  15614. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15615. this.zpp_inner.validate();
  15616. a += b * this.zpp_inner.y;
  15617. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15618. this.zpp_inner.validate();
  15619. b = this.zpp_inner.z;
  15620. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15621. this.zpp_inner.validate();
  15622. return a + b * this.zpp_inner.z
  15623. },
  15624. set_length: function (a) {
  15625. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15626. if (a != a) throw "Error: Vec3::length cannot be NaN";
  15627. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15628. this.zpp_inner.validate();
  15629. var b = this.zpp_inner.x;
  15630. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15631. this.zpp_inner.validate();
  15632. b *=
  15633. this.zpp_inner.x;
  15634. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15635. this.zpp_inner.validate();
  15636. var d = this.zpp_inner.y;
  15637. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15638. this.zpp_inner.validate();
  15639. b += d * this.zpp_inner.y;
  15640. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15641. this.zpp_inner.validate();
  15642. d = this.zpp_inner.z;
  15643. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15644. this.zpp_inner.validate();
  15645. if (0 == b + d * this.zpp_inner.z) throw "Error: Cannot set length of a zero vector";
  15646. a /= function (a) {
  15647. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15648. return Math.sqrt(function (a) {
  15649. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15650. a.zpp_inner.validate();
  15651. return a.zpp_inner.x
  15652. }(a) * function (a) {
  15653. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15654. a.zpp_inner.validate();
  15655. return a.zpp_inner.x
  15656. }(a) + function (a) {
  15657. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15658. a.zpp_inner.validate();
  15659. return a.zpp_inner.y
  15660. }(a) * function (a) {
  15661. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15662. a.zpp_inner.validate();
  15663. return a.zpp_inner.y
  15664. }(a) + function (a) {
  15665. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15666. a.zpp_inner.validate();
  15667. return a.zpp_inner.z
  15668. }(a) * function (a) {
  15669. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15670. a.zpp_inner.validate();
  15671. return a.zpp_inner.z
  15672. }(a))
  15673. }(this);
  15674. b = this;
  15675. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15676. if (b.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15677. d = b.zpp_inner;
  15678. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15679. b.zpp_inner.validate();
  15680. d.x = b.zpp_inner.x * a;
  15681. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15682. b.zpp_inner.validate();
  15683. b.zpp_inner.x;
  15684. b = this;
  15685. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15686. if (b.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15687. d = b.zpp_inner;
  15688. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15689. b.zpp_inner.validate();
  15690. d.y = b.zpp_inner.y * a;
  15691. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15692. b.zpp_inner.validate();
  15693. b.zpp_inner.y;
  15694. b = this;
  15695. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15696. if (b.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15697. d = b.zpp_inner;
  15698. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15699. b.zpp_inner.validate();
  15700. d.z = b.zpp_inner.z * a;
  15701. if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15702. b.zpp_inner.validate();
  15703. b.zpp_inner.z;
  15704. return function (a) {
  15705. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15706. return Math.sqrt(function (a) {
  15707. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15708. a.zpp_inner.validate();
  15709. return a.zpp_inner.x
  15710. }(a) * function (a) {
  15711. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15712. a.zpp_inner.validate();
  15713. return a.zpp_inner.x
  15714. }(a) + function (a) {
  15715. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15716. a.zpp_inner.validate();
  15717. return a.zpp_inner.y
  15718. }(a) * function (a) {
  15719. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15720. a.zpp_inner.validate();
  15721. return a.zpp_inner.y
  15722. }(a) + function (a) {
  15723. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15724. a.zpp_inner.validate();
  15725. return a.zpp_inner.z
  15726. }(a) * function (a) {
  15727. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15728. a.zpp_inner.validate();
  15729. return a.zpp_inner.z
  15730. }(a))
  15731. }(this)
  15732. },
  15733. get_length: function () {
  15734. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15735. return Math.sqrt(function (a) {
  15736. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15737. a.zpp_inner.validate();
  15738. return a.zpp_inner.x
  15739. }(this) * function (a) {
  15740. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15741. a.zpp_inner.validate();
  15742. return a.zpp_inner.x
  15743. }(this) + function (a) {
  15744. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15745. a.zpp_inner.validate();
  15746. return a.zpp_inner.y
  15747. }(this) * function (a) {
  15748. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15749. a.zpp_inner.validate();
  15750. return a.zpp_inner.y
  15751. }(this) + function (a) {
  15752. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15753. a.zpp_inner.validate();
  15754. return a.zpp_inner.z
  15755. }(this) * function (a) {
  15756. if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15757. a.zpp_inner.validate();
  15758. return a.zpp_inner.z
  15759. }(this))
  15760. },
  15761. dispose: function () {
  15762. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15763. if (this.zpp_inner.immutable) throw "Error: This Vec3 is not disposable";
  15764. this.zpp_pool = null;
  15765. null != c.util.ZPP_PubPool.nextVec3 ? c.util.ZPP_PubPool.nextVec3.zpp_pool = this : c.util.ZPP_PubPool.poolVec3 = this;
  15766. c.util.ZPP_PubPool.nextVec3 =
  15767. this;
  15768. this.zpp_disp = !0
  15769. },
  15770. set_z: function (a) {
  15771. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15772. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15773. this.zpp_inner.z = a;
  15774. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15775. this.zpp_inner.validate();
  15776. return this.zpp_inner.z
  15777. },
  15778. get_z: function () {
  15779. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15780. this.zpp_inner.validate();
  15781. return this.zpp_inner.z
  15782. },
  15783. set_y: function (a) {
  15784. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15785. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15786. this.zpp_inner.y = a;
  15787. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15788. this.zpp_inner.validate();
  15789. return this.zpp_inner.y
  15790. },
  15791. get_y: function () {
  15792. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15793. this.zpp_inner.validate();
  15794. return this.zpp_inner.y
  15795. },
  15796. set_x: function (a) {
  15797. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15798. if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  15799. this.zpp_inner.x =
  15800. a;
  15801. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15802. this.zpp_inner.validate();
  15803. return this.zpp_inner.x
  15804. },
  15805. get_x: function () {
  15806. if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15807. this.zpp_inner.validate();
  15808. return this.zpp_inner.x
  15809. },
  15810. __class__: h.geom.Vec3
  15811. };
  15812. h.geom.Winding = function () {
  15813. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate Winding derp!";
  15814. };
  15815. s["nape.geom.Winding"] = h.geom.Winding;
  15816. h.geom.Winding.__name__ = ["nape", "geom", "Winding"];
  15817. h.geom.Winding.get_UNDEFINED =
  15818. function () {
  15819. null == c.util.ZPP_Flags.Winding_UNDEFINED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_UNDEFINED = new h.geom.Winding, c.util.ZPP_Flags.internal = !1);
  15820. return c.util.ZPP_Flags.Winding_UNDEFINED
  15821. };
  15822. h.geom.Winding.get_CLOCKWISE = function () {
  15823. null == c.util.ZPP_Flags.Winding_CLOCKWISE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_CLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1);
  15824. return c.util.ZPP_Flags.Winding_CLOCKWISE
  15825. };
  15826. h.geom.Winding.get_ANTICLOCKWISE = function () {
  15827. null == c.util.ZPP_Flags.Winding_ANTICLOCKWISE &&
  15828. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_ANTICLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1);
  15829. return c.util.ZPP_Flags.Winding_ANTICLOCKWISE
  15830. };
  15831. h.geom.Winding.prototype = {
  15832. toString: function () {
  15833. null == c.util.ZPP_Flags.Winding_UNDEFINED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_UNDEFINED = new h.geom.Winding, c.util.ZPP_Flags.internal = !1);
  15834. var a;
  15835. this == c.util.ZPP_Flags.Winding_UNDEFINED ? a = "UNDEFINED" : (null == c.util.ZPP_Flags.Winding_CLOCKWISE && (c.util.ZPP_Flags.internal = !0,
  15836. c.util.ZPP_Flags.Winding_CLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.Winding_CLOCKWISE ? a = "CLOCKWISE" : (null == c.util.ZPP_Flags.Winding_ANTICLOCKWISE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Winding_ANTICLOCKWISE = new h.geom.Winding, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.Winding_ANTICLOCKWISE ? "ANTICLOCKWISE" : ""));
  15837. return a
  15838. },
  15839. __class__: h.geom.Winding
  15840. };
  15841. h.phys = {};
  15842. h.phys.Interactor = function () {
  15843. this.zpp_inner_i = null;
  15844. throw "Error: Cannot instantiate an Interactor, only Shape/Body/Compound";
  15845. };
  15846. s["nape.phys.Interactor"] = h.phys.Interactor;
  15847. h.phys.Interactor.__name__ = ["nape", "phys", "Interactor"];
  15848. h.phys.Interactor.prototype = {
  15849. toString: function () {
  15850. return ""
  15851. },
  15852. get_cbTypes: function () {
  15853. null == this.zpp_inner_i.wrap_cbTypes && this.zpp_inner_i.setupcbTypes();
  15854. return this.zpp_inner_i.wrap_cbTypes
  15855. },
  15856. set_group: function (a) {
  15857. this.zpp_inner_i.immutable_midstep("Interactor::group");
  15858. this.zpp_inner_i.setGroup(null == a ? null : a.zpp_inner);
  15859. return null == this.zpp_inner_i.group ? null : this.zpp_inner_i.group.outer
  15860. },
  15861. get_group: function () {
  15862. return null ==
  15863. this.zpp_inner_i.group ? null : this.zpp_inner_i.group.outer
  15864. },
  15865. get_castCompound: function () {
  15866. return null != this.zpp_inner_i.icompound ? this.zpp_inner_i.icompound.outer : null
  15867. },
  15868. get_castBody: function () {
  15869. return null != this.zpp_inner_i.ibody ? this.zpp_inner_i.ibody.outer : null
  15870. },
  15871. get_castShape: function () {
  15872. return null != this.zpp_inner_i.ishape ? this.zpp_inner_i.ishape.outer : null
  15873. },
  15874. isCompound: function () {
  15875. return null != this.zpp_inner_i.icompound
  15876. },
  15877. isBody: function () {
  15878. return null != this.zpp_inner_i.ibody
  15879. },
  15880. isShape: function () {
  15881. return null !=
  15882. this.zpp_inner_i.ishape
  15883. },
  15884. get_userData: function () {
  15885. null == this.zpp_inner_i.userData && (this.zpp_inner_i.userData = {});
  15886. return this.zpp_inner_i.userData
  15887. },
  15888. get_id: function () {
  15889. return this.zpp_inner_i.id
  15890. },
  15891. __class__: h.phys.Interactor
  15892. };
  15893. h.phys.Body = function (a, b) {
  15894. this.debugDraw = !0;
  15895. this.zpp_inner = null;
  15896. try {
  15897. h.phys.Interactor.call(this)
  15898. } catch (d) {}
  15899. this.zpp_inner = new c.phys.ZPP_Body;
  15900. this.zpp_inner.outer = this;
  15901. this.zpp_inner.outer_i = this;
  15902. this.zpp_inner_i = this.zpp_inner;
  15903. if (null != b) {
  15904. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15905. var g = this.zpp_inner;
  15906. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15907. b.zpp_inner.validate();
  15908. g.posx = b.zpp_inner.x;
  15909. g = this.zpp_inner;
  15910. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15911. b.zpp_inner.validate();
  15912. g.posy = b.zpp_inner.y
  15913. } else this.zpp_inner.posx = 0, this.zpp_inner.posy = 0;
  15914. this.set_type(null == a ? function (a) {
  15915. null == c.util.ZPP_Flags.BodyType_DYNAMIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_DYNAMIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  15916. return c.util.ZPP_Flags.BodyType_DYNAMIC
  15917. }(this) : a);
  15918. null != b && (b.zpp_inner.weak ? (b.dispose(), !0) : !1);
  15919. this.zpp_inner_i.insert_cbtype(c.callbacks.ZPP_CbType.ANY_BODY.zpp_inner)
  15920. };
  15921. s["nape.phys.Body"] = h.phys.Body;
  15922. h.phys.Body.__name__ = ["nape", "phys", "Body"];
  15923. h.phys.Body.__super__ = h.phys.Interactor;
  15924. h.phys.Body.prototype = I(h.phys.Interactor.prototype, {
  15925. toString: function () {
  15926. return (this.zpp_inner.world ? "(space::world" : "(" + (this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC ? "dynamic" : this.zpp_inner.type ==
  15927. c.util.ZPP_Flags.id_BodyType_STATIC ? "static" : "kinematic")) + ")#" + this.zpp_inner_i.id
  15928. },
  15929. contains: function (a) {
  15930. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  15931. if (null == a) throw "Error: Cannot check containment of null point";
  15932. var b = a.zpp_inner.weak;
  15933. a.zpp_inner.weak = !1;
  15934. var d;
  15935. d = !1;
  15936. for (var c = this.zpp_inner.shapes.head; null != c;) {
  15937. if (c.elt.outer.contains(a)) {
  15938. d = !0;
  15939. break
  15940. }
  15941. c = c.next
  15942. }
  15943. a.zpp_inner.weak = b;
  15944. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  15945. return d
  15946. },
  15947. totalImpulse: function (a, b) {
  15948. null == b &&
  15949. (b = !1);
  15950. var d = 0,
  15951. g = 0,
  15952. e = 0;
  15953. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  15954. for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
  15955. var l = f.next().zpp_inner;
  15956. if (l.type != c.dynamics.ZPP_Arbiter.SENSOR && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
  15957. var l = l.wrapper().totalImpulse(this, b),
  15958. m = 1,
  15959. u = m;
  15960. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15961. l.zpp_inner.validate();
  15962. d += l.zpp_inner.x * u;
  15963. if (null !=
  15964. l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15965. l.zpp_inner.validate();
  15966. g += l.zpp_inner.y * u;
  15967. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15968. l.zpp_inner.validate();
  15969. e += l.zpp_inner.z * m;
  15970. l.dispose()
  15971. }
  15972. }
  15973. for (f = this.zpp_inner.constraints.head; null != f;) {
  15974. l = f.elt;
  15975. if (l.active) {
  15976. l = l.outer.bodyImpulse(this);
  15977. u = m = 1;
  15978. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15979. l.zpp_inner.validate();
  15980. d += l.zpp_inner.x * u;
  15981. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15982. l.zpp_inner.validate();
  15983. g += l.zpp_inner.y * u;
  15984. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15985. l.zpp_inner.validate();
  15986. e += l.zpp_inner.z * m;
  15987. l.dispose()
  15988. }
  15989. f = f.next
  15990. }
  15991. return h.geom.Vec3.get(d, g, e)
  15992. },
  15993. constraintsImpulse: function () {
  15994. for (var a = 0, b = 0, d = 0, c = this.zpp_inner.constraints.head; null != c;) {
  15995. var e = c.elt.outer.bodyImpulse(this);
  15996. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  15997. e.zpp_inner.validate();
  15998. a += 1 * e.zpp_inner.x;
  15999. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16000. e.zpp_inner.validate();
  16001. b += 1 * e.zpp_inner.y;
  16002. if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16003. e.zpp_inner.validate();
  16004. d += 1 * e.zpp_inner.z;
  16005. e.dispose();
  16006. c = c.next
  16007. }
  16008. return h.geom.Vec3.get(a, b, d)
  16009. },
  16010. totalFluidImpulse: function (a) {
  16011. var b = 0,
  16012. d = 0,
  16013. g = 0;
  16014. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16015. for (var e = this.zpp_inner.wrap_arbiters.iterator(); e.hasNext();) {
  16016. var f = e.next().zpp_inner;
  16017. if (f.type == c.dynamics.ZPP_Arbiter.FLUID &&
  16018. (null == a || f.b2 == a.zpp_inner || f.b1 == a.zpp_inner)) {
  16019. f = f.wrapper().get_fluidArbiter().totalImpulse(this);
  16020. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16021. f.zpp_inner.validate();
  16022. b += 1 * f.zpp_inner.x;
  16023. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16024. f.zpp_inner.validate();
  16025. d += 1 * f.zpp_inner.y;
  16026. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16027. f.zpp_inner.validate();
  16028. g += 1 * f.zpp_inner.z;
  16029. f.dispose()
  16030. }
  16031. }
  16032. return h.geom.Vec3.get(b,
  16033. d, g)
  16034. },
  16035. dragImpulse: function (a) {
  16036. var b = 0,
  16037. d = 0,
  16038. g = 0;
  16039. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16040. for (var e = this.zpp_inner.wrap_arbiters.iterator(); e.hasNext();) {
  16041. var f = e.next().zpp_inner;
  16042. if (f.type == c.dynamics.ZPP_Arbiter.FLUID && (null == a || f.b2 == a.zpp_inner || f.b1 == a.zpp_inner)) {
  16043. f = f.wrapper().get_fluidArbiter().dragImpulse(this);
  16044. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16045. f.zpp_inner.validate();
  16046. b += 1 * f.zpp_inner.x;
  16047. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16048. f.zpp_inner.validate();
  16049. d += 1 * f.zpp_inner.y;
  16050. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16051. f.zpp_inner.validate();
  16052. g += 1 * f.zpp_inner.z;
  16053. f.dispose()
  16054. }
  16055. }
  16056. return h.geom.Vec3.get(b, d, g)
  16057. },
  16058. buoyancyImpulse: function (a) {
  16059. var b = 0,
  16060. d = 0,
  16061. g = 0;
  16062. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16063. for (var e = this.zpp_inner.wrap_arbiters.iterator(); e.hasNext();) {
  16064. var f =
  16065. e.next().zpp_inner;
  16066. if (f.type == c.dynamics.ZPP_Arbiter.FLUID && (null == a || f.b2 == a.zpp_inner || f.b1 == a.zpp_inner)) {
  16067. f = f.wrapper().get_fluidArbiter().buoyancyImpulse(this);
  16068. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16069. f.zpp_inner.validate();
  16070. b += 1 * f.zpp_inner.x;
  16071. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16072. f.zpp_inner.validate();
  16073. d += 1 * f.zpp_inner.y;
  16074. if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16075. f.zpp_inner.validate();
  16076. g += 1 * f.zpp_inner.z;
  16077. f.dispose()
  16078. }
  16079. }
  16080. return h.geom.Vec3.get(b, d, g)
  16081. },
  16082. rollingImpulse: function (a, b) {
  16083. null == b && (b = !1);
  16084. var d = 0;
  16085. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16086. for (var g = this.zpp_inner.wrap_arbiters.iterator(); g.hasNext();) {
  16087. var e = g.next().zpp_inner;
  16088. e.type != c.dynamics.ZPP_Arbiter.COL || null != a && e.b2 != a.zpp_inner && e.b1 != a.zpp_inner || (d += e.wrapper().get_collisionArbiter().rollingImpulse(this, b))
  16089. }
  16090. return d
  16091. },
  16092. totalContactsImpulse: function (a,
  16093. b) {
  16094. null == b && (b = !1);
  16095. var d = 0,
  16096. g = 0,
  16097. e = 0;
  16098. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16099. for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
  16100. var l = f.next().zpp_inner;
  16101. if (l.type == c.dynamics.ZPP_Arbiter.COL && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
  16102. l = l.wrapper().get_collisionArbiter().totalImpulse(this, b);
  16103. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16104. l.zpp_inner.validate();
  16105. d += 1 * l.zpp_inner.x;
  16106. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16107. l.zpp_inner.validate();
  16108. g += 1 * l.zpp_inner.y;
  16109. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16110. l.zpp_inner.validate();
  16111. e += 1 * l.zpp_inner.z;
  16112. l.dispose()
  16113. }
  16114. }
  16115. return h.geom.Vec3.get(d, g, e)
  16116. },
  16117. tangentImpulse: function (a, b) {
  16118. null == b && (b = !1);
  16119. var d = 0,
  16120. g = 0,
  16121. e = 0;
  16122. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16123. for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
  16124. var l =
  16125. f.next().zpp_inner;
  16126. if (l.type == c.dynamics.ZPP_Arbiter.COL && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
  16127. l = l.wrapper().get_collisionArbiter().tangentImpulse(this, b);
  16128. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16129. l.zpp_inner.validate();
  16130. d += 1 * l.zpp_inner.x;
  16131. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16132. l.zpp_inner.validate();
  16133. g += 1 * l.zpp_inner.y;
  16134. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16135. l.zpp_inner.validate();
  16136. e += 1 * l.zpp_inner.z;
  16137. l.dispose()
  16138. }
  16139. }
  16140. return h.geom.Vec3.get(d, g, e)
  16141. },
  16142. normalImpulse: function (a, b) {
  16143. null == b && (b = !1);
  16144. var d = 0,
  16145. g = 0,
  16146. e = 0;
  16147. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16148. for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
  16149. var l = f.next().zpp_inner;
  16150. if (l.type == c.dynamics.ZPP_Arbiter.COL && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
  16151. l = l.wrapper().get_collisionArbiter().normalImpulse(this, b);
  16152. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16153. l.zpp_inner.validate();
  16154. d += 1 * l.zpp_inner.x;
  16155. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16156. l.zpp_inner.validate();
  16157. g += 1 * l.zpp_inner.y;
  16158. if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  16159. l.zpp_inner.validate();
  16160. e += 1 * l.zpp_inner.z;
  16161. l.dispose()
  16162. }
  16163. }
  16164. return h.geom.Vec3.get(d, g, e)
  16165. },
  16166. get_worldCOM: function () {
  16167. if (this.zpp_inner.world) throw "Error: Space::world has no worldCOM";
  16168. null == this.zpp_inner.wrap_worldCOM && (this.zpp_inner.wrap_worldCOM = h.geom.Vec2.get(this.zpp_inner.worldCOMx,
  16169. this.zpp_inner.worldCOMy, null), this.zpp_inner.wrap_worldCOM.zpp_inner._inuse = !0, this.zpp_inner.wrap_worldCOM.zpp_inner._immutable = !0, this.zpp_inner.wrap_worldCOM.zpp_inner._validate = (da = this.zpp_inner, A(da, da.getworldCOM)));
  16170. return this.zpp_inner.wrap_worldCOM
  16171. },
  16172. get_localCOM: function () {
  16173. if (this.zpp_inner.world) throw "Error: Space::world has no localCOM";
  16174. null == this.zpp_inner.wrap_localCOM && (this.zpp_inner.wrap_localCOM = h.geom.Vec2.get(this.zpp_inner.localCOMx, this.zpp_inner.localCOMy, null), this.zpp_inner.wrap_localCOM.zpp_inner._inuse = !0, this.zpp_inner.wrap_localCOM.zpp_inner._immutable = !0, this.zpp_inner.wrap_localCOM.zpp_inner._validate = (da = this.zpp_inner, A(da, da.getlocalCOM)));
  16175. return this.zpp_inner.wrap_localCOM
  16176. },
  16177. setShapeFluidProperties: function (a) {
  16178. this.zpp_inner.immutable_midstep("Body::setShapeFluidProperties()");
  16179. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16180. for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.set_fluidProperties(a), b = b.next;
  16181. return this
  16182. },
  16183. setShapeFilters: function (a) {
  16184. this.zpp_inner.immutable_midstep("Body::setShapeFilters()");
  16185. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16186. for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.set_filter(a), b = b.next;
  16187. return this
  16188. },
  16189. setShapeMaterials: function (a) {
  16190. this.zpp_inner.immutable_midstep("Body::setShapeMaterials()");
  16191. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16192. for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.set_material(a), b = b.next;
  16193. return this
  16194. },
  16195. rotate: function (a, b) {
  16196. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16197. if (null == a) throw "Error: Cannot rotate about a null Vec2";
  16198. if (b != b) throw "Error: Cannot rotate by NaN radians";
  16199. var d = a.zpp_inner.weak;
  16200. a.zpp_inner.weak = !1;
  16201. null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
  16202. var c = this.zpp_inner.wrap_pos.sub(a);
  16203. c.rotate(b);
  16204. this.set_position(a.add(c, !0));
  16205. c.dispose();
  16206. this.set_rotation(this.zpp_inner.rot + b);
  16207. a.zpp_inner.weak = d;
  16208. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16209. return this
  16210. },
  16211. align: function () {
  16212. this.zpp_inner.immutable_midstep("Body::align()");
  16213. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16214. if (null == this.zpp_inner.shapes.head) throw "Error: Cannot align empty Body";
  16215. this.zpp_inner.validate_localCOM();
  16216. var a = h.geom.Vec2.get(-this.zpp_inner.localCOMx, -this.zpp_inner.localCOMy, null);
  16217. this.translateShapes(a);
  16218. var b = this.localVectorToWorld(a);
  16219. null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
  16220. this.zpp_inner.wrap_pos.subeq(b);
  16221. if (this.zpp_inner.pre_posx < Math.POSITIVE_INFINITY) {
  16222. var d = this.zpp_inner,
  16223. c = this.zpp_inner.pre_posx;
  16224. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16225. b.zpp_inner.validate();
  16226. d.pre_posx = c - 1 * b.zpp_inner.x;
  16227. d = this.zpp_inner;
  16228. c = this.zpp_inner.pre_posy;
  16229. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16230. b.zpp_inner.validate();
  16231. d.pre_posy = c - 1 * b.zpp_inner.y
  16232. }
  16233. a.dispose();
  16234. b.dispose();
  16235. return this
  16236. },
  16237. transformShapes: function (a) {
  16238. this.zpp_inner.immutable_midstep("Body::transformShapes()");
  16239. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16240. for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.transform(a), b = b.next;
  16241. return this
  16242. },
  16243. scaleShapes: function (a, b) {
  16244. this.zpp_inner.immutable_midstep("Body::scaleShapes()");
  16245. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16246. for (var d = this.zpp_inner.shapes.head; null != d;) d.elt.outer.scale(a, b), d = d.next;
  16247. return this
  16248. },
  16249. rotateShapes: function (a) {
  16250. this.zpp_inner.immutable_midstep("Body::rotateShapes()");
  16251. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16252. for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.rotate(a), b = b.next;
  16253. return this
  16254. },
  16255. translateShapes: function (a) {
  16256. this.zpp_inner.immutable_midstep("Body::translateShapes()");
  16257. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16258. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16259. if (null == a) throw "Error: Cannot displace by null Vec2";
  16260. var b = a.zpp_inner.weak;
  16261. a.zpp_inner.weak = !1;
  16262. for (var d = this.zpp_inner.shapes.head; null != d;) d.elt.outer.translate(a), d = d.next;
  16263. a.zpp_inner.weak = b;
  16264. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16265. return this
  16266. },
  16267. applyAngularImpulse: function (a, b) {
  16268. null == b && (b = !1);
  16269. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16270. var d;
  16271. if (d = b) {
  16272. if (null == this.zpp_inner.space) throw "Error: isSleeping makes no sense if the object is not contained within a Space";
  16273. d = this.zpp_inner.component.sleeping
  16274. }
  16275. if (d) return this;
  16276. this.zpp_inner.validate_inertia();
  16277. this.zpp_inner.angvel += a * this.zpp_inner.iinertia;
  16278. b || this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.zpp_inner.wake();
  16279. return this
  16280. },
  16281. applyImpulse: function (a, b, d) {
  16282. null == d && (d = !1);
  16283. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16284. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16285. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16286. if (null == a) throw "Error: Cannot apply null impulse to Body";
  16287. var g;
  16288. if (g = d) {
  16289. if (null == this.zpp_inner.space) throw "Error: isSleeping makes no sense if the object is not contained within a Space";
  16290. g = this.zpp_inner.component.sleeping
  16291. }
  16292. if (g) return a.zpp_inner.weak ? (a.dispose(), !0) : !1, this;
  16293. this.zpp_inner.validate_mass();
  16294. g = this.zpp_inner.imass;
  16295. var e = this.zpp_inner,
  16296. f = this.zpp_inner.velx;
  16297. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16298. a.zpp_inner.validate();
  16299. e.velx = f + a.zpp_inner.x * g;
  16300. e = this.zpp_inner;
  16301. f = this.zpp_inner.vely;
  16302. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16303. a.zpp_inner.validate();
  16304. e.vely = f + a.zpp_inner.y * g;
  16305. if (null != b) {
  16306. var l = 0;
  16307. g = 0;
  16308. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16309. b.zpp_inner.validate();
  16310. l = b.zpp_inner.x - this.zpp_inner.posx;
  16311. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16312. b.zpp_inner.validate();
  16313. g = b.zpp_inner.y - this.zpp_inner.posy;
  16314. this.zpp_inner.validate_inertia();
  16315. e = this.zpp_inner;
  16316. f = this.zpp_inner.angvel;
  16317. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16318. a.zpp_inner.validate();
  16319. l *= a.zpp_inner.y;
  16320. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16321. a.zpp_inner.validate();
  16322. e.angvel = f + (l - a.zpp_inner.x * g) * this.zpp_inner.iinertia;
  16323. b.zpp_inner.weak ? (b.dispose(), !0) : !1
  16324. }
  16325. d || this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.zpp_inner.wake();
  16326. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16327. return this
  16328. },
  16329. worldVectorToLocal: function (a, b) {
  16330. null == b && (b = !1);
  16331. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16332. if (null == a) throw "Error: Cannot transform null Vec2";
  16333. this.zpp_inner.validate_axis();
  16334. var d = 0,
  16335. c = 0;
  16336. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16337. a.zpp_inner.validate();
  16338. d = a.zpp_inner.x * this.zpp_inner.axisy;
  16339. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16340. a.zpp_inner.validate();
  16341. d += a.zpp_inner.y *
  16342. this.zpp_inner.axisx;
  16343. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16344. a.zpp_inner.validate();
  16345. c = a.zpp_inner.y * this.zpp_inner.axisy;
  16346. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16347. a.zpp_inner.validate();
  16348. c -= a.zpp_inner.x * this.zpp_inner.axisx;
  16349. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16350. return h.geom.Vec2.get(d, c, b)
  16351. },
  16352. localVectorToWorld: function (a, b) {
  16353. null == b && (b = !1);
  16354. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16355. if (null ==
  16356. a) throw "Error: Cannot transform null Vec2";
  16357. this.zpp_inner.validate_axis();
  16358. var d = 0,
  16359. c = 0,
  16360. d = this.zpp_inner.axisy;
  16361. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16362. a.zpp_inner.validate();
  16363. d *= a.zpp_inner.x;
  16364. c = this.zpp_inner.axisx;
  16365. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16366. a.zpp_inner.validate();
  16367. d -= c * a.zpp_inner.y;
  16368. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16369. a.zpp_inner.validate();
  16370. c = a.zpp_inner.x * this.zpp_inner.axisx;
  16371. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16372. a.zpp_inner.validate();
  16373. c += a.zpp_inner.y * this.zpp_inner.axisy;
  16374. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16375. return h.geom.Vec2.get(d, c, b)
  16376. },
  16377. worldPointToLocal: function (a, b) {
  16378. null == b && (b = !1);
  16379. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16380. if (null == a) throw "Error: Cannot transform null Vec2";
  16381. this.zpp_inner.validate_axis();
  16382. var d = 0,
  16383. c = 0,
  16384. e = c = 0;
  16385. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16386. a.zpp_inner.validate();
  16387. c = a.zpp_inner.x - this.zpp_inner.posx;
  16388. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16389. a.zpp_inner.validate();
  16390. e = a.zpp_inner.y - this.zpp_inner.posy;
  16391. d = c * this.zpp_inner.axisy + e * this.zpp_inner.axisx;
  16392. c = e * this.zpp_inner.axisy - c * this.zpp_inner.axisx;
  16393. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16394. return h.geom.Vec2.get(d, c, b)
  16395. },
  16396. localPointToWorld: function (a, b) {
  16397. null == b && (b = !1);
  16398. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16399. if (null == a) throw "Error: Cannot transform null Vec2";
  16400. this.zpp_inner.validate_axis();
  16401. var d = 0,
  16402. c = 0,
  16403. d = this.zpp_inner.axisy;
  16404. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16405. a.zpp_inner.validate();
  16406. d *= a.zpp_inner.x;
  16407. c = this.zpp_inner.axisx;
  16408. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16409. a.zpp_inner.validate();
  16410. d -= c * a.zpp_inner.y;
  16411. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16412. a.zpp_inner.validate();
  16413. c = a.zpp_inner.x * this.zpp_inner.axisx;
  16414. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16415. a.zpp_inner.validate();
  16416. c += a.zpp_inner.y * this.zpp_inner.axisy;
  16417. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16418. return h.geom.Vec2.get(d + this.zpp_inner.posx, c + this.zpp_inner.posy, b)
  16419. },
  16420. crushFactor: function () {
  16421. if (null == (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer)) throw "Error: Makes no sense to see how much an object not taking part in a simulation is being crushed";
  16422. var a = 0,
  16423. b = h.geom.Vec2.get(null, null, null);
  16424. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16425. for (var d = this.zpp_inner.wrap_arbiters.iterator(); d.hasNext();) {
  16426. var g = d.next().totalImpulse(this),
  16427. e = g.xy();
  16428. b.addeq(e);
  16429. a += function (a) {
  16430. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16431. return Math.sqrt(function (a) {
  16432. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16433. e.zpp_inner.validate();
  16434. return e.zpp_inner.x
  16435. }(a) * function (a) {
  16436. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16437. e.zpp_inner.validate();
  16438. return e.zpp_inner.x
  16439. }(a) +
  16440. function (a) {
  16441. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16442. e.zpp_inner.validate();
  16443. return e.zpp_inner.y
  16444. }(a) * function (a) {
  16445. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16446. e.zpp_inner.validate();
  16447. return e.zpp_inner.y
  16448. }(a))
  16449. }(this);
  16450. e.dispose();
  16451. g.dispose()
  16452. }
  16453. null == this.zpp_inner.wrap_constraints && (this.zpp_inner.wrap_constraints = c.util.ZPP_ConstraintList.get(this.zpp_inner.constraints, !0));
  16454. for (d = this.zpp_inner.wrap_constraints.iterator(); d.hasNext();) g =
  16455. d.next().bodyImpulse(this), e = g.xy(), b.addeq(e), a += function (a) {
  16456. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16457. return Math.sqrt(function (a) {
  16458. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16459. e.zpp_inner.validate();
  16460. return e.zpp_inner.x
  16461. }(a) * function (a) {
  16462. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16463. e.zpp_inner.validate();
  16464. return e.zpp_inner.x
  16465. }(a) + function (a) {
  16466. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16467. e.zpp_inner.validate();
  16468. return e.zpp_inner.y
  16469. }(a) * function (a) {
  16470. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16471. e.zpp_inner.validate();
  16472. return e.zpp_inner.y
  16473. }(a))
  16474. }(this), e.dispose(), g.dispose();
  16475. a -= function (a) {
  16476. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16477. return Math.sqrt(function (a) {
  16478. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16479. b.zpp_inner.validate();
  16480. return b.zpp_inner.x
  16481. }(a) * function (a) {
  16482. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16483. b.zpp_inner.validate();
  16484. return b.zpp_inner.x
  16485. }(a) + function (a) {
  16486. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16487. b.zpp_inner.validate();
  16488. return b.zpp_inner.y
  16489. }(a) * function (a) {
  16490. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16491. b.zpp_inner.validate();
  16492. return b.zpp_inner.y
  16493. }(a))
  16494. }(this);
  16495. if (this.zpp_inner.world) throw "Error: Space::world has no mass";
  16496. this.zpp_inner.validate_mass();
  16497. if (this.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && null ==
  16498. this.zpp_inner.shapes.head) throw "Error: Given current mass mode, Body::mass only makes sense if it contains shapes";
  16499. a /= this.zpp_inner.cmass * (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer).zpp_inner.pre_dt;
  16500. b.dispose();
  16501. return a
  16502. },
  16503. interactingBodies: function (a, b, d) {
  16504. null == b && (b = -1);
  16505. null == a ? a = c.dynamics.ZPP_Arbiter.COL | c.dynamics.ZPP_Arbiter.SENSOR | c.dynamics.ZPP_Arbiter.FLUID : (null == c.util.ZPP_Flags.InteractionType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION =
  16506. new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a == c.util.ZPP_Flags.InteractionType_COLLISION ? a = c.dynamics.ZPP_Arbiter.COL : (null == c.util.ZPP_Flags.InteractionType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1), a = a == c.util.ZPP_Flags.InteractionType_SENSOR ? c.dynamics.ZPP_Arbiter.SENSOR : c.dynamics.ZPP_Arbiter.FLUID));
  16507. return this.zpp_inner.interactingBodies(a, b, d)
  16508. },
  16509. connectedBodies: function (a, b) {
  16510. null ==
  16511. a && (a = -1);
  16512. return this.zpp_inner.connectedBodies(a, b)
  16513. },
  16514. set_inertia: function (a) {
  16515. this.zpp_inner.immutable_midstep("Body::inertia");
  16516. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16517. if (a != a) throw "Error: Inertia cannot be NaN";
  16518. if (0 >= a) throw "Error: Inertia must be strictly positive";
  16519. if (a >= Math.POSITIVE_INFINITY) throw "Error: Inertia cannot be infinite, use allowRotation = false instead";
  16520. this.zpp_inner.inertiaMode = c.util.ZPP_Flags.id_InertiaMode_FIXED;
  16521. this.zpp_inner.cinertia = a;
  16522. this.zpp_inner.invalidate_inertia();
  16523. if (this.zpp_inner.world) throw "Error: Space::world has no inertia";
  16524. this.zpp_inner.validate_inertia();
  16525. if (this.zpp_inner.inertiaMode == c.util.ZPP_Flags.id_InertiaMode_DEFAULT && this.zpp_inner.wrap_shapes.empty()) throw "Error: Given current inertia mode flag, Body::inertia only makes sense if Body contains Shapes";
  16526. return this.zpp_inner.cinertia
  16527. },
  16528. get_inertia: function () {
  16529. if (this.zpp_inner.world) throw "Error: Space::world has no inertia";
  16530. this.zpp_inner.validate_inertia();
  16531. if (this.zpp_inner.inertiaMode == c.util.ZPP_Flags.id_InertiaMode_DEFAULT &&
  16532. this.zpp_inner.wrap_shapes.empty()) throw "Error: Given current inertia mode flag, Body::inertia only makes sense if Body contains Shapes";
  16533. return this.zpp_inner.cinertia
  16534. },
  16535. get_constraintInertia: function () {
  16536. this.zpp_inner.world || this.zpp_inner.validate_inertia();
  16537. return this.zpp_inner.sinertia
  16538. },
  16539. set_inertiaMode: function (a) {
  16540. this.zpp_inner.immutable_midstep("Body::inertiaMode");
  16541. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16542. if (null == a) throw "Error: Cannot use null InertiaMode";
  16543. var b = this.zpp_inner;
  16544. null == c.util.ZPP_Flags.InertiaMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_FIXED = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  16545. b.inertiaMode = a == c.util.ZPP_Flags.InertiaMode_FIXED ? c.util.ZPP_Flags.id_InertiaMode_FIXED : c.util.ZPP_Flags.id_InertiaMode_DEFAULT;
  16546. this.zpp_inner.invalidate_inertia();
  16547. null == c.util.ZPP_Flags.InertiaMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_DEFAULT = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  16548. a = c.util.ZPP_Flags.InertiaMode_DEFAULT;
  16549. null == c.util.ZPP_Flags.InertiaMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_FIXED = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  16550. return [a, c.util.ZPP_Flags.InertiaMode_FIXED][this.zpp_inner.inertiaMode]
  16551. },
  16552. get_inertiaMode: function () {
  16553. null == c.util.ZPP_Flags.InertiaMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_DEFAULT = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  16554. var a = c.util.ZPP_Flags.InertiaMode_DEFAULT;
  16555. null == c.util.ZPP_Flags.InertiaMode_FIXED &&
  16556. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_FIXED = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  16557. return [a, c.util.ZPP_Flags.InertiaMode_FIXED][this.zpp_inner.inertiaMode]
  16558. },
  16559. set_gravMassScale: function (a) {
  16560. this.zpp_inner.immutable_midstep("Body::gravMassScale");
  16561. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16562. if (a != a) throw "Error: gravMassScale cannot be NaN";
  16563. this.zpp_inner.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_SCALED;
  16564. this.zpp_inner.gravMassScale = a;
  16565. this.zpp_inner.invalidate_gravMassScale();
  16566. this.zpp_inner.validate_gravMassScale();
  16567. if (null == this.zpp_inner.shapes.head && this.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && this.zpp_inner.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_SCALED) throw "Error: Given current mass/gravMass modes; Body::gravMassScale only makes sense if it contains Shapes";
  16568. return this.zpp_inner.gravMassScale
  16569. },
  16570. get_gravMassScale: function () {
  16571. this.zpp_inner.validate_gravMassScale();
  16572. if (null == this.zpp_inner.shapes.head && this.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT &&
  16573. this.zpp_inner.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_SCALED) throw "Error: Given current mass/gravMass modes; Body::gravMassScale only makes sense if it contains Shapes";
  16574. return this.zpp_inner.gravMassScale
  16575. },
  16576. set_gravMass: function (a) {
  16577. this.zpp_inner.immutable_midstep("Body::gravMass");
  16578. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16579. if (a != a) throw "Error: gravMass cannot be NaN";
  16580. this.zpp_inner.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_FIXED;
  16581. this.zpp_inner.gravMass = a;
  16582. this.zpp_inner.invalidate_gravMass();
  16583. if (this.zpp_inner.world) throw "Error: Space::world has no gravMass";
  16584. this.zpp_inner.validate_gravMass();
  16585. if (null == this.zpp_inner.shapes.head && this.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && this.zpp_inner.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_FIXED) throw "Error: Given current mass/gravMass modes; Body::gravMass only makes sense if it contains Shapes";
  16586. return this.zpp_inner.gravMass
  16587. },
  16588. get_gravMass: function () {
  16589. if (this.zpp_inner.world) throw "Error: Space::world has no gravMass";
  16590. this.zpp_inner.validate_gravMass();
  16591. if (null == this.zpp_inner.shapes.head && this.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && this.zpp_inner.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_FIXED) throw "Error: Given current mass/gravMass modes; Body::gravMass only makes sense if it contains Shapes";
  16592. return this.zpp_inner.gravMass
  16593. },
  16594. set_gravMassMode: function (a) {
  16595. this.zpp_inner.immutable_midstep("Body::gravMassMode");
  16596. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16597. if (null == a) throw "Error: Cannot use null gravMassMode";
  16598. var b = this.zpp_inner;
  16599. null == c.util.ZPP_Flags.GravMassMode_SCALED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_SCALED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  16600. a == c.util.ZPP_Flags.GravMassMode_SCALED ? a = c.util.ZPP_Flags.id_GravMassMode_SCALED : (null == c.util.ZPP_Flags.GravMassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_DEFAULT = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1), a = a == c.util.ZPP_Flags.GravMassMode_DEFAULT ? c.util.ZPP_Flags.id_GravMassMode_DEFAULT :
  16601. c.util.ZPP_Flags.id_GravMassMode_FIXED);
  16602. b.gravMassMode = a;
  16603. this.zpp_inner.invalidate_gravMass();
  16604. null == c.util.ZPP_Flags.GravMassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_DEFAULT = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  16605. b = c.util.ZPP_Flags.GravMassMode_DEFAULT;
  16606. null == c.util.ZPP_Flags.GravMassMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_FIXED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  16607. a = c.util.ZPP_Flags.GravMassMode_FIXED;
  16608. null == c.util.ZPP_Flags.GravMassMode_SCALED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_SCALED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  16609. return [b, a, c.util.ZPP_Flags.GravMassMode_SCALED][this.zpp_inner.massMode]
  16610. },
  16611. get_gravMassMode: function () {
  16612. null == c.util.ZPP_Flags.GravMassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_DEFAULT = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  16613. var a = c.util.ZPP_Flags.GravMassMode_DEFAULT,
  16614. b;
  16615. null == c.util.ZPP_Flags.GravMassMode_FIXED &&
  16616. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_FIXED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  16617. b = c.util.ZPP_Flags.GravMassMode_FIXED;
  16618. null == c.util.ZPP_Flags.GravMassMode_SCALED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_SCALED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  16619. return [a, b, c.util.ZPP_Flags.GravMassMode_SCALED][this.zpp_inner.massMode]
  16620. },
  16621. set_mass: function (a) {
  16622. this.zpp_inner.immutable_midstep("Body::mass");
  16623. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16624. if (a != a) throw "Error: Mass cannot be NaN";
  16625. if (0 >= a) throw "Error: Mass must be strictly positive";
  16626. if (a >= Math.POSITIVE_INFINITY) throw "Error: Mass cannot be infinite, use allowMovement = false instead";
  16627. this.zpp_inner.massMode = c.util.ZPP_Flags.id_MassMode_FIXED;
  16628. this.zpp_inner.cmass = a;
  16629. this.zpp_inner.invalidate_mass();
  16630. if (this.zpp_inner.world) throw "Error: Space::world has no mass";
  16631. this.zpp_inner.validate_mass();
  16632. if (this.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && null == this.zpp_inner.shapes.head) throw "Error: Given current mass mode, Body::mass only makes sense if it contains shapes";
  16633. return this.zpp_inner.cmass
  16634. },
  16635. get_mass: function () {
  16636. if (this.zpp_inner.world) throw "Error: Space::world has no mass";
  16637. this.zpp_inner.validate_mass();
  16638. if (this.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && null == this.zpp_inner.shapes.head) throw "Error: Given current mass mode, Body::mass only makes sense if it contains shapes";
  16639. return this.zpp_inner.cmass
  16640. },
  16641. get_constraintMass: function () {
  16642. this.zpp_inner.world || this.zpp_inner.validate_mass();
  16643. return this.zpp_inner.smass
  16644. },
  16645. set_massMode: function (a) {
  16646. this.zpp_inner.immutable_midstep("Body::massMode");
  16647. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16648. if (null == a) throw "Error: cannot use null massMode";
  16649. var b = this.zpp_inner;
  16650. null == c.util.ZPP_Flags.MassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_DEFAULT = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  16651. b.massMode = a == c.util.ZPP_Flags.MassMode_DEFAULT ? c.util.ZPP_Flags.id_MassMode_DEFAULT : c.util.ZPP_Flags.id_MassMode_FIXED;
  16652. this.zpp_inner.invalidate_mass();
  16653. null == c.util.ZPP_Flags.MassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_DEFAULT = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  16654. a = c.util.ZPP_Flags.MassMode_DEFAULT;
  16655. null == c.util.ZPP_Flags.MassMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_FIXED = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  16656. return [a, c.util.ZPP_Flags.MassMode_FIXED][this.zpp_inner.massMode]
  16657. },
  16658. get_massMode: function () {
  16659. var a;
  16660. null == c.util.ZPP_Flags.MassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_DEFAULT = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  16661. a = c.util.ZPP_Flags.MassMode_DEFAULT;
  16662. null == c.util.ZPP_Flags.MassMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_FIXED = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  16663. return [a, c.util.ZPP_Flags.MassMode_FIXED][this.zpp_inner.massMode]
  16664. },
  16665. set_allowRotation: function (a) {
  16666. this.zpp_inner.immutable_midstep("Body::" + K.string(a));
  16667. !this.zpp_inner.norotate != a && (this.zpp_inner.norotate = !a, this.zpp_inner.invalidate_inertia());
  16668. return !this.zpp_inner.norotate
  16669. },
  16670. get_allowRotation: function () {
  16671. return !this.zpp_inner.norotate
  16672. },
  16673. set_allowMovement: function (a) {
  16674. this.zpp_inner.immutable_midstep("Body::" + K.string(a));
  16675. !this.zpp_inner.nomove != a && (this.zpp_inner.nomove = !a, this.zpp_inner.invalidate_mass());
  16676. return !this.zpp_inner.nomove
  16677. },
  16678. get_allowMovement: function () {
  16679. return !this.zpp_inner.nomove
  16680. },
  16681. get_bounds: function () {
  16682. if (this.zpp_inner.world) throw "Error: Space::world has no bounds";
  16683. return this.zpp_inner.aabb.wrapper()
  16684. },
  16685. set_torque: function (a) {
  16686. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16687. if (this.zpp_inner.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Non-dynamic body cannot have torque applied.";
  16688. if (a != a) throw "Error: Body::torque cannot be NaN";
  16689. this.zpp_inner.torque != a && (this.zpp_inner.torque = a, this.zpp_inner.wake());
  16690. return this.zpp_inner.torque
  16691. },
  16692. get_torque: function () {
  16693. return this.zpp_inner.torque
  16694. },
  16695. set_kinAngVel: function (a) {
  16696. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16697. if (this.zpp_inner.kinangvel != a) {
  16698. if (a != a) throw "Error: Body::kinAngVel cannot be NaN";
  16699. this.zpp_inner.kinangvel = a;
  16700. this.zpp_inner.wake()
  16701. }
  16702. return this.zpp_inner.kinangvel
  16703. },
  16704. get_kinAngVel: function () {
  16705. return this.zpp_inner.kinangvel
  16706. },
  16707. set_angularVel: function (a) {
  16708. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16709. if (this.zpp_inner.angvel != a) {
  16710. if (a != a) throw "Error: Body::angularVel cannot be NaN";
  16711. if (this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: A static object cannot be given a velocity";
  16712. this.zpp_inner.angvel = a;
  16713. this.zpp_inner.wake()
  16714. }
  16715. return this.zpp_inner.angvel
  16716. },
  16717. get_angularVel: function () {
  16718. return this.zpp_inner.angvel
  16719. },
  16720. set_rotation: function (a) {
  16721. this.zpp_inner.immutable_midstep("Body::rotation");
  16722. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16723. if (this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.zpp_inner.space) throw "Error: Static objects cannot be rotated once inside a Space";
  16724. if (this.zpp_inner.rot != a) {
  16725. if (a != a) throw "Error: Body::rotation cannot be NaN";
  16726. this.zpp_inner.rot = a;
  16727. this.zpp_inner.invalidate_rot();
  16728. this.zpp_inner.wake()
  16729. }
  16730. return this.zpp_inner.rot
  16731. },
  16732. get_rotation: function () {
  16733. return this.zpp_inner.rot
  16734. },
  16735. get_constraintVelocity: function () {
  16736. null == this.zpp_inner.wrapcvel && this.zpp_inner.setup_cvel();
  16737. return this.zpp_inner.wrapcvel
  16738. },
  16739. set_force: function (a) {
  16740. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16741. if (null == a) throw "Error: Body::force cannot be null";
  16742. null == this.zpp_inner.wrap_force && this.zpp_inner.setupForce();
  16743. this.zpp_inner.wrap_force.set(a);
  16744. null == this.zpp_inner.wrap_force && this.zpp_inner.setupForce();
  16745. return this.zpp_inner.wrap_force
  16746. },
  16747. get_force: function () {
  16748. null == this.zpp_inner.wrap_force && this.zpp_inner.setupForce();
  16749. return this.zpp_inner.wrap_force
  16750. },
  16751. set_surfaceVel: function (a) {
  16752. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16753. if (null == a) throw "Error: Body::surfaceVel cannot be null";
  16754. null == this.zpp_inner.wrap_svel && this.zpp_inner.setupsvel();
  16755. this.zpp_inner.wrap_svel.set(a);
  16756. null == this.zpp_inner.wrap_svel && this.zpp_inner.setupsvel();
  16757. return this.zpp_inner.wrap_svel
  16758. },
  16759. get_surfaceVel: function () {
  16760. null == this.zpp_inner.wrap_svel && this.zpp_inner.setupsvel();
  16761. return this.zpp_inner.wrap_svel
  16762. },
  16763. set_kinematicVel: function (a) {
  16764. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16765. if (null == a) throw "Error: Body::kinematicVel cannot be null";
  16766. null == this.zpp_inner.wrap_kinvel && this.zpp_inner.setupkinvel();
  16767. this.zpp_inner.wrap_kinvel.set(a);
  16768. null == this.zpp_inner.wrap_kinvel && this.zpp_inner.setupkinvel();
  16769. return this.zpp_inner.wrap_kinvel
  16770. },
  16771. get_kinematicVel: function () {
  16772. null == this.zpp_inner.wrap_kinvel && this.zpp_inner.setupkinvel();
  16773. return this.zpp_inner.wrap_kinvel
  16774. },
  16775. setVelocityFromTarget: function (a, b, d) {
  16776. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16777. if (null == a) throw "Cannot set velocity for null target position";
  16778. if (0 == d) throw "deltaTime cannot be 0 for setVelocityFromTarget";
  16779. d = 1 / d;
  16780. null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
  16781. this.zpp_inner.wrap_vel.set(a.sub(function (a) {
  16782. null == a.zpp_inner.wrap_pos && a.zpp_inner.setupPosition();
  16783. return a.zpp_inner.wrap_pos
  16784. }(this), !0).muleq(d));
  16785. this.set_angularVel((b - this.zpp_inner.rot) * d);
  16786. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  16787. return this
  16788. },
  16789. set_velocity: function (a) {
  16790. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16791. if (null == a) throw "Error: Body::velocity cannot be null";
  16792. null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
  16793. this.zpp_inner.wrap_vel.set(a);
  16794. null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
  16795. return this.zpp_inner.wrap_vel
  16796. },
  16797. get_velocity: function () {
  16798. null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
  16799. return this.zpp_inner.wrap_vel
  16800. },
  16801. set_position: function (a) {
  16802. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  16803. if (null == a) throw "Error: Body::position cannot be null";
  16804. null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
  16805. this.zpp_inner.wrap_pos.set(a);
  16806. null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
  16807. return this.zpp_inner.wrap_pos
  16808. },
  16809. get_position: function () {
  16810. null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
  16811. return this.zpp_inner.wrap_pos
  16812. },
  16813. copy: function () {
  16814. if (this.zpp_inner.world) throw "Error: Space::world cannot be copied";
  16815. return this.zpp_inner.copy()
  16816. },
  16817. get_constraints: function () {
  16818. null == this.zpp_inner.wrap_constraints && (this.zpp_inner.wrap_constraints = c.util.ZPP_ConstraintList.get(this.zpp_inner.constraints, !0));
  16819. return this.zpp_inner.wrap_constraints
  16820. },
  16821. get_isSleeping: function () {
  16822. if (null == this.zpp_inner.space) throw "Error: isSleeping makes no sense if the object is not contained within a Space";
  16823. return this.zpp_inner.component.sleeping
  16824. },
  16825. get_arbiters: function () {
  16826. null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
  16827. return this.zpp_inner.wrap_arbiters
  16828. },
  16829. set_space: function (a) {
  16830. if (null != this.zpp_inner.compound) throw "Error: Cannot set the space of a Body belonging to a Compound, only the root Compound space can be set";
  16831. this.zpp_inner.immutable_midstep("Body::space");
  16832. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16833. (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) != a && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.component.woken = !1), null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer).zpp_inner.wrap_bodies.remove(this), null != a && a.zpp_inner.wrap_bodies.add(this));
  16834. return null ==
  16835. this.zpp_inner.space ? null : this.zpp_inner.space.outer
  16836. },
  16837. get_space: function () {
  16838. return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
  16839. },
  16840. set_compound: function (a) {
  16841. (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer) != a && (null != (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer) && (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer).zpp_inner.wrap_bodies.remove(this), null != a && a.zpp_inner.wrap_bodies.add(this));
  16842. return null == this.zpp_inner.compound ? null :
  16843. this.zpp_inner.compound.outer
  16844. },
  16845. get_compound: function () {
  16846. return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
  16847. },
  16848. get_shapes: function () {
  16849. return this.zpp_inner.wrap_shapes
  16850. },
  16851. isKinematic: function () {
  16852. return this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC
  16853. },
  16854. isDynamic: function () {
  16855. return this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC
  16856. },
  16857. isStatic: function () {
  16858. return this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_STATIC
  16859. },
  16860. integrate: function (a) {
  16861. if (a != a) throw "Cannot integrate by NaN time";
  16862. this.zpp_inner.immutable_midstep("Body::space");
  16863. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16864. if (0 == a) return this;
  16865. var b = this.zpp_inner;
  16866. b.sweepTime = 0;
  16867. b.sweep_angvel = b.angvel;
  16868. b.sweepIntegrate(a);
  16869. b.invalidate_pos();
  16870. b.invalidate_rot();
  16871. b.sweepTime = 0;
  16872. return this
  16873. },
  16874. set_disableCCD: function (a) {
  16875. this.zpp_inner.disableCCD = a;
  16876. return this.zpp_inner.disableCCD
  16877. },
  16878. get_disableCCD: function () {
  16879. return this.zpp_inner.disableCCD
  16880. },
  16881. set_isBullet: function (a) {
  16882. this.zpp_inner.bulletEnabled = a;
  16883. return this.zpp_inner.bulletEnabled
  16884. },
  16885. get_isBullet: function () {
  16886. return this.zpp_inner.bulletEnabled
  16887. },
  16888. set_type: function (a) {
  16889. this.zpp_inner.immutable_midstep("Body::type");
  16890. if (this.zpp_inner.world) throw "Error: Space::world is immutable";
  16891. if (c.phys.ZPP_Body.types[this.zpp_inner.type] != a) {
  16892. if (null == a) throw "Error: Cannot use null BodyType";
  16893. null == c.util.ZPP_Flags.BodyType_DYNAMIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_DYNAMIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  16894. a == c.util.ZPP_Flags.BodyType_DYNAMIC ? a = c.util.ZPP_Flags.id_BodyType_DYNAMIC :
  16895. (null == c.util.ZPP_Flags.BodyType_KINEMATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_KINEMATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1), a = a == c.util.ZPP_Flags.BodyType_KINEMATIC ? c.util.ZPP_Flags.id_BodyType_KINEMATIC : c.util.ZPP_Flags.id_BodyType_STATIC);
  16896. a == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.zpp_inner.space && (this.zpp_inner.velx = 0, this.zpp_inner.vely = 0, this.zpp_inner.angvel = 0);
  16897. this.zpp_inner.invalidate_type();
  16898. null != this.zpp_inner.space ? this.zpp_inner.space.transmitType(this.zpp_inner,
  16899. a) : this.zpp_inner.type = a
  16900. }
  16901. return c.phys.ZPP_Body.types[this.zpp_inner.type]
  16902. },
  16903. get_type: function () {
  16904. return c.phys.ZPP_Body.types[this.zpp_inner.type]
  16905. },
  16906. __class__: h.phys.Body
  16907. });
  16908. h.phys.BodyIterator = function () {
  16909. this.zpp_next = null;
  16910. this.zpp_critical = !1;
  16911. this.zpp_i = 0;
  16912. this.zpp_inner = null;
  16913. if (!c.util.ZPP_BodyList.internal) throw "Error: Cannot instantiate BodyIterator derp!";
  16914. };
  16915. s["nape.phys.BodyIterator"] = h.phys.BodyIterator;
  16916. h.phys.BodyIterator.__name__ = ["nape", "phys", "BodyIterator"];
  16917. h.phys.BodyIterator.get = function (a) {
  16918. var b =
  16919. null == h.phys.BodyIterator.zpp_pool ? function (a) {
  16920. c.util.ZPP_BodyList.internal = !0;
  16921. a = new h.phys.BodyIterator;
  16922. c.util.ZPP_BodyList.internal = !1;
  16923. return a
  16924. }(this) : function (a) {
  16925. a = h.phys.BodyIterator.zpp_pool;
  16926. h.phys.BodyIterator.zpp_pool = a.zpp_next;
  16927. return a
  16928. }(this);
  16929. b.zpp_i = 0;
  16930. b.zpp_inner = a;
  16931. b.zpp_critical = !1;
  16932. return b
  16933. };
  16934. h.phys.BodyIterator.prototype = {
  16935. next: function () {
  16936. this.zpp_critical = !1;
  16937. return this.zpp_inner.at(this.zpp_i++)
  16938. },
  16939. hasNext: function () {
  16940. this.zpp_inner.zpp_inner.valmod();
  16941. var a = this.zpp_inner.get_length();
  16942. this.zpp_critical = !0;
  16943. if (this.zpp_i < a) return !0;
  16944. this.zpp_next = h.phys.BodyIterator.zpp_pool;
  16945. h.phys.BodyIterator.zpp_pool = this;
  16946. this.zpp_inner = null;
  16947. return !1
  16948. },
  16949. __class__: h.phys.BodyIterator
  16950. };
  16951. h.phys.BodyList = function () {
  16952. this.zpp_inner = null;
  16953. this.zpp_inner = new c.util.ZPP_BodyList;
  16954. this.zpp_inner.outer = this
  16955. };
  16956. s["nape.phys.BodyList"] = h.phys.BodyList;
  16957. h.phys.BodyList.__name__ = ["nape", "phys", "BodyList"];
  16958. h.phys.BodyList.fromArray = function (a) {
  16959. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  16960. for (var b = new h.phys.BodyList,
  16961. d = 0; d < a.length;) {
  16962. var c = a[d];
  16963. ++d;
  16964. b.push(c)
  16965. }
  16966. return b
  16967. };
  16968. h.phys.BodyList.prototype = {
  16969. filter: function (a) {
  16970. if (null == a) throw "Error: Cannot select elements of list with null";
  16971. for (var b = 0; b < this.get_length();) {
  16972. var d = this.at(b);
  16973. try {
  16974. a(d) ? b++ : this.remove(d)
  16975. } catch (c) {
  16976. break
  16977. }
  16978. }
  16979. return this
  16980. },
  16981. foreach: function (a) {
  16982. if (null == a) throw "Error: Cannot execute null on list elements";
  16983. var b;
  16984. this.zpp_inner.valmod();
  16985. for (b = h.phys.BodyIterator.get(this); b.hasNext();) try {
  16986. var d = a,
  16987. c;
  16988. b.zpp_critical = !1;
  16989. c = b.zpp_inner.at(b.zpp_i++);
  16990. d(c)
  16991. } catch (e) {
  16992. b.zpp_next =
  16993. h.phys.BodyIterator.zpp_pool;
  16994. h.phys.BodyIterator.zpp_pool = b;
  16995. b.zpp_inner = null;
  16996. break
  16997. }
  16998. return this
  16999. },
  17000. toString: function () {
  17001. var a = "[",
  17002. b = !0,
  17003. d;
  17004. this.zpp_inner.valmod();
  17005. for (d = h.phys.BodyIterator.get(this); d.hasNext();) {
  17006. var c = d.next();
  17007. b || (a += ",");
  17008. a += null == c ? "NULL" : c.toString();
  17009. b = !1
  17010. }
  17011. return a + "]"
  17012. },
  17013. merge: function (a) {
  17014. if (null == a) throw "Error: Cannot merge with null list";
  17015. a.zpp_inner.valmod();
  17016. for (a = h.phys.BodyIterator.get(a); a.hasNext();) {
  17017. var b = a.next();
  17018. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  17019. }
  17020. },
  17021. copy: function (a) {
  17022. null == a && (a = !1);
  17023. var b = new h.phys.BodyList,
  17024. d;
  17025. this.zpp_inner.valmod();
  17026. for (d = h.phys.BodyIterator.get(this); d.hasNext();) {
  17027. var c = d.next();
  17028. b.push(a ? function (a) {
  17029. throw "Error: Body is not a copyable type";
  17030. }(this) : c)
  17031. }
  17032. return b
  17033. },
  17034. iterator: function () {
  17035. this.zpp_inner.valmod();
  17036. return h.phys.BodyIterator.get(this)
  17037. },
  17038. empty: function () {
  17039. return null == this.zpp_inner.inner.head
  17040. },
  17041. clear: function () {
  17042. if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
  17043. if (this.zpp_inner.reverse_flag)
  17044. for (; null != this.zpp_inner.inner.head;) this.pop();
  17045. else
  17046. for (; null != this.zpp_inner.inner.head;) this.shift()
  17047. },
  17048. remove: function (a) {
  17049. if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
  17050. this.zpp_inner.modify_test();
  17051. this.zpp_inner.valmod();
  17052. var b;
  17053. b = !1;
  17054. for (var d = this.zpp_inner.inner.head; null != d;) {
  17055. if (d.elt == a.zpp_inner) {
  17056. b = !0;
  17057. break
  17058. }
  17059. d = d.next
  17060. }
  17061. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  17062. return b
  17063. },
  17064. add: function (a) {
  17065. return this.zpp_inner.reverse_flag ?
  17066. this.push(a) : this.unshift(a)
  17067. },
  17068. shift: function () {
  17069. if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
  17070. this.zpp_inner.modify_test();
  17071. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  17072. this.zpp_inner.valmod();
  17073. var a = null;
  17074. if (this.zpp_inner.reverse_flag) {
  17075. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  17076. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  17077. a = null == b ? this.zpp_inner.inner.head.elt :
  17078. b.next.elt,
  17079. d = a.outer;
  17080. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  17081. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  17082. } else a = this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  17083. this.zpp_inner.invalidate();
  17084. return d = a.outer
  17085. },
  17086. pop: function () {
  17087. if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
  17088. this.zpp_inner.modify_test();
  17089. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  17090. this.zpp_inner.valmod();
  17091. var a = null;
  17092. if (this.zpp_inner.reverse_flag) {
  17093. var a = this.zpp_inner.inner.head.elt,
  17094. b = a.outer;
  17095. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  17096. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  17097. } else {
  17098. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  17099. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  17100. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  17101. b = a.outer;
  17102. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  17103. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  17104. }
  17105. this.zpp_inner.invalidate();
  17106. return b = a.outer
  17107. },
  17108. unshift: function (a) {
  17109. if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
  17110. this.zpp_inner.modify_test();
  17111. this.zpp_inner.valmod();
  17112. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  17113. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite =
  17114. this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  17115. return b
  17116. },
  17117. push: function (a) {
  17118. if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
  17119. this.zpp_inner.modify_test();
  17120. this.zpp_inner.valmod();
  17121. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  17122. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite &&
  17123. (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  17124. return b
  17125. },
  17126. at: function (a) {
  17127. this.zpp_inner.valmod();
  17128. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  17129. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  17130. if (a < this.zpp_inner.at_index || null ==
  17131. this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  17132. else
  17133. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  17134. return this.zpp_inner.at_ite.elt.outer
  17135. },
  17136. has: function (a) {
  17137. this.zpp_inner.valmod();
  17138. return this.zpp_inner.inner.has(a.zpp_inner)
  17139. },
  17140. get_length: function () {
  17141. this.zpp_inner.valmod();
  17142. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  17143. return this.zpp_inner.user_length
  17144. },
  17145. __class__: h.phys.BodyList
  17146. };
  17147. h.phys.BodyType = function () {
  17148. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate BodyType derp!";
  17149. };
  17150. s["nape.phys.BodyType"] = h.phys.BodyType;
  17151. h.phys.BodyType.__name__ = ["nape", "phys", "BodyType"];
  17152. h.phys.BodyType.get_STATIC = function () {
  17153. null == c.util.ZPP_Flags.BodyType_STATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_STATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  17154. return c.util.ZPP_Flags.BodyType_STATIC
  17155. };
  17156. h.phys.BodyType.get_DYNAMIC =
  17157. function () {
  17158. null == c.util.ZPP_Flags.BodyType_DYNAMIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_DYNAMIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  17159. return c.util.ZPP_Flags.BodyType_DYNAMIC
  17160. };
  17161. h.phys.BodyType.get_KINEMATIC = function () {
  17162. null == c.util.ZPP_Flags.BodyType_KINEMATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_KINEMATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  17163. return c.util.ZPP_Flags.BodyType_KINEMATIC
  17164. };
  17165. h.phys.BodyType.prototype = {
  17166. toString: function () {
  17167. null ==
  17168. c.util.ZPP_Flags.BodyType_STATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_STATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  17169. var a;
  17170. this == c.util.ZPP_Flags.BodyType_STATIC ? a = "STATIC" : (null == c.util.ZPP_Flags.BodyType_DYNAMIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_DYNAMIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.BodyType_DYNAMIC ? a = "DYNAMIC" : (null == c.util.ZPP_Flags.BodyType_KINEMATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_KINEMATIC =
  17171. new h.phys.BodyType, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.BodyType_KINEMATIC ? "KINEMATIC" : ""));
  17172. return a
  17173. },
  17174. __class__: h.phys.BodyType
  17175. };
  17176. h.phys.Compound = function () {
  17177. this.zpp_inner = null;
  17178. try {
  17179. h.phys.Interactor.call(this)
  17180. } catch (a) {}
  17181. this.zpp_inner = new c.phys.ZPP_Compound;
  17182. this.zpp_inner.outer = this;
  17183. this.zpp_inner.outer_i = this;
  17184. this.zpp_inner_i = this.zpp_inner;
  17185. this.zpp_inner.insert_cbtype(c.callbacks.ZPP_CbType.ANY_COMPOUND.zpp_inner)
  17186. };
  17187. s["nape.phys.Compound"] = h.phys.Compound;
  17188. h.phys.Compound.__name__ = ["nape", "phys", "Compound"];
  17189. h.phys.Compound.__super__ = h.phys.Interactor;
  17190. h.phys.Compound.prototype = I(h.phys.Interactor.prototype, {
  17191. rotate: function (a, b) {
  17192. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  17193. if (null == a) throw "Error: Cannot rotate about a null Vec2";
  17194. if (b != b) throw "Error: Cannot rotate by NaN radians";
  17195. var d = a.zpp_inner.weak;
  17196. a.zpp_inner.weak = !1;
  17197. this.visitBodies(function (d) {
  17198. d.rotate(a, b)
  17199. });
  17200. a.zpp_inner.weak = d;
  17201. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  17202. return this
  17203. },
  17204. translate: function (a) {
  17205. if (null !=
  17206. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  17207. if (null == a) throw "Error: Cannot translate by null Vec2";
  17208. var b = a.zpp_inner.weak;
  17209. a.zpp_inner.weak = !1;
  17210. this.visitBodies(function (b) {
  17211. null == b.zpp_inner.wrap_pos && b.zpp_inner.setupPosition();
  17212. b.zpp_inner.wrap_pos.addeq(a)
  17213. });
  17214. a.zpp_inner.weak = b;
  17215. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  17216. return this
  17217. },
  17218. COM: function (a) {
  17219. null == a && (a = !1);
  17220. var b = h.geom.Vec2.get(0, 0, a),
  17221. d = 0;
  17222. this.visitBodies(function (a) {
  17223. if (!a.zpp_inner.wrap_shapes.empty()) {
  17224. b.addeq(function (b) {
  17225. if (a.zpp_inner.world) throw "Error: Space::world has no worldCOM";
  17226. null == a.zpp_inner.wrap_worldCOM && (a.zpp_inner.wrap_worldCOM = h.geom.Vec2.get(a.zpp_inner.worldCOMx, a.zpp_inner.worldCOMy, null), a.zpp_inner.wrap_worldCOM.zpp_inner._inuse = !0, a.zpp_inner.wrap_worldCOM.zpp_inner._immutable = !0, a.zpp_inner.wrap_worldCOM.zpp_inner._validate = (da = a.zpp_inner, A(da, da.getworldCOM)));
  17227. return a.zpp_inner.wrap_worldCOM
  17228. }(this).mul(function (b) {
  17229. if (a.zpp_inner.world) throw "Error: Space::world has no mass";
  17230. a.zpp_inner.validate_mass();
  17231. if (a.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT &&
  17232. null == a.zpp_inner.shapes.head) throw "Error: Given current mass mode, Body::mass only makes sense if it contains shapes";
  17233. return a.zpp_inner.cmass
  17234. }(this), !0));
  17235. var e = d;
  17236. if (a.zpp_inner.world) throw "Error: Space::world has no mass";
  17237. a.zpp_inner.validate_mass();
  17238. if (a.zpp_inner.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && null == a.zpp_inner.shapes.head) throw "Error: Given current mass mode, Body::mass only makes sense if it contains shapes";
  17239. d = e + a.zpp_inner.cmass
  17240. }
  17241. });
  17242. if (0 == d) throw "Error: COM of an empty Compound is undefined silly";
  17243. b.muleq(1 / d);
  17244. return b
  17245. },
  17246. visitCompounds: function (a) {
  17247. if (null == a) throw "Error: lambda cannot be null for Compound::visitConstraints";
  17248. for (var b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) {
  17249. var d = b.next();
  17250. a(d);
  17251. d.visitCompounds(a)
  17252. }
  17253. },
  17254. visitConstraints: function (a) {
  17255. if (null == a) throw "Error: lambda cannot be null for Compound::visitConstraints";
  17256. for (var b = this.zpp_inner.wrap_constraints.iterator(); b.hasNext();) {
  17257. var d = b.next();
  17258. a(d)
  17259. }
  17260. for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) d = b.next(), d.visitConstraints(a)
  17261. },
  17262. visitBodies: function (a) {
  17263. if (null == a) throw "Error: lambda cannot be null for Compound::visitBodies";
  17264. for (var b = this.zpp_inner.wrap_bodies.iterator(); b.hasNext();) {
  17265. var d = b.next();
  17266. a(d)
  17267. }
  17268. for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) b.next().visitBodies(a)
  17269. },
  17270. breakApart: function () {
  17271. this.zpp_inner.breakApart()
  17272. },
  17273. copy: function () {
  17274. return this.zpp_inner.copy()
  17275. },
  17276. toString: function () {
  17277. return "Compound" + this.zpp_inner_i.id
  17278. },
  17279. set_space: function (a) {
  17280. if (null != this.zpp_inner.compound) throw "Error: Cannot set the space of an inner Compound, only the root Compound space can be set";
  17281. this.zpp_inner.immutable_midstep("Compound::space");
  17282. (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) != a && (null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer).zpp_inner.wrap_compounds.remove(this), null != a && a.zpp_inner.wrap_compounds.add(this));
  17283. return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
  17284. },
  17285. get_space: function () {
  17286. return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
  17287. },
  17288. set_compound: function (a) {
  17289. this.zpp_inner.immutable_midstep("Compound::compound");
  17290. (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer) != a && (null != (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer) && (null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer).zpp_inner.wrap_compounds.remove(this), null != a && a.zpp_inner.wrap_compounds.add(this));
  17291. return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
  17292. },
  17293. get_compound: function () {
  17294. return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
  17295. },
  17296. get_compounds: function () {
  17297. return this.zpp_inner.wrap_compounds
  17298. },
  17299. get_constraints: function () {
  17300. return this.zpp_inner.wrap_constraints
  17301. },
  17302. get_bodies: function () {
  17303. return this.zpp_inner.wrap_bodies
  17304. },
  17305. __class__: h.phys.Compound
  17306. });
  17307. h.phys.CompoundIterator = function () {
  17308. this.zpp_next = null;
  17309. this.zpp_critical = !1;
  17310. this.zpp_i = 0;
  17311. this.zpp_inner = null;
  17312. if (!c.util.ZPP_CompoundList.internal) throw "Error: Cannot instantiate CompoundIterator derp!";
  17313. };
  17314. s["nape.phys.CompoundIterator"] = h.phys.CompoundIterator;
  17315. h.phys.CompoundIterator.__name__ = ["nape", "phys", "CompoundIterator"];
  17316. h.phys.CompoundIterator.get =
  17317. function (a) {
  17318. var b = null == h.phys.CompoundIterator.zpp_pool ? function (a) {
  17319. c.util.ZPP_CompoundList.internal = !0;
  17320. a = new h.phys.CompoundIterator;
  17321. c.util.ZPP_CompoundList.internal = !1;
  17322. return a
  17323. }(this) : function (a) {
  17324. a = h.phys.CompoundIterator.zpp_pool;
  17325. h.phys.CompoundIterator.zpp_pool = a.zpp_next;
  17326. return a
  17327. }(this);
  17328. b.zpp_i = 0;
  17329. b.zpp_inner = a;
  17330. b.zpp_critical = !1;
  17331. return b
  17332. };
  17333. h.phys.CompoundIterator.prototype = {
  17334. next: function () {
  17335. this.zpp_critical = !1;
  17336. return this.zpp_inner.at(this.zpp_i++)
  17337. },
  17338. hasNext: function () {
  17339. this.zpp_inner.zpp_inner.valmod();
  17340. var a = this.zpp_inner.get_length();
  17341. this.zpp_critical = !0;
  17342. if (this.zpp_i < a) return !0;
  17343. this.zpp_next = h.phys.CompoundIterator.zpp_pool;
  17344. h.phys.CompoundIterator.zpp_pool = this;
  17345. this.zpp_inner = null;
  17346. return !1
  17347. },
  17348. __class__: h.phys.CompoundIterator
  17349. };
  17350. h.phys.CompoundList = function () {
  17351. this.zpp_inner = null;
  17352. this.zpp_inner = new c.util.ZPP_CompoundList;
  17353. this.zpp_inner.outer = this
  17354. };
  17355. s["nape.phys.CompoundList"] = h.phys.CompoundList;
  17356. h.phys.CompoundList.__name__ = ["nape", "phys", "CompoundList"];
  17357. h.phys.CompoundList.fromArray = function (a) {
  17358. if (null ==
  17359. a) throw "Error: Cannot convert null Array to Nape list";
  17360. for (var b = new h.phys.CompoundList, d = 0; d < a.length;) {
  17361. var c = a[d];
  17362. ++d;
  17363. b.push(c)
  17364. }
  17365. return b
  17366. };
  17367. h.phys.CompoundList.prototype = {
  17368. filter: function (a) {
  17369. if (null == a) throw "Error: Cannot select elements of list with null";
  17370. for (var b = 0; b < this.get_length();) {
  17371. var d = this.at(b);
  17372. try {
  17373. a(d) ? b++ : this.remove(d)
  17374. } catch (c) {
  17375. break
  17376. }
  17377. }
  17378. return this
  17379. },
  17380. foreach: function (a) {
  17381. if (null == a) throw "Error: Cannot execute null on list elements";
  17382. var b;
  17383. this.zpp_inner.valmod();
  17384. for (b = h.phys.CompoundIterator.get(this); b.hasNext();) try {
  17385. var d =
  17386. a,
  17387. c;
  17388. b.zpp_critical = !1;
  17389. c = b.zpp_inner.at(b.zpp_i++);
  17390. d(c)
  17391. } catch (e) {
  17392. b.zpp_next = h.phys.CompoundIterator.zpp_pool;
  17393. h.phys.CompoundIterator.zpp_pool = b;
  17394. b.zpp_inner = null;
  17395. break
  17396. }
  17397. return this
  17398. },
  17399. toString: function () {
  17400. var a = "[",
  17401. b = !0,
  17402. d;
  17403. this.zpp_inner.valmod();
  17404. for (d = h.phys.CompoundIterator.get(this); d.hasNext();) {
  17405. var c = d.next();
  17406. b || (a += ",");
  17407. a += null == c ? "NULL" : c.toString();
  17408. b = !1
  17409. }
  17410. return a + "]"
  17411. },
  17412. merge: function (a) {
  17413. if (null == a) throw "Error: Cannot merge with null list";
  17414. a.zpp_inner.valmod();
  17415. for (a = h.phys.CompoundIterator.get(a); a.hasNext();) {
  17416. var b =
  17417. a.next();
  17418. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  17419. }
  17420. },
  17421. copy: function (a) {
  17422. null == a && (a = !1);
  17423. var b = new h.phys.CompoundList,
  17424. d;
  17425. this.zpp_inner.valmod();
  17426. for (d = h.phys.CompoundIterator.get(this); d.hasNext();) {
  17427. var c = d.next();
  17428. b.push(a ? function (a) {
  17429. throw "Error: Compound is not a copyable type";
  17430. }(this) : c)
  17431. }
  17432. return b
  17433. },
  17434. iterator: function () {
  17435. this.zpp_inner.valmod();
  17436. return h.phys.CompoundIterator.get(this)
  17437. },
  17438. empty: function () {
  17439. return null == this.zpp_inner.inner.head
  17440. },
  17441. clear: function () {
  17442. if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
  17443. if (this.zpp_inner.reverse_flag)
  17444. for (; null != this.zpp_inner.inner.head;) this.pop();
  17445. else
  17446. for (; null != this.zpp_inner.inner.head;) this.shift()
  17447. },
  17448. remove: function (a) {
  17449. if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
  17450. this.zpp_inner.modify_test();
  17451. this.zpp_inner.valmod();
  17452. var b;
  17453. b = !1;
  17454. for (var d = this.zpp_inner.inner.head; null != d;) {
  17455. if (d.elt == a.zpp_inner) {
  17456. b = !0;
  17457. break
  17458. }
  17459. d = d.next
  17460. }
  17461. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner),
  17462. this.zpp_inner.invalidate());
  17463. return b
  17464. },
  17465. add: function (a) {
  17466. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  17467. },
  17468. shift: function () {
  17469. if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
  17470. this.zpp_inner.modify_test();
  17471. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  17472. this.zpp_inner.valmod();
  17473. var a = null;
  17474. if (this.zpp_inner.reverse_flag) {
  17475. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  17476. var b = 1 == this.get_length() ? null :
  17477. this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  17478. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  17479. d = a.outer;
  17480. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  17481. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  17482. } else a = this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  17483. this.zpp_inner.invalidate();
  17484. return d = a.outer
  17485. },
  17486. pop: function () {
  17487. if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
  17488. this.zpp_inner.modify_test();
  17489. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  17490. this.zpp_inner.valmod();
  17491. var a = null;
  17492. if (this.zpp_inner.reverse_flag) {
  17493. var a = this.zpp_inner.inner.head.elt,
  17494. b = a.outer;
  17495. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  17496. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  17497. } else {
  17498. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  17499. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
  17500. 2),
  17501. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  17502. b = a.outer;
  17503. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  17504. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  17505. }
  17506. this.zpp_inner.invalidate();
  17507. return b = a.outer
  17508. },
  17509. unshift: function (a) {
  17510. if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
  17511. this.zpp_inner.modify_test();
  17512. this.zpp_inner.valmod();
  17513. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  17514. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite =
  17515. null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  17516. return b
  17517. },
  17518. push: function (a) {
  17519. if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
  17520. this.zpp_inner.modify_test();
  17521. this.zpp_inner.valmod();
  17522. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
  17523. !0;
  17524. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  17525. return b
  17526. },
  17527. at: function (a) {
  17528. this.zpp_inner.valmod();
  17529. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  17530. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  17531. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  17532. else
  17533. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  17534. return this.zpp_inner.at_ite.elt.outer
  17535. },
  17536. has: function (a) {
  17537. this.zpp_inner.valmod();
  17538. return this.zpp_inner.inner.has(a.zpp_inner)
  17539. },
  17540. get_length: function () {
  17541. this.zpp_inner.valmod();
  17542. this.zpp_inner.zip_length &&
  17543. (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  17544. return this.zpp_inner.user_length
  17545. },
  17546. __class__: h.phys.CompoundList
  17547. };
  17548. h.phys.FluidProperties = function (a, b) {
  17549. null == b && (b = 1);
  17550. null == a && (a = 1);
  17551. this.zpp_inner = null;
  17552. null == c.phys.ZPP_FluidProperties.zpp_pool ? this.zpp_inner = new c.phys.ZPP_FluidProperties : (this.zpp_inner = c.phys.ZPP_FluidProperties.zpp_pool, c.phys.ZPP_FluidProperties.zpp_pool = this.zpp_inner.next, this.zpp_inner.next = null);
  17553. null;
  17554. this.zpp_inner.outer = this;
  17555. if (a != 1E3 *
  17556. this.zpp_inner.density) {
  17557. if (a != a) throw "Error: FluidProperties::density cannot be NaN";
  17558. this.zpp_inner.density = a / 1E3;
  17559. this.zpp_inner.invalidate()
  17560. }
  17561. 1E3 * this.zpp_inner.density;
  17562. if (b != this.zpp_inner.viscosity) {
  17563. if (b != b) throw "Error: FluidProperties::viscosity cannot be NaN";
  17564. if (0 > b) throw "Error: FluidProperties::viscosity (" + b + ") must be >= 0";
  17565. this.zpp_inner.viscosity = b / 1;
  17566. this.zpp_inner.invalidate()
  17567. }
  17568. this.zpp_inner.viscosity
  17569. };
  17570. s["nape.phys.FluidProperties"] = h.phys.FluidProperties;
  17571. h.phys.FluidProperties.__name__ = ["nape", "phys", "FluidProperties"];
  17572. h.phys.FluidProperties.prototype = {
  17573. toString: function () {
  17574. return "{ density: " + 1E3 * this.zpp_inner.density + " viscosity: " + this.zpp_inner.viscosity + " gravity: " + K.string(this.zpp_inner.wrap_gravity) + " }"
  17575. },
  17576. set_gravity: function (a) {
  17577. if (null == a) null != this.zpp_inner.wrap_gravity && (this.zpp_inner.wrap_gravity.zpp_inner._inuse = !1, this.zpp_inner.wrap_gravity.dispose(), this.zpp_inner.wrap_gravity = null);
  17578. else {
  17579. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  17580. null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
  17581. this.zpp_inner.wrap_gravity.set(a)
  17582. }
  17583. return this.zpp_inner.wrap_gravity
  17584. },
  17585. get_gravity: function () {
  17586. return this.zpp_inner.wrap_gravity
  17587. },
  17588. set_viscosity: function (a) {
  17589. if (a != this.zpp_inner.viscosity) {
  17590. if (a != a) throw "Error: FluidProperties::viscosity cannot be NaN";
  17591. if (0 > a) throw "Error: FluidProperties::viscosity (" + a + ") must be >= 0";
  17592. this.zpp_inner.viscosity = a / 1;
  17593. this.zpp_inner.invalidate()
  17594. }
  17595. return this.zpp_inner.viscosity
  17596. },
  17597. get_viscosity: function () {
  17598. return this.zpp_inner.viscosity
  17599. },
  17600. set_density: function (a) {
  17601. if (a != 1E3 * this.zpp_inner.density) {
  17602. if (a != a) throw "Error: FluidProperties::density cannot be NaN";
  17603. this.zpp_inner.density = a / 1E3;
  17604. this.zpp_inner.invalidate()
  17605. }
  17606. return 1E3 * this.zpp_inner.density
  17607. },
  17608. get_density: function () {
  17609. return 1E3 * this.zpp_inner.density
  17610. },
  17611. copy: function () {
  17612. var a = new h.phys.FluidProperties(1E3 * this.zpp_inner.density, this.zpp_inner.viscosity);
  17613. null != this.zpp_inner.userData && (a.zpp_inner.userData = W.copy(this.zpp_inner.userData));
  17614. a.set_gravity(this.zpp_inner.wrap_gravity);
  17615. return a
  17616. },
  17617. get_shapes: function () {
  17618. null == this.zpp_inner.wrap_shapes && (this.zpp_inner.wrap_shapes = c.util.ZPP_ShapeList.get(this.zpp_inner.shapes, !0));
  17619. return this.zpp_inner.wrap_shapes
  17620. },
  17621. get_userData: function () {
  17622. null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
  17623. return this.zpp_inner.userData
  17624. },
  17625. __class__: h.phys.FluidProperties
  17626. };
  17627. h.phys.GravMassMode = function () {
  17628. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate GravMassMode derp!";
  17629. };
  17630. s["nape.phys.GravMassMode"] = h.phys.GravMassMode;
  17631. h.phys.GravMassMode.__name__ = ["nape", "phys", "GravMassMode"];
  17632. h.phys.GravMassMode.get_DEFAULT = function () {
  17633. null == c.util.ZPP_Flags.GravMassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_DEFAULT = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  17634. return c.util.ZPP_Flags.GravMassMode_DEFAULT
  17635. };
  17636. h.phys.GravMassMode.get_FIXED = function () {
  17637. null == c.util.ZPP_Flags.GravMassMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_FIXED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  17638. return c.util.ZPP_Flags.GravMassMode_FIXED
  17639. };
  17640. h.phys.GravMassMode.get_SCALED = function () {
  17641. null == c.util.ZPP_Flags.GravMassMode_SCALED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_SCALED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  17642. return c.util.ZPP_Flags.GravMassMode_SCALED
  17643. };
  17644. h.phys.GravMassMode.prototype = {
  17645. toString: function () {
  17646. var a;
  17647. null == c.util.ZPP_Flags.GravMassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_DEFAULT = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1);
  17648. this == c.util.ZPP_Flags.GravMassMode_DEFAULT ?
  17649. a = "DEFAULT" : (null == c.util.ZPP_Flags.GravMassMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_FIXED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.GravMassMode_FIXED ? a = "FIXED" : (null == c.util.ZPP_Flags.GravMassMode_SCALED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.GravMassMode_SCALED = new h.phys.GravMassMode, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.GravMassMode_SCALED ? "SCALED" : ""));
  17650. return a
  17651. },
  17652. __class__: h.phys.GravMassMode
  17653. };
  17654. h.phys.InertiaMode =
  17655. function () {
  17656. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate InertiaMode derp!";
  17657. };
  17658. s["nape.phys.InertiaMode"] = h.phys.InertiaMode;
  17659. h.phys.InertiaMode.__name__ = ["nape", "phys", "InertiaMode"];
  17660. h.phys.InertiaMode.get_DEFAULT = function () {
  17661. null == c.util.ZPP_Flags.InertiaMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_DEFAULT = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  17662. return c.util.ZPP_Flags.InertiaMode_DEFAULT
  17663. };
  17664. h.phys.InertiaMode.get_FIXED = function () {
  17665. null == c.util.ZPP_Flags.InertiaMode_FIXED &&
  17666. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_FIXED = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  17667. return c.util.ZPP_Flags.InertiaMode_FIXED
  17668. };
  17669. h.phys.InertiaMode.prototype = {
  17670. toString: function () {
  17671. null == c.util.ZPP_Flags.InertiaMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_DEFAULT = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1);
  17672. var a;
  17673. this == c.util.ZPP_Flags.InertiaMode_DEFAULT ? a = "DEFAULT" : (null == c.util.ZPP_Flags.InertiaMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InertiaMode_FIXED = new h.phys.InertiaMode, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.InertiaMode_FIXED ? "FIXED" : "");
  17674. return a
  17675. },
  17676. __class__: h.phys.InertiaMode
  17677. };
  17678. h.phys.InteractorIterator = function () {
  17679. this.zpp_next = null;
  17680. this.zpp_critical = !1;
  17681. this.zpp_i = 0;
  17682. this.zpp_inner = null;
  17683. if (!c.util.ZPP_InteractorList.internal) throw "Error: Cannot instantiate InteractorIterator derp!";
  17684. };
  17685. s["nape.phys.InteractorIterator"] = h.phys.InteractorIterator;
  17686. h.phys.InteractorIterator.__name__ = ["nape", "phys",
  17687. "InteractorIterator"
  17688. ];
  17689. h.phys.InteractorIterator.get = function (a) {
  17690. var b = null == h.phys.InteractorIterator.zpp_pool ? function (a) {
  17691. c.util.ZPP_InteractorList.internal = !0;
  17692. a = new h.phys.InteractorIterator;
  17693. c.util.ZPP_InteractorList.internal = !1;
  17694. return a
  17695. }(this) : function (a) {
  17696. a = h.phys.InteractorIterator.zpp_pool;
  17697. h.phys.InteractorIterator.zpp_pool = a.zpp_next;
  17698. return a
  17699. }(this);
  17700. b.zpp_i = 0;
  17701. b.zpp_inner = a;
  17702. b.zpp_critical = !1;
  17703. return b
  17704. };
  17705. h.phys.InteractorIterator.prototype = {
  17706. next: function () {
  17707. this.zpp_critical = !1;
  17708. return this.zpp_inner.at(this.zpp_i++)
  17709. },
  17710. hasNext: function () {
  17711. this.zpp_inner.zpp_inner.valmod();
  17712. var a = this.zpp_inner.get_length();
  17713. this.zpp_critical = !0;
  17714. if (this.zpp_i < a) return !0;
  17715. this.zpp_next = h.phys.InteractorIterator.zpp_pool;
  17716. h.phys.InteractorIterator.zpp_pool = this;
  17717. this.zpp_inner = null;
  17718. return !1
  17719. },
  17720. __class__: h.phys.InteractorIterator
  17721. };
  17722. h.phys.InteractorList = function () {
  17723. this.zpp_inner = null;
  17724. this.zpp_inner = new c.util.ZPP_InteractorList;
  17725. this.zpp_inner.outer = this
  17726. };
  17727. s["nape.phys.InteractorList"] = h.phys.InteractorList;
  17728. h.phys.InteractorList.__name__ = ["nape",
  17729. "phys", "InteractorList"
  17730. ];
  17731. h.phys.InteractorList.fromArray = function (a) {
  17732. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  17733. for (var b = new h.phys.InteractorList, d = 0; d < a.length;) {
  17734. var c = a[d];
  17735. ++d;
  17736. b.push(c)
  17737. }
  17738. return b
  17739. };
  17740. h.phys.InteractorList.prototype = {
  17741. filter: function (a) {
  17742. if (null == a) throw "Error: Cannot select elements of list with null";
  17743. for (var b = 0; b < this.get_length();) {
  17744. var d = this.at(b);
  17745. try {
  17746. a(d) ? b++ : this.remove(d)
  17747. } catch (c) {
  17748. break
  17749. }
  17750. }
  17751. return this
  17752. },
  17753. foreach: function (a) {
  17754. if (null == a) throw "Error: Cannot execute null on list elements";
  17755. var b;
  17756. this.zpp_inner.valmod();
  17757. for (b = h.phys.InteractorIterator.get(this); b.hasNext();) try {
  17758. var d = a,
  17759. c;
  17760. b.zpp_critical = !1;
  17761. c = b.zpp_inner.at(b.zpp_i++);
  17762. d(c)
  17763. } catch (e) {
  17764. b.zpp_next = h.phys.InteractorIterator.zpp_pool;
  17765. h.phys.InteractorIterator.zpp_pool = b;
  17766. b.zpp_inner = null;
  17767. break
  17768. }
  17769. return this
  17770. },
  17771. toString: function () {
  17772. var a = "[",
  17773. b = !0,
  17774. d;
  17775. this.zpp_inner.valmod();
  17776. for (d = h.phys.InteractorIterator.get(this); d.hasNext();) {
  17777. var c = d.next();
  17778. b || (a += ",");
  17779. a += null == c ? "NULL" : c.toString();
  17780. b = !1
  17781. }
  17782. return a + "]"
  17783. },
  17784. merge: function (a) {
  17785. if (null == a) throw "Error: Cannot merge with null list";
  17786. a.zpp_inner.valmod();
  17787. for (a = h.phys.InteractorIterator.get(a); a.hasNext();) {
  17788. var b = a.next();
  17789. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  17790. }
  17791. },
  17792. copy: function (a) {
  17793. null == a && (a = !1);
  17794. var b = new h.phys.InteractorList,
  17795. d;
  17796. this.zpp_inner.valmod();
  17797. for (d = h.phys.InteractorIterator.get(this); d.hasNext();) {
  17798. var c = d.next();
  17799. b.push(a ? function (a) {
  17800. throw "Error: Interactor is not a copyable type";
  17801. }(this) : c)
  17802. }
  17803. return b
  17804. },
  17805. iterator: function () {
  17806. this.zpp_inner.valmod();
  17807. return h.phys.InteractorIterator.get(this)
  17808. },
  17809. empty: function () {
  17810. return null == this.zpp_inner.inner.head
  17811. },
  17812. clear: function () {
  17813. if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
  17814. if (this.zpp_inner.reverse_flag)
  17815. for (; null != this.zpp_inner.inner.head;) this.pop();
  17816. else
  17817. for (; null != this.zpp_inner.inner.head;) this.shift()
  17818. },
  17819. remove: function (a) {
  17820. if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
  17821. this.zpp_inner.modify_test();
  17822. this.zpp_inner.valmod();
  17823. var b;
  17824. b = !1;
  17825. for (var d = this.zpp_inner.inner.head; null != d;) {
  17826. if (d.elt == a.zpp_inner_i) {
  17827. b = !0;
  17828. break
  17829. }
  17830. d = d.next
  17831. }
  17832. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner_i), this.zpp_inner.invalidate());
  17833. return b
  17834. },
  17835. add: function (a) {
  17836. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  17837. },
  17838. shift: function () {
  17839. if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
  17840. this.zpp_inner.modify_test();
  17841. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  17842. this.zpp_inner.valmod();
  17843. var a = null;
  17844. if (this.zpp_inner.reverse_flag) {
  17845. null !=
  17846. this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  17847. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  17848. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  17849. d = a.outer_i;
  17850. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  17851. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  17852. } else a = this.zpp_inner.inner.head.elt, d = a.outer_i, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  17853. this.zpp_inner.invalidate();
  17854. return d = a.outer_i
  17855. },
  17856. pop: function () {
  17857. if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
  17858. this.zpp_inner.modify_test();
  17859. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  17860. this.zpp_inner.valmod();
  17861. var a = null;
  17862. if (this.zpp_inner.reverse_flag) {
  17863. var a = this.zpp_inner.inner.head.elt,
  17864. b = a.outer_i;
  17865. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  17866. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  17867. } else {
  17868. null != this.zpp_inner.at_ite && null ==
  17869. this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  17870. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  17871. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  17872. b = a.outer_i;
  17873. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  17874. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  17875. }
  17876. this.zpp_inner.invalidate();
  17877. return b = a.outer_i
  17878. },
  17879. unshift: function (a) {
  17880. if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
  17881. this.zpp_inner.modify_test();
  17882. this.zpp_inner.valmod();
  17883. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  17884. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner_i)) : this.zpp_inner.inner.add(a.zpp_inner_i), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  17885. return b
  17886. },
  17887. push: function (a) {
  17888. if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
  17889. this.zpp_inner.modify_test();
  17890. this.zpp_inner.valmod();
  17891. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  17892. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner_i) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner_i)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  17893. return b
  17894. },
  17895. at: function (a) {
  17896. this.zpp_inner.valmod();
  17897. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  17898. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  17899. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  17900. else
  17901. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  17902. return this.zpp_inner.at_ite.elt.outer_i
  17903. },
  17904. has: function (a) {
  17905. this.zpp_inner.valmod();
  17906. return this.zpp_inner.inner.has(a.zpp_inner_i)
  17907. },
  17908. get_length: function () {
  17909. this.zpp_inner.valmod();
  17910. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  17911. return this.zpp_inner.user_length
  17912. },
  17913. __class__: h.phys.InteractorList
  17914. };
  17915. h.phys.MassMode = function () {
  17916. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate MassMode derp!";
  17917. };
  17918. s["nape.phys.MassMode"] = h.phys.MassMode;
  17919. h.phys.MassMode.__name__ = ["nape", "phys", "MassMode"];
  17920. h.phys.MassMode.get_DEFAULT =
  17921. function () {
  17922. null == c.util.ZPP_Flags.MassMode_DEFAULT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_DEFAULT = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  17923. return c.util.ZPP_Flags.MassMode_DEFAULT
  17924. };
  17925. h.phys.MassMode.get_FIXED = function () {
  17926. null == c.util.ZPP_Flags.MassMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_FIXED = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  17927. return c.util.ZPP_Flags.MassMode_FIXED
  17928. };
  17929. h.phys.MassMode.prototype = {
  17930. toString: function () {
  17931. var a;
  17932. null == c.util.ZPP_Flags.MassMode_DEFAULT &&
  17933. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_DEFAULT = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1);
  17934. this == c.util.ZPP_Flags.MassMode_DEFAULT ? a = "DEFAULT" : (null == c.util.ZPP_Flags.MassMode_FIXED && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.MassMode_FIXED = new h.phys.MassMode, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.MassMode_FIXED ? "FIXED" : "");
  17935. return a
  17936. },
  17937. __class__: h.phys.MassMode
  17938. };
  17939. h.phys.Material = function (a, b, d, g, e) {
  17940. null == e && (e = 0.001);
  17941. null == g && (g = 1);
  17942. null == d && (d = 2);
  17943. null == b &&
  17944. (b = 1);
  17945. null == a && (a = 0);
  17946. this.zpp_inner = null;
  17947. null == c.phys.ZPP_Material.zpp_pool ? this.zpp_inner = new c.phys.ZPP_Material : (this.zpp_inner = c.phys.ZPP_Material.zpp_pool, c.phys.ZPP_Material.zpp_pool = this.zpp_inner.next, this.zpp_inner.next = null);
  17948. null;
  17949. this.zpp_inner.outer = this;
  17950. if (a != this.zpp_inner.elasticity) {
  17951. if (a != a) throw "Error: Material::elasticity cannot be NaN";
  17952. this.zpp_inner.elasticity = a / 1;
  17953. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
  17954. }
  17955. this.zpp_inner.elasticity;
  17956. if (b != this.zpp_inner.dynamicFriction) {
  17957. if (b !=
  17958. b) throw "Error: Material::dynamicFriction cannot be NaN";
  17959. if (0 > b) throw "Error: Material::dynamicFriction cannot be negative";
  17960. this.zpp_inner.dynamicFriction = b / 1;
  17961. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ANGDRAG | c.phys.ZPP_Material.ARBITERS)
  17962. }
  17963. this.zpp_inner.dynamicFriction;
  17964. if (d != this.zpp_inner.staticFriction) {
  17965. if (d != d) throw "Error: Material::staticFriction cannot be NaN";
  17966. if (0 > d) throw "Error: Material::staticFriction cannot be negative";
  17967. this.zpp_inner.staticFriction = d / 1;
  17968. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE |
  17969. c.phys.ZPP_Material.ARBITERS)
  17970. }
  17971. this.zpp_inner.staticFriction;
  17972. if (g != 1E3 * this.zpp_inner.density) {
  17973. if (g != g) throw "Error: Material::density cannot be NaN";
  17974. if (0 > g) throw "Error: Material::density must be positive";
  17975. if (0 > g) throw "Error: Material::density cannot be negative";
  17976. this.zpp_inner.density = g / 1E3;
  17977. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.PROPS)
  17978. }
  17979. 1E3 * this.zpp_inner.density;
  17980. if (e != this.zpp_inner.rollingFriction) {
  17981. if (e != e) throw "Error: Material::rollingFriction cannot be NaN";
  17982. if (0 >
  17983. e) throw "Error: Material::rollingFriction cannot be negative";
  17984. this.zpp_inner.rollingFriction = e / 1;
  17985. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
  17986. }
  17987. this.zpp_inner.rollingFriction
  17988. };
  17989. s["nape.phys.Material"] = h.phys.Material;
  17990. h.phys.Material.__name__ = ["nape", "phys", "Material"];
  17991. h.phys.Material.wood = function () {
  17992. return new h.phys.Material(0.4, 0.2, 0.38, 0.7, 0.005)
  17993. };
  17994. h.phys.Material.steel = function () {
  17995. return new h.phys.Material(0.2, 0.57, 0.74, 7.8, 0.001)
  17996. };
  17997. h.phys.Material.ice = function () {
  17998. return new h.phys.Material(0.3,
  17999. 0.03, 0.1, 0.9, 1E-4)
  18000. };
  18001. h.phys.Material.rubber = function () {
  18002. return new h.phys.Material(0.8, 1, 1.4, 1.5, 0.01)
  18003. };
  18004. h.phys.Material.glass = function () {
  18005. return new h.phys.Material(0.4, 0.4, 0.94, 2.6, 0.002)
  18006. };
  18007. h.phys.Material.sand = function () {
  18008. return new h.phys.Material(-1, 0.45, 0.6, 1.6, 16)
  18009. };
  18010. h.phys.Material.prototype = {
  18011. toString: function () {
  18012. return "{ elasticity: " + this.zpp_inner.elasticity + " dynamicFriction: " + this.zpp_inner.dynamicFriction + " staticFriction: " + this.zpp_inner.staticFriction + " density: " + 1E3 * this.zpp_inner.density +
  18013. " rollingFriction: " + this.zpp_inner.rollingFriction + " }"
  18014. },
  18015. set_rollingFriction: function (a) {
  18016. if (a != this.zpp_inner.rollingFriction) {
  18017. if (a != a) throw "Error: Material::rollingFriction cannot be NaN";
  18018. if (0 > a) throw "Error: Material::rollingFriction cannot be negative";
  18019. this.zpp_inner.rollingFriction = a / 1;
  18020. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
  18021. }
  18022. return this.zpp_inner.rollingFriction
  18023. },
  18024. get_rollingFriction: function () {
  18025. return this.zpp_inner.rollingFriction
  18026. },
  18027. set_density: function (a) {
  18028. if (a !=
  18029. 1E3 * this.zpp_inner.density) {
  18030. if (a != a) throw "Error: Material::density cannot be NaN";
  18031. if (0 > a) throw "Error: Material::density must be positive";
  18032. if (0 > a) throw "Error: Material::density cannot be negative";
  18033. this.zpp_inner.density = a / 1E3;
  18034. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.PROPS)
  18035. }
  18036. return 1E3 * this.zpp_inner.density
  18037. },
  18038. get_density: function () {
  18039. return 1E3 * this.zpp_inner.density
  18040. },
  18041. set_staticFriction: function (a) {
  18042. if (a != this.zpp_inner.staticFriction) {
  18043. if (a != a) throw "Error: Material::staticFriction cannot be NaN";
  18044. if (0 > a) throw "Error: Material::staticFriction cannot be negative";
  18045. this.zpp_inner.staticFriction = a / 1;
  18046. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
  18047. }
  18048. return this.zpp_inner.staticFriction
  18049. },
  18050. get_staticFriction: function () {
  18051. return this.zpp_inner.staticFriction
  18052. },
  18053. set_dynamicFriction: function (a) {
  18054. if (a != this.zpp_inner.dynamicFriction) {
  18055. if (a != a) throw "Error: Material::dynamicFriction cannot be NaN";
  18056. if (0 > a) throw "Error: Material::dynamicFriction cannot be negative";
  18057. this.zpp_inner.dynamicFriction =
  18058. a / 1;
  18059. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ANGDRAG | c.phys.ZPP_Material.ARBITERS)
  18060. }
  18061. return this.zpp_inner.dynamicFriction
  18062. },
  18063. get_dynamicFriction: function () {
  18064. return this.zpp_inner.dynamicFriction
  18065. },
  18066. set_elasticity: function (a) {
  18067. if (a != this.zpp_inner.elasticity) {
  18068. if (a != a) throw "Error: Material::elasticity cannot be NaN";
  18069. this.zpp_inner.elasticity = a / 1;
  18070. this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
  18071. }
  18072. return this.zpp_inner.elasticity
  18073. },
  18074. get_elasticity: function () {
  18075. return this.zpp_inner.elasticity
  18076. },
  18077. copy: function () {
  18078. var a = new h.phys.Material(this.zpp_inner.elasticity, this.zpp_inner.dynamicFriction, this.zpp_inner.staticFriction, 1E3 * this.zpp_inner.density, this.zpp_inner.rollingFriction);
  18079. null != this.zpp_inner.userData && (a.zpp_inner.userData = W.copy(this.zpp_inner.userData));
  18080. return a
  18081. },
  18082. get_shapes: function () {
  18083. null == this.zpp_inner.wrap_shapes && (this.zpp_inner.wrap_shapes = c.util.ZPP_ShapeList.get(this.zpp_inner.shapes, !0));
  18084. return this.zpp_inner.wrap_shapes
  18085. },
  18086. get_userData: function () {
  18087. null == this.zpp_inner.userData &&
  18088. (this.zpp_inner.userData = {});
  18089. return this.zpp_inner.userData
  18090. },
  18091. __class__: h.phys.Material
  18092. };
  18093. h.shape = {};
  18094. h.shape.Shape = function () {
  18095. this.zpp_inner = null;
  18096. try {
  18097. h.phys.Interactor.call(this)
  18098. } catch (a) {}
  18099. throw "Error: Shape cannot be instantiated derp!";
  18100. };
  18101. s["nape.shape.Shape"] = h.shape.Shape;
  18102. h.shape.Shape.__name__ = ["nape", "shape", "Shape"];
  18103. h.shape.Shape.__super__ = h.phys.Interactor;
  18104. h.shape.Shape.prototype = I(h.phys.Interactor.prototype, {
  18105. toString: function () {
  18106. return (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ?
  18107. "Circle" : "Polygon") + "#" + this.zpp_inner_i.id
  18108. },
  18109. copy: function () {
  18110. return this.zpp_inner.copy()
  18111. },
  18112. contains: function (a) {
  18113. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18114. if (null == a) throw "Cannot check null point for containment";
  18115. if (null == (null != this.zpp_inner.body ? this.zpp_inner.body.outer : null)) throw "Error: Shape is not well defined without a Body";
  18116. c.geom.ZPP_Geom.validateShape(this.zpp_inner);
  18117. a.zpp_inner.validate();
  18118. var b = c.geom.ZPP_Collide.shapeContains(this.zpp_inner, a.zpp_inner);
  18119. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  18120. return b
  18121. },
  18122. transform: function (a) {
  18123. this.zpp_inner.immutable_midstep("Shape::transform()");
  18124. if (null != this.zpp_inner.body && null != this.zpp_inner.body.space && this.zpp_inner.body.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: Cannot modify Shape belonging to a static Object once inside a Space";
  18125. if (null == a) throw "Error: Cannot transform Shape by null matrix";
  18126. if (a.singular()) throw "Error: Cannot transform Shape by a singular matrix";
  18127. if (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE)
  18128. if (a.equiorthogonal()) this.zpp_inner.circle.__transform(a);
  18129. else throw "Error: Cannot transform Circle by a non equiorthogonal matrix";
  18130. else this.zpp_inner.polygon.__transform(a);
  18131. return this
  18132. },
  18133. rotate: function (a) {
  18134. this.zpp_inner.immutable_midstep("Shape::rotate()");
  18135. if (null != this.zpp_inner.body && null != this.zpp_inner.body.space && this.zpp_inner.body.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: Cannot modify Shape belonging to a static Object once inside a Space";
  18136. if (a != a) throw "Error: Cannot rotate Shape by NaN";
  18137. if (0 != a % (2 * Math.PI)) {
  18138. var b = Math.cos(a);
  18139. a = Math.sin(a);
  18140. this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.__rotate(a, b) : this.zpp_inner.polygon.__rotate(a, b)
  18141. }
  18142. return this
  18143. },
  18144. scale: function (a, b) {
  18145. this.zpp_inner.immutable_midstep("Shape::scale()");
  18146. if (null != this.zpp_inner.body && null != this.zpp_inner.body.space && this.zpp_inner.body.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: Cannot modify Shape belonging to a static Object once inside a Space";
  18147. if (a != a || b != b) throw "Error: Cannot scale Shape by NaN";
  18148. if (0 == a || 0 == b) throw "Error: Cannot Scale shape by a factor of 0";
  18149. if (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
  18150. var d = a * a - b * b;
  18151. if (d * d < h.Config.epsilon * h.Config.epsilon) this.zpp_inner.circle.__scale(a, b);
  18152. else throw "Error: Cannot perform a non equal scaling on a Circle";
  18153. } else this.zpp_inner.polygon.__scale(a, b);
  18154. return this
  18155. },
  18156. translate: function (a) {
  18157. this.zpp_inner.immutable_midstep("Shape::translate()");
  18158. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18159. if (null != this.zpp_inner.body && null != this.zpp_inner.body.space && this.zpp_inner.body.type ==
  18160. c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: Cannot modify Shape belonging to a static Object once inside a Space";
  18161. if (null == a) throw "Error: Cannot displace Shape by null Vec2";
  18162. 0 < a.lsq() && (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.__translate(function (b) {
  18163. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18164. a.zpp_inner.validate();
  18165. return a.zpp_inner.x
  18166. }(this), function (b) {
  18167. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18168. a.zpp_inner.validate();
  18169. return a.zpp_inner.y
  18170. }(this)) : this.zpp_inner.polygon.__translate(function (b) {
  18171. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18172. a.zpp_inner.validate();
  18173. return a.zpp_inner.x
  18174. }(this), function (b) {
  18175. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18176. a.zpp_inner.validate();
  18177. return a.zpp_inner.y
  18178. }(this)));
  18179. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  18180. return this
  18181. },
  18182. get_bounds: function () {
  18183. return this.zpp_inner.aabb.wrapper()
  18184. },
  18185. set_sensorEnabled: function (a) {
  18186. this.zpp_inner.immutable_midstep("Shape::sensorEnabled");
  18187. this.zpp_inner.sensorEnabled = a;
  18188. this.zpp_inner.wake();
  18189. return this.zpp_inner.sensorEnabled
  18190. },
  18191. get_sensorEnabled: function () {
  18192. return this.zpp_inner.sensorEnabled
  18193. },
  18194. set_fluidEnabled: function (a) {
  18195. this.zpp_inner.immutable_midstep("Shape::fluidEnabled");
  18196. (this.zpp_inner.fluidEnabled = a) && null == this.zpp_inner.fluidProperties && this.set_fluidProperties(new h.phys.FluidProperties);
  18197. this.zpp_inner.wake();
  18198. return this.zpp_inner.fluidEnabled
  18199. },
  18200. get_fluidEnabled: function () {
  18201. return this.zpp_inner.fluidEnabled
  18202. },
  18203. set_fluidProperties: function (a) {
  18204. if (null ==
  18205. a) throw "Error: Cannot assign null as Shape fluidProperties, disable fluids by setting fluidEnabled to false";
  18206. this.zpp_inner.setFluid(a.zpp_inner);
  18207. this.zpp_inner.immutable_midstep("Shape::fluidProperties");
  18208. null == this.zpp_inner.fluidProperties && this.zpp_inner.setFluid((new h.phys.FluidProperties).zpp_inner);
  18209. return this.zpp_inner.fluidProperties.wrapper()
  18210. },
  18211. get_fluidProperties: function () {
  18212. this.zpp_inner.immutable_midstep("Shape::fluidProperties");
  18213. null == this.zpp_inner.fluidProperties && this.zpp_inner.setFluid((new h.phys.FluidProperties).zpp_inner);
  18214. return this.zpp_inner.fluidProperties.wrapper()
  18215. },
  18216. set_filter: function (a) {
  18217. this.zpp_inner.immutable_midstep("Shape::filter");
  18218. if (null == a) throw "Error: Cannot assign null as Shape filter";
  18219. this.zpp_inner.setFilter(a.zpp_inner);
  18220. return this.zpp_inner.filter.wrapper()
  18221. },
  18222. get_filter: function () {
  18223. return this.zpp_inner.filter.wrapper()
  18224. },
  18225. set_material: function (a) {
  18226. this.zpp_inner.immutable_midstep("Shape::material");
  18227. if (null == a) throw "Error: Cannot assign null as Shape material";
  18228. this.zpp_inner.setMaterial(a.zpp_inner);
  18229. return this.zpp_inner.material.wrapper()
  18230. },
  18231. get_material: function () {
  18232. return this.zpp_inner.material.wrapper()
  18233. },
  18234. get_angDrag: function () {
  18235. this.zpp_inner.validate_angDrag();
  18236. return this.zpp_inner.angDrag
  18237. },
  18238. get_inertia: function () {
  18239. this.zpp_inner.validate_area_inertia();
  18240. return this.zpp_inner.inertia
  18241. },
  18242. get_area: function () {
  18243. this.zpp_inner.validate_area_inertia();
  18244. return this.zpp_inner.area
  18245. },
  18246. set_localCOM: function (a) {
  18247. this.zpp_inner.immutable_midstep("Body::localCOM");
  18248. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18249. if (null != this.zpp_inner.body && null != this.zpp_inner.body.space && this.zpp_inner.body.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: Cannot modify Shape belonging to a static Object once inside a Space";
  18250. if (null == a) throw "Error: Shape::localCOM cannot be null";
  18251. null == this.zpp_inner.wrap_localCOM && (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.setupLocalCOM() : this.zpp_inner.polygon.setupLocalCOM());
  18252. this.zpp_inner.wrap_localCOM.set(a);
  18253. null == this.zpp_inner.wrap_localCOM &&
  18254. (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.setupLocalCOM() : this.zpp_inner.polygon.setupLocalCOM());
  18255. return this.zpp_inner.wrap_localCOM
  18256. },
  18257. get_localCOM: function () {
  18258. null == this.zpp_inner.wrap_localCOM && (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.setupLocalCOM() : this.zpp_inner.polygon.setupLocalCOM());
  18259. return this.zpp_inner.wrap_localCOM
  18260. },
  18261. get_worldCOM: function () {
  18262. null == this.zpp_inner.wrap_worldCOM && (this.zpp_inner.wrap_worldCOM = h.geom.Vec2.get(this.zpp_inner.worldCOMx,
  18263. this.zpp_inner.worldCOMy, null), this.zpp_inner.wrap_worldCOM.zpp_inner._inuse = !0, this.zpp_inner.wrap_worldCOM.zpp_inner._immutable = !0, this.zpp_inner.wrap_worldCOM.zpp_inner._validate = (da = this.zpp_inner, A(da, da.getworldCOM)));
  18264. return this.zpp_inner.wrap_worldCOM
  18265. },
  18266. get_castPolygon: function () {
  18267. return this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? this.zpp_inner.polygon.outer_zn : null
  18268. },
  18269. get_castCircle: function () {
  18270. return this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.outer_zn :
  18271. null
  18272. },
  18273. set_body: function (a) {
  18274. this.zpp_inner.immutable_midstep("Shape::body");
  18275. (null != this.zpp_inner.body ? this.zpp_inner.body.outer : null) != a && (null != this.zpp_inner.body && (null != this.zpp_inner.body ? this.zpp_inner.body.outer : null).zpp_inner.wrap_shapes.remove(this), null != a && a.zpp_inner.wrap_shapes.add(this));
  18276. return null != this.zpp_inner.body ? this.zpp_inner.body.outer : null
  18277. },
  18278. get_body: function () {
  18279. return null != this.zpp_inner.body ? this.zpp_inner.body.outer : null
  18280. },
  18281. isPolygon: function () {
  18282. return this.zpp_inner.type ==
  18283. c.util.ZPP_Flags.id_ShapeType_POLYGON
  18284. },
  18285. isCircle: function () {
  18286. return this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE
  18287. },
  18288. get_type: function () {
  18289. return c.shape.ZPP_Shape.types[this.zpp_inner.type]
  18290. },
  18291. __class__: h.shape.Shape
  18292. });
  18293. h.shape.Circle = function (a, b, d, g) {
  18294. this.zpp_inner_zn = null;
  18295. try {
  18296. h.shape.Shape.call(this)
  18297. } catch (e) {}
  18298. this.zpp_inner_zn = new c.shape.ZPP_Circle;
  18299. this.zpp_inner_zn.outer = this;
  18300. this.zpp_inner_zn.outer_zn = this;
  18301. this.zpp_inner_i = this.zpp_inner = this.zpp_inner_zn;
  18302. this.zpp_inner_i.outer_i = this;
  18303. this.zpp_inner.immutable_midstep("Circle::radius");
  18304. if (null != this.zpp_inner.body && this.zpp_inner.body.type == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.zpp_inner.body.space) throw "Error: Cannot modifiy radius of Circle contained in static object once added to space";
  18305. if (a != this.zpp_inner_zn.radius) {
  18306. if (a != a) throw "Error: Circle::radius cannot be NaN";
  18307. if (a < h.Config.epsilon) throw "Error: Circle::radius (" + a + ") must be > Config.epsilon";
  18308. if (1E100 < a) throw "Error: Circle::radius (" + a + ") must be < PR(Const).FMAX";
  18309. this.zpp_inner_zn.radius = a;
  18310. this.zpp_inner_zn.invalidate_radius()
  18311. }
  18312. this.zpp_inner_zn.radius;
  18313. if (null == b) this.zpp_inner.localCOMx = 0, this.zpp_inner.localCOMy = 0;
  18314. else {
  18315. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18316. a = this.zpp_inner;
  18317. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18318. b.zpp_inner.validate();
  18319. a.localCOMx = b.zpp_inner.x;
  18320. a = this.zpp_inner;
  18321. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18322. b.zpp_inner.validate();
  18323. a.localCOMy = b.zpp_inner.y;
  18324. b.zpp_inner.weak ? (b.dispose(), !0) : !1
  18325. } if (null == d) null == c.phys.ZPP_Material.zpp_pool ? this.zpp_inner.material = new c.phys.ZPP_Material : (this.zpp_inner.material = c.phys.ZPP_Material.zpp_pool, c.phys.ZPP_Material.zpp_pool = this.zpp_inner.material.next, this.zpp_inner.material.next = null), null;
  18326. else {
  18327. this.zpp_inner.immutable_midstep("Shape::material");
  18328. if (null == d) throw "Error: Cannot assign null as Shape material";
  18329. this.zpp_inner.setMaterial(d.zpp_inner);
  18330. this.zpp_inner.material.wrapper()
  18331. } if (null ==
  18332. g) null == c.dynamics.ZPP_InteractionFilter.zpp_pool ? this.zpp_inner.filter = new c.dynamics.ZPP_InteractionFilter : (this.zpp_inner.filter = c.dynamics.ZPP_InteractionFilter.zpp_pool, c.dynamics.ZPP_InteractionFilter.zpp_pool = this.zpp_inner.filter.next, this.zpp_inner.filter.next = null), null;
  18333. else {
  18334. this.zpp_inner.immutable_midstep("Shape::filter");
  18335. if (null == g) throw "Error: Cannot assign null as Shape filter";
  18336. this.zpp_inner.setFilter(g.zpp_inner);
  18337. this.zpp_inner.filter.wrapper()
  18338. }
  18339. this.zpp_inner_i.insert_cbtype(c.callbacks.ZPP_CbType.ANY_SHAPE.zpp_inner)
  18340. };
  18341. s["nape.shape.Circle"] = h.shape.Circle;
  18342. h.shape.Circle.__name__ = ["nape", "shape", "Circle"];
  18343. h.shape.Circle.__super__ = h.shape.Shape;
  18344. h.shape.Circle.prototype = I(h.shape.Shape.prototype, {
  18345. set_radius: function (a) {
  18346. this.zpp_inner.immutable_midstep("Circle::radius");
  18347. if (null != this.zpp_inner.body && this.zpp_inner.body.type == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.zpp_inner.body.space) throw "Error: Cannot modifiy radius of Circle contained in static object once added to space";
  18348. if (a != this.zpp_inner_zn.radius) {
  18349. if (a !=
  18350. a) throw "Error: Circle::radius cannot be NaN";
  18351. if (a < h.Config.epsilon) throw "Error: Circle::radius (" + a + ") must be > Config.epsilon";
  18352. if (1E100 < a) throw "Error: Circle::radius (" + a + ") must be < PR(Const).FMAX";
  18353. this.zpp_inner_zn.radius = a;
  18354. this.zpp_inner_zn.invalidate_radius()
  18355. }
  18356. return this.zpp_inner_zn.radius
  18357. },
  18358. get_radius: function () {
  18359. return this.zpp_inner_zn.radius
  18360. },
  18361. __class__: h.shape.Circle
  18362. });
  18363. h.shape.Edge = function () {
  18364. this.zpp_inner = null;
  18365. if (!c.shape.ZPP_Edge.internal) throw "Error: Cannot instantiate an Edge derp!";
  18366. };
  18367. s["nape.shape.Edge"] = h.shape.Edge;
  18368. h.shape.Edge.__name__ = ["nape", "shape", "Edge"];
  18369. h.shape.Edge.prototype = {
  18370. toString: function () {
  18371. if (null == this.zpp_inner.polygon) return "Edge(object-pooled)";
  18372. if (null == this.zpp_inner.polygon.body) return this.zpp_inner.polygon.validate_laxi(), "{ localNormal : " + ("{ x: " + this.zpp_inner.lnormx + " y: " + this.zpp_inner.lnormy + " }") + " }";
  18373. this.zpp_inner.polygon.validate_gaxi();
  18374. return "{ localNormal : " + ("{ x: " + this.zpp_inner.lnormx + " y: " + this.zpp_inner.lnormy + " }") + " worldNormal : " +
  18375. ("{ x: " + this.zpp_inner.gnormx + " y: " + this.zpp_inner.gnormy + " }") + " }"
  18376. },
  18377. get_worldVertex2: function () {
  18378. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18379. this.zpp_inner.polygon.validate_gaxi();
  18380. return this.zpp_inner.gp1.wrapper()
  18381. },
  18382. get_worldVertex1: function () {
  18383. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18384. this.zpp_inner.polygon.validate_gaxi();
  18385. return this.zpp_inner.gp0.wrapper()
  18386. },
  18387. get_localVertex2: function () {
  18388. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18389. this.zpp_inner.polygon.validate_laxi();
  18390. return this.zpp_inner.lp1.wrapper()
  18391. },
  18392. get_localVertex1: function () {
  18393. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18394. this.zpp_inner.polygon.validate_laxi();
  18395. return this.zpp_inner.lp0.wrapper()
  18396. },
  18397. get_worldProjection: function () {
  18398. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18399. if (null == this.zpp_inner.polygon.body) throw "Error: Edge world projection only makes sense for Polygons contained within a rigid body";
  18400. this.zpp_inner.polygon.validate_gaxi();
  18401. return this.zpp_inner.gprojection
  18402. },
  18403. get_localProjection: function () {
  18404. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18405. this.zpp_inner.polygon.validate_laxi();
  18406. return this.zpp_inner.lprojection
  18407. },
  18408. get_length: function () {
  18409. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18410. this.zpp_inner.polygon.validate_laxi();
  18411. return this.zpp_inner.length
  18412. },
  18413. get_worldNormal: function () {
  18414. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18415. null == this.zpp_inner.wrap_gnorm &&
  18416. this.zpp_inner.getgnorm();
  18417. return this.zpp_inner.wrap_gnorm
  18418. },
  18419. get_localNormal: function () {
  18420. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18421. null == this.zpp_inner.wrap_lnorm && this.zpp_inner.getlnorm();
  18422. return this.zpp_inner.wrap_lnorm
  18423. },
  18424. get_polygon: function () {
  18425. if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
  18426. return this.zpp_inner.polygon.outer_zn
  18427. },
  18428. __class__: h.shape.Edge
  18429. };
  18430. h.shape.EdgeIterator = function () {
  18431. this.zpp_next = null;
  18432. this.zpp_critical = !1;
  18433. this.zpp_i = 0;
  18434. this.zpp_inner =
  18435. null;
  18436. if (!c.util.ZPP_EdgeList.internal) throw "Error: Cannot instantiate EdgeIterator derp!";
  18437. };
  18438. s["nape.shape.EdgeIterator"] = h.shape.EdgeIterator;
  18439. h.shape.EdgeIterator.__name__ = ["nape", "shape", "EdgeIterator"];
  18440. h.shape.EdgeIterator.get = function (a) {
  18441. var b = null == h.shape.EdgeIterator.zpp_pool ? function (a) {
  18442. c.util.ZPP_EdgeList.internal = !0;
  18443. a = new h.shape.EdgeIterator;
  18444. c.util.ZPP_EdgeList.internal = !1;
  18445. return a
  18446. }(this) : function (a) {
  18447. a = h.shape.EdgeIterator.zpp_pool;
  18448. h.shape.EdgeIterator.zpp_pool = a.zpp_next;
  18449. return a
  18450. }(this);
  18451. b.zpp_i = 0;
  18452. b.zpp_inner = a;
  18453. b.zpp_critical = !1;
  18454. return b
  18455. };
  18456. h.shape.EdgeIterator.prototype = {
  18457. next: function () {
  18458. this.zpp_critical = !1;
  18459. return this.zpp_inner.at(this.zpp_i++)
  18460. },
  18461. hasNext: function () {
  18462. this.zpp_inner.zpp_inner.valmod();
  18463. var a = this.zpp_inner.get_length();
  18464. this.zpp_critical = !0;
  18465. if (this.zpp_i < a) return !0;
  18466. this.zpp_next = h.shape.EdgeIterator.zpp_pool;
  18467. h.shape.EdgeIterator.zpp_pool = this;
  18468. this.zpp_inner = null;
  18469. return !1
  18470. },
  18471. __class__: h.shape.EdgeIterator
  18472. };
  18473. h.shape.EdgeList = function () {
  18474. this.zpp_inner = null;
  18475. this.zpp_inner = new c.util.ZPP_EdgeList;
  18476. this.zpp_inner.outer = this
  18477. };
  18478. s["nape.shape.EdgeList"] = h.shape.EdgeList;
  18479. h.shape.EdgeList.__name__ = ["nape", "shape", "EdgeList"];
  18480. h.shape.EdgeList.fromArray = function (a) {
  18481. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  18482. for (var b = new h.shape.EdgeList, d = 0; d < a.length;) {
  18483. var c = a[d];
  18484. ++d;
  18485. b.push(c)
  18486. }
  18487. return b
  18488. };
  18489. h.shape.EdgeList.prototype = {
  18490. filter: function (a) {
  18491. if (null == a) throw "Error: Cannot select elements of list with null";
  18492. for (var b = 0; b < this.get_length();) {
  18493. var d = this.at(b);
  18494. try {
  18495. a(d) ? b++ : this.remove(d)
  18496. } catch (c) {
  18497. break
  18498. }
  18499. }
  18500. return this
  18501. },
  18502. foreach: function (a) {
  18503. if (null == a) throw "Error: Cannot execute null on list elements";
  18504. var b;
  18505. this.zpp_inner.valmod();
  18506. for (b = h.shape.EdgeIterator.get(this); b.hasNext();) try {
  18507. var d = a,
  18508. c;
  18509. b.zpp_critical = !1;
  18510. c = b.zpp_inner.at(b.zpp_i++);
  18511. d(c)
  18512. } catch (e) {
  18513. b.zpp_next = h.shape.EdgeIterator.zpp_pool;
  18514. h.shape.EdgeIterator.zpp_pool = b;
  18515. b.zpp_inner = null;
  18516. break
  18517. }
  18518. return this
  18519. },
  18520. toString: function () {
  18521. var a = "[",
  18522. b = !0,
  18523. d;
  18524. this.zpp_inner.valmod();
  18525. for (d = h.shape.EdgeIterator.get(this); d.hasNext();) {
  18526. var c = d.next();
  18527. b || (a += ",");
  18528. a += null == c ? "NULL" :
  18529. c.toString();
  18530. b = !1
  18531. }
  18532. return a + "]"
  18533. },
  18534. merge: function (a) {
  18535. if (null == a) throw "Error: Cannot merge with null list";
  18536. a.zpp_inner.valmod();
  18537. for (a = h.shape.EdgeIterator.get(a); a.hasNext();) {
  18538. var b = a.next();
  18539. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  18540. }
  18541. },
  18542. copy: function (a) {
  18543. null == a && (a = !1);
  18544. var b = new h.shape.EdgeList,
  18545. d;
  18546. this.zpp_inner.valmod();
  18547. for (d = h.shape.EdgeIterator.get(this); d.hasNext();) {
  18548. var c = d.next();
  18549. b.push(a ? function (a) {
  18550. throw "Error: Edge is not a copyable type";
  18551. }(this) : c)
  18552. }
  18553. return b
  18554. },
  18555. iterator: function () {
  18556. this.zpp_inner.valmod();
  18557. return h.shape.EdgeIterator.get(this)
  18558. },
  18559. empty: function () {
  18560. return null == this.zpp_inner.inner.head
  18561. },
  18562. clear: function () {
  18563. if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
  18564. if (this.zpp_inner.reverse_flag)
  18565. for (; null != this.zpp_inner.inner.head;) this.pop();
  18566. else
  18567. for (; null != this.zpp_inner.inner.head;) this.shift()
  18568. },
  18569. remove: function (a) {
  18570. if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
  18571. this.zpp_inner.modify_test();
  18572. this.zpp_inner.valmod();
  18573. var b;
  18574. b = !1;
  18575. for (var d = this.zpp_inner.inner.head; null !=
  18576. d;) {
  18577. if (d.elt == a.zpp_inner) {
  18578. b = !0;
  18579. break
  18580. }
  18581. d = d.next
  18582. }
  18583. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  18584. return b
  18585. },
  18586. add: function (a) {
  18587. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  18588. },
  18589. shift: function () {
  18590. if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
  18591. this.zpp_inner.modify_test();
  18592. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  18593. this.zpp_inner.valmod();
  18594. var a = null;
  18595. if (this.zpp_inner.reverse_flag) {
  18596. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  18597. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  18598. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  18599. d = a.wrapper();
  18600. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  18601. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  18602. } else a = this.zpp_inner.inner.head.elt, d = a.wrapper(), null != this.zpp_inner.subber && this.zpp_inner.subber(d),
  18603. this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  18604. this.zpp_inner.invalidate();
  18605. return d = a.wrapper()
  18606. },
  18607. pop: function () {
  18608. if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
  18609. this.zpp_inner.modify_test();
  18610. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  18611. this.zpp_inner.valmod();
  18612. var a = null;
  18613. if (this.zpp_inner.reverse_flag) {
  18614. var a = this.zpp_inner.inner.head.elt,
  18615. b = a.wrapper();
  18616. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  18617. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  18618. } else {
  18619. null !=
  18620. this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  18621. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  18622. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  18623. b = a.wrapper();
  18624. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  18625. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  18626. }
  18627. this.zpp_inner.invalidate();
  18628. return b = a.wrapper()
  18629. },
  18630. unshift: function (a) {
  18631. if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
  18632. this.zpp_inner.modify_test();
  18633. this.zpp_inner.valmod();
  18634. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  18635. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  18636. return b
  18637. },
  18638. push: function (a) {
  18639. if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
  18640. this.zpp_inner.modify_test();
  18641. this.zpp_inner.valmod();
  18642. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  18643. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  18644. return b
  18645. },
  18646. at: function (a) {
  18647. this.zpp_inner.valmod();
  18648. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  18649. this.zpp_inner.reverse_flag && (a = a == this.get_length() - 1 ? a : this.get_length() - 2 - a);
  18650. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  18651. else
  18652. for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  18653. return this.zpp_inner.at_ite.elt.wrapper()
  18654. },
  18655. has: function (a) {
  18656. this.zpp_inner.valmod();
  18657. return this.zpp_inner.inner.has(a.zpp_inner)
  18658. },
  18659. get_length: function () {
  18660. this.zpp_inner.valmod();
  18661. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  18662. return this.zpp_inner.user_length
  18663. },
  18664. __class__: h.shape.EdgeList
  18665. };
  18666. h.shape.Polygon = function (a, b, d) {
  18667. this.zpp_inner_zn = null;
  18668. try {
  18669. h.shape.Shape.call(this)
  18670. } catch (g) {}
  18671. if (null == a) throw "Error: localVerts cannot be null";
  18672. this.zpp_inner_zn = new c.shape.ZPP_Polygon;
  18673. this.zpp_inner_zn.outer = this;
  18674. this.zpp_inner_zn.outer_zn =
  18675. this;
  18676. this.zpp_inner_i = this.zpp_inner = this.zpp_inner_zn;
  18677. this.zpp_inner_i.outer_i = this;
  18678. if (F.Boot.__instanceof(a, Array))
  18679. for (var e = a, f = 0; f < e.length;) {
  18680. var l = e[f];
  18681. ++f;
  18682. if (null == l) throw "Error: Array<Vec2> contains null objects";
  18683. if (!F.Boot.__instanceof(l, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
  18684. var m = l;
  18685. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18686. null == this.zpp_inner_zn.wrap_lverts && this.zpp_inner_zn.getlverts();
  18687. this.zpp_inner_zn.wrap_lverts.push(function (a) {
  18688. if (null !=
  18689. m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18690. return h.geom.Vec2.get(function (a) {
  18691. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18692. m.zpp_inner.validate();
  18693. return m.zpp_inner.x
  18694. }(a), function (a) {
  18695. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18696. m.zpp_inner.validate();
  18697. return m.zpp_inner.y
  18698. }(a), !1)
  18699. }(this))
  18700. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  18701. for (e = a.iterator(); e.hasNext();) {
  18702. m = e.next();
  18703. if (null == m) throw "Error: Vec2List contains null objects";
  18704. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18705. null == this.zpp_inner_zn.wrap_lverts && this.zpp_inner_zn.getlverts();
  18706. this.zpp_inner_zn.wrap_lverts.push(function (a) {
  18707. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18708. return h.geom.Vec2.get(function (a) {
  18709. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18710. m.zpp_inner.validate();
  18711. return m.zpp_inner.x
  18712. }(a), function (a) {
  18713. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18714. m.zpp_inner.validate();
  18715. return m.zpp_inner.y
  18716. }(a), !1)
  18717. }(this))
  18718. } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
  18719. e = a;
  18720. if (null != e && e.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  18721. e = e.zpp_inner.vertices;
  18722. if (null != e) {
  18723. l = e;
  18724. do m = h.geom.Vec2.get(l.x, l.y, null), l = l.next, null == this.zpp_inner_zn.wrap_lverts && this.zpp_inner_zn.getlverts(), this.zpp_inner_zn.wrap_lverts.push(function (a) {
  18725. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18726. return h.geom.Vec2.get(function (a) {
  18727. if (null !=
  18728. m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18729. m.zpp_inner.validate();
  18730. return m.zpp_inner.x
  18731. }(a), function (a) {
  18732. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  18733. m.zpp_inner.validate();
  18734. return m.zpp_inner.y
  18735. }(a), !1)
  18736. }(this)), m.dispose(); while (l != e)
  18737. }
  18738. } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
  18739. if (F.Boot.__instanceof(a, Array))
  18740. for (e = a, l = 0; l < e.length;) {
  18741. a = e[l];
  18742. if (f = a.zpp_inner.weak) a.dispose(),
  18743. f = !0;
  18744. f ? e.splice(l, 1) : l++
  18745. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  18746. for (e = a, null != e.zpp_inner._validate && e.zpp_inner._validate(), e = e.zpp_inner.inner, l = null, a = e.head; null != a;) m = a.elt, m.outer.zpp_inner.weak ? (a = e.erase(l), m.outer.zpp_inner.weak ? (m.outer.dispose(), !0) : !1) : (l = a, a = a.next);
  18747. if (null == b) null == c.phys.ZPP_Material.zpp_pool ? this.zpp_inner.material = new c.phys.ZPP_Material : (this.zpp_inner.material = c.phys.ZPP_Material.zpp_pool, c.phys.ZPP_Material.zpp_pool = this.zpp_inner.material.next, this.zpp_inner.material.next =
  18748. null), null;
  18749. else {
  18750. this.zpp_inner.immutable_midstep("Shape::material");
  18751. if (null == b) throw "Error: Cannot assign null as Shape material";
  18752. this.zpp_inner.setMaterial(b.zpp_inner);
  18753. this.zpp_inner.material.wrapper()
  18754. } if (null == d) null == c.dynamics.ZPP_InteractionFilter.zpp_pool ? this.zpp_inner.filter = new c.dynamics.ZPP_InteractionFilter : (this.zpp_inner.filter = c.dynamics.ZPP_InteractionFilter.zpp_pool, c.dynamics.ZPP_InteractionFilter.zpp_pool = this.zpp_inner.filter.next, this.zpp_inner.filter.next = null), null;
  18755. else {
  18756. this.zpp_inner.immutable_midstep("Shape::filter");
  18757. if (null == d) throw "Error: Cannot assign null as Shape filter";
  18758. this.zpp_inner.setFilter(d.zpp_inner);
  18759. this.zpp_inner.filter.wrapper()
  18760. }
  18761. this.zpp_inner_i.insert_cbtype(c.callbacks.ZPP_CbType.ANY_SHAPE.zpp_inner)
  18762. };
  18763. s["nape.shape.Polygon"] = h.shape.Polygon;
  18764. h.shape.Polygon.__name__ = ["nape", "shape", "Polygon"];
  18765. h.shape.Polygon.rect = function (a, b, d, c, e) {
  18766. null == e && (e = !1);
  18767. if (a != a || b != b || d != d || c != c) throw "Error: Polygon.rect cannot accept NaN arguments";
  18768. return [h.geom.Vec2.get(a, b, e), h.geom.Vec2.get(a + d, b, e), h.geom.Vec2.get(a +
  18769. d, b + c, e), h.geom.Vec2.get(a, b + c, e)]
  18770. };
  18771. h.shape.Polygon.box = function (a, b, d) {
  18772. null == d && (d = !1);
  18773. if (a != a || b != b) throw "Error: Polygon.box cannot accept NaN arguments";
  18774. return h.shape.Polygon.rect(-a / 2, -b / 2, a, b, d)
  18775. };
  18776. h.shape.Polygon.regular = function (a, b, d, c, e) {
  18777. null == e && (e = !1);
  18778. null == c && (c = 0);
  18779. if (a != a || b != b || c != c) throw "Error: Polygon.regular cannot accept NaN arguments";
  18780. for (var f = [], l = 2 * Math.PI / d, m = 0; m < d;) {
  18781. var u = m++ * l + c,
  18782. u = h.geom.Vec2.get(Math.cos(u) * a, Math.sin(u) * b, e);
  18783. f.push(u)
  18784. }
  18785. return f
  18786. };
  18787. h.shape.Polygon.__super__ =
  18788. h.shape.Shape;
  18789. h.shape.Polygon.prototype = I(h.shape.Shape.prototype, {
  18790. validity: function () {
  18791. return this.zpp_inner_zn.valid()
  18792. },
  18793. get_edges: function () {
  18794. null == this.zpp_inner_zn.wrap_edges && this.zpp_inner_zn.getedges();
  18795. return this.zpp_inner_zn.wrap_edges
  18796. },
  18797. get_worldVerts: function () {
  18798. null == this.zpp_inner_zn.wrap_gverts && this.zpp_inner_zn.getgverts();
  18799. return this.zpp_inner_zn.wrap_gverts
  18800. },
  18801. get_localVerts: function () {
  18802. null == this.zpp_inner_zn.wrap_lverts && this.zpp_inner_zn.getlverts();
  18803. return this.zpp_inner_zn.wrap_lverts
  18804. },
  18805. __class__: h.shape.Polygon
  18806. });
  18807. h.shape.ShapeIterator = function () {
  18808. this.zpp_next = null;
  18809. this.zpp_critical = !1;
  18810. this.zpp_i = 0;
  18811. this.zpp_inner = null;
  18812. if (!c.util.ZPP_ShapeList.internal) throw "Error: Cannot instantiate ShapeIterator derp!";
  18813. };
  18814. s["nape.shape.ShapeIterator"] = h.shape.ShapeIterator;
  18815. h.shape.ShapeIterator.__name__ = ["nape", "shape", "ShapeIterator"];
  18816. h.shape.ShapeIterator.get = function (a) {
  18817. var b = null == h.shape.ShapeIterator.zpp_pool ? function (a) {
  18818. c.util.ZPP_ShapeList.internal = !0;
  18819. a = new h.shape.ShapeIterator;
  18820. c.util.ZPP_ShapeList.internal = !1;
  18821. return a
  18822. }(this) : function (a) {
  18823. a = h.shape.ShapeIterator.zpp_pool;
  18824. h.shape.ShapeIterator.zpp_pool = a.zpp_next;
  18825. return a
  18826. }(this);
  18827. b.zpp_i = 0;
  18828. b.zpp_inner = a;
  18829. b.zpp_critical = !1;
  18830. return b
  18831. };
  18832. h.shape.ShapeIterator.prototype = {
  18833. next: function () {
  18834. this.zpp_critical = !1;
  18835. return this.zpp_inner.at(this.zpp_i++)
  18836. },
  18837. hasNext: function () {
  18838. this.zpp_inner.zpp_inner.valmod();
  18839. var a = this.zpp_inner.get_length();
  18840. this.zpp_critical = !0;
  18841. if (this.zpp_i < a) return !0;
  18842. this.zpp_next = h.shape.ShapeIterator.zpp_pool;
  18843. h.shape.ShapeIterator.zpp_pool = this;
  18844. this.zpp_inner =
  18845. null;
  18846. return !1
  18847. },
  18848. __class__: h.shape.ShapeIterator
  18849. };
  18850. h.shape.ShapeList = function () {
  18851. this.zpp_inner = null;
  18852. this.zpp_inner = new c.util.ZPP_ShapeList;
  18853. this.zpp_inner.outer = this
  18854. };
  18855. s["nape.shape.ShapeList"] = h.shape.ShapeList;
  18856. h.shape.ShapeList.__name__ = ["nape", "shape", "ShapeList"];
  18857. h.shape.ShapeList.fromArray = function (a) {
  18858. if (null == a) throw "Error: Cannot convert null Array to Nape list";
  18859. for (var b = new h.shape.ShapeList, d = 0; d < a.length;) {
  18860. var c = a[d];
  18861. ++d;
  18862. b.push(c)
  18863. }
  18864. return b
  18865. };
  18866. h.shape.ShapeList.prototype = {
  18867. filter: function (a) {
  18868. if (null ==
  18869. a) throw "Error: Cannot select elements of list with null";
  18870. for (var b = 0; b < this.get_length();) {
  18871. var d = this.at(b);
  18872. try {
  18873. a(d) ? b++ : this.remove(d)
  18874. } catch (c) {
  18875. break
  18876. }
  18877. }
  18878. return this
  18879. },
  18880. foreach: function (a) {
  18881. if (null == a) throw "Error: Cannot execute null on list elements";
  18882. var b;
  18883. this.zpp_inner.valmod();
  18884. for (b = h.shape.ShapeIterator.get(this); b.hasNext();) try {
  18885. var d = a,
  18886. c;
  18887. b.zpp_critical = !1;
  18888. c = b.zpp_inner.at(b.zpp_i++);
  18889. d(c)
  18890. } catch (e) {
  18891. b.zpp_next = h.shape.ShapeIterator.zpp_pool;
  18892. h.shape.ShapeIterator.zpp_pool = b;
  18893. b.zpp_inner = null;
  18894. break
  18895. }
  18896. return this
  18897. },
  18898. toString: function () {
  18899. var a = "[",
  18900. b = !0,
  18901. d;
  18902. this.zpp_inner.valmod();
  18903. for (d = h.shape.ShapeIterator.get(this); d.hasNext();) {
  18904. var c = d.next();
  18905. b || (a += ",");
  18906. a += null == c ? "NULL" : c.toString();
  18907. b = !1
  18908. }
  18909. return a + "]"
  18910. },
  18911. merge: function (a) {
  18912. if (null == a) throw "Error: Cannot merge with null list";
  18913. a.zpp_inner.valmod();
  18914. for (a = h.shape.ShapeIterator.get(a); a.hasNext();) {
  18915. var b = a.next();
  18916. this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
  18917. }
  18918. },
  18919. copy: function (a) {
  18920. null == a && (a = !1);
  18921. var b = new h.shape.ShapeList,
  18922. d;
  18923. this.zpp_inner.valmod();
  18924. for (d = h.shape.ShapeIterator.get(this); d.hasNext();) {
  18925. var c = d.next();
  18926. b.push(a ? function (a) {
  18927. throw "Error: Shape is not a copyable type";
  18928. }(this) : c)
  18929. }
  18930. return b
  18931. },
  18932. iterator: function () {
  18933. this.zpp_inner.valmod();
  18934. return h.shape.ShapeIterator.get(this)
  18935. },
  18936. empty: function () {
  18937. return null == this.zpp_inner.inner.head
  18938. },
  18939. clear: function () {
  18940. if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
  18941. if (this.zpp_inner.reverse_flag)
  18942. for (; null != this.zpp_inner.inner.head;) this.pop();
  18943. else
  18944. for (; null != this.zpp_inner.inner.head;) this.shift()
  18945. },
  18946. remove: function (a) {
  18947. if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
  18948. this.zpp_inner.modify_test();
  18949. this.zpp_inner.valmod();
  18950. var b;
  18951. b = !1;
  18952. for (var d = this.zpp_inner.inner.head; null != d;) {
  18953. if (d.elt == a.zpp_inner) {
  18954. b = !0;
  18955. break
  18956. }
  18957. d = d.next
  18958. }
  18959. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.zpp_inner.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  18960. return b
  18961. },
  18962. add: function (a) {
  18963. return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
  18964. },
  18965. shift: function () {
  18966. if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
  18967. this.zpp_inner.modify_test();
  18968. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  18969. this.zpp_inner.valmod();
  18970. var a = null;
  18971. if (this.zpp_inner.reverse_flag) {
  18972. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  18973. var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  18974. a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
  18975. d = a.outer;
  18976. null != this.zpp_inner.subber && this.zpp_inner.subber(d);
  18977. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
  18978. } else a =
  18979. this.zpp_inner.inner.head.elt, d = a.outer, null != this.zpp_inner.subber && this.zpp_inner.subber(d), this.zpp_inner.dontremove || this.zpp_inner.inner.pop();
  18980. this.zpp_inner.invalidate();
  18981. return d = a.outer
  18982. },
  18983. pop: function () {
  18984. if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
  18985. this.zpp_inner.modify_test();
  18986. if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
  18987. this.zpp_inner.valmod();
  18988. var a = null;
  18989. if (this.zpp_inner.reverse_flag) {
  18990. var a = this.zpp_inner.inner.head.elt,
  18991. b = a.outer;
  18992. null !=
  18993. this.zpp_inner.subber && this.zpp_inner.subber(b);
  18994. this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
  18995. } else {
  18996. null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
  18997. var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
  18998. a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
  18999. b = a.outer;
  19000. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  19001. this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
  19002. }
  19003. this.zpp_inner.invalidate();
  19004. return b = a.outer
  19005. },
  19006. unshift: function (a) {
  19007. if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
  19008. this.zpp_inner.modify_test();
  19009. this.zpp_inner.valmod();
  19010. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  19011. b && (this.zpp_inner.reverse_flag ? (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)) : this.zpp_inner.inner.add(a.zpp_inner),
  19012. this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  19013. return b
  19014. },
  19015. push: function (a) {
  19016. if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
  19017. this.zpp_inner.modify_test();
  19018. this.zpp_inner.valmod();
  19019. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  19020. b && (this.zpp_inner.reverse_flag ? this.zpp_inner.inner.add(a.zpp_inner) : (null == this.zpp_inner.push_ite && (this.zpp_inner.push_ite = null == this.zpp_inner.inner.head ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
  19021. 1)), this.zpp_inner.push_ite = this.zpp_inner.inner.insert(this.zpp_inner.push_ite, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
  19022. return b
  19023. },
  19024. at: function (a) {
  19025. this.zpp_inner.valmod();
  19026. if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
  19027. this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
  19028. if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite) this.zpp_inner.at_index = a, this.zpp_inner.at_ite = this.zpp_inner.inner.iterator_at(a);
  19029. else
  19030. for (; this.zpp_inner.at_index !=
  19031. a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
  19032. return this.zpp_inner.at_ite.elt.outer
  19033. },
  19034. has: function (a) {
  19035. this.zpp_inner.valmod();
  19036. return this.zpp_inner.inner.has(a.zpp_inner)
  19037. },
  19038. get_length: function () {
  19039. this.zpp_inner.valmod();
  19040. this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
  19041. return this.zpp_inner.user_length
  19042. },
  19043. __class__: h.shape.ShapeList
  19044. };
  19045. h.shape.ShapeType = function () {
  19046. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ShapeType derp!";
  19047. };
  19048. s["nape.shape.ShapeType"] = h.shape.ShapeType;
  19049. h.shape.ShapeType.__name__ = ["nape", "shape", "ShapeType"];
  19050. h.shape.ShapeType.get_CIRCLE = function () {
  19051. null == c.util.ZPP_Flags.ShapeType_CIRCLE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ShapeType_CIRCLE = new h.shape.ShapeType, c.util.ZPP_Flags.internal = !1);
  19052. return c.util.ZPP_Flags.ShapeType_CIRCLE
  19053. };
  19054. h.shape.ShapeType.get_POLYGON = function () {
  19055. null == c.util.ZPP_Flags.ShapeType_POLYGON && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ShapeType_POLYGON = new h.shape.ShapeType,
  19056. c.util.ZPP_Flags.internal = !1);
  19057. return c.util.ZPP_Flags.ShapeType_POLYGON
  19058. };
  19059. h.shape.ShapeType.prototype = {
  19060. toString: function () {
  19061. var a;
  19062. null == c.util.ZPP_Flags.ShapeType_CIRCLE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ShapeType_CIRCLE = new h.shape.ShapeType, c.util.ZPP_Flags.internal = !1);
  19063. this == c.util.ZPP_Flags.ShapeType_CIRCLE ? a = "CIRCLE" : (null == c.util.ZPP_Flags.ShapeType_POLYGON && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ShapeType_POLYGON = new h.shape.ShapeType, c.util.ZPP_Flags.internal = !1), a = this ==
  19064. c.util.ZPP_Flags.ShapeType_POLYGON ? "POLYGON" : "");
  19065. return a
  19066. },
  19067. __class__: h.shape.ShapeType
  19068. };
  19069. h.shape.ValidationResult = function () {
  19070. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ValidationResult derp!";
  19071. };
  19072. s["nape.shape.ValidationResult"] = h.shape.ValidationResult;
  19073. h.shape.ValidationResult.__name__ = ["nape", "shape", "ValidationResult"];
  19074. h.shape.ValidationResult.get_VALID = function () {
  19075. null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID =
  19076. new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  19077. return c.util.ZPP_Flags.ValidationResult_VALID
  19078. };
  19079. h.shape.ValidationResult.get_DEGENERATE = function () {
  19080. null == c.util.ZPP_Flags.ValidationResult_DEGENERATE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_DEGENERATE = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  19081. return c.util.ZPP_Flags.ValidationResult_DEGENERATE
  19082. };
  19083. h.shape.ValidationResult.get_CONCAVE = function () {
  19084. null == c.util.ZPP_Flags.ValidationResult_CONCAVE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_CONCAVE = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  19085. return c.util.ZPP_Flags.ValidationResult_CONCAVE
  19086. };
  19087. h.shape.ValidationResult.get_SELF_INTERSECTING = function () {
  19088. null == c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  19089. return c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING
  19090. };
  19091. h.shape.ValidationResult.prototype = {
  19092. toString: function () {
  19093. null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  19094. var a;
  19095. this == c.util.ZPP_Flags.ValidationResult_VALID ? a = "VALID" : (null == c.util.ZPP_Flags.ValidationResult_DEGENERATE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_DEGENERATE = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.ValidationResult_DEGENERATE ? a = "DEGENERATE" :
  19096. (null == c.util.ZPP_Flags.ValidationResult_CONCAVE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_CONCAVE = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1), this == c.util.ZPP_Flags.ValidationResult_CONCAVE ? a = "CONCAVE" : (null == c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING ?
  19097. "SELF_INTERSECTING" : "")));
  19098. return a
  19099. },
  19100. __class__: h.shape.ValidationResult
  19101. };
  19102. h.space = {};
  19103. h.space.Broadphase = function () {
  19104. if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate Broadphase derp!";
  19105. };
  19106. s["nape.space.Broadphase"] = h.space.Broadphase;
  19107. h.space.Broadphase.__name__ = ["nape", "space", "Broadphase"];
  19108. h.space.Broadphase.get_DYNAMIC_AABB_TREE = function () {
  19109. null == c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE = new h.space.Broadphase,
  19110. c.util.ZPP_Flags.internal = !1);
  19111. return c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE
  19112. };
  19113. h.space.Broadphase.get_SWEEP_AND_PRUNE = function () {
  19114. null == c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE = new h.space.Broadphase, c.util.ZPP_Flags.internal = !1);
  19115. return c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE
  19116. };
  19117. h.space.Broadphase.prototype = {
  19118. toString: function () {
  19119. null == c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE =
  19120. new h.space.Broadphase, c.util.ZPP_Flags.internal = !1);
  19121. var a;
  19122. this == c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE ? a = "DYNAMIC_AABB_TREE" : (null == c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE = new h.space.Broadphase, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE ? "SWEEP_AND_PRUNE" : "");
  19123. return a
  19124. },
  19125. __class__: h.space.Broadphase
  19126. };
  19127. h.space.Space = function (a, b) {
  19128. this.zpp_inner = null;
  19129. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19130. this.zpp_inner = new c.space.ZPP_Space(null == a ? null : a.zpp_inner, b);
  19131. this.zpp_inner.outer = this;
  19132. null != a && (a.zpp_inner.weak ? (a.dispose(), !0) : !1)
  19133. };
  19134. s["nape.space.Space"] = h.space.Space;
  19135. h.space.Space.__name__ = ["nape", "space", "Space"];
  19136. h.space.Space.prototype = {
  19137. rayMultiCast: function (a, b, d, c) {
  19138. null == b && (b = !1);
  19139. if (null == a) throw "Error: Cannot cast null ray :)";
  19140. return this.zpp_inner.rayMultiCast(a, b, d, c)
  19141. },
  19142. rayCast: function (a, b, d) {
  19143. null == b && (b = !1);
  19144. if (null == a) throw "Error: Cannot cast null ray :)";
  19145. return this.zpp_inner.rayCast(a,
  19146. b, d)
  19147. },
  19148. convexMultiCast: function (a, b, d, c, e) {
  19149. null == d && (d = !1);
  19150. if (null == a) throw "Error: Cannot cast null shape :)";
  19151. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null)) throw "Error: Shape must belong to a body to be cast.";
  19152. if (0 > b || b != b) throw "Error: deltaTime must be positive";
  19153. return this.zpp_inner.convexMultiCast(a.zpp_inner, b, c, d, e)
  19154. },
  19155. convexCast: function (a, b, d, c) {
  19156. null == d && (d = !1);
  19157. if (null == a) throw "Error: Cannot cast null shape :)";
  19158. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null)) throw "Error: Shape must belong to a body to be cast.";
  19159. if (0 > b || b != b) throw "Error: deltaTime must be positive";
  19160. return this.zpp_inner.convexCast(a.zpp_inner, b, c, d)
  19161. },
  19162. bodiesInBody: function (a, b, d) {
  19163. if (null == a) throw "Error: Cannot evaluate shapes in null body";
  19164. d = null == d ? new h.phys.BodyList : d;
  19165. for (a = a.zpp_inner.wrap_shapes.iterator(); a.hasNext();) {
  19166. var c = a.next();
  19167. this.bodiesInShape(c, !1, b, d)
  19168. }
  19169. return d
  19170. },
  19171. shapesInBody: function (a, b, d) {
  19172. if (null == a) throw "Error: Cannot evaluate shapes in null body";
  19173. d = null == d ? new h.shape.ShapeList : d;
  19174. for (a = a.zpp_inner.wrap_shapes.iterator(); a.hasNext();) {
  19175. var c =
  19176. a.next();
  19177. this.shapesInShape(c, !1, b, d)
  19178. }
  19179. return d
  19180. },
  19181. bodiesInShape: function (a, b, d, g) {
  19182. null == b && (b = !1);
  19183. if (null == a) throw "Error: Cannot evaluate bodies in a null shapes :)";
  19184. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null)) throw "Error: Query shape needs to be inside a Body to be well defined :)";
  19185. if (a.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
  19186. var e = a.zpp_inner.polygon.valid();
  19187. null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID =
  19188. new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  19189. if (e != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Polygon query shape is invalid : " + e.toString();
  19190. }
  19191. return this.zpp_inner.bodiesInShape(a.zpp_inner, b, null == d ? null : d.zpp_inner, g)
  19192. },
  19193. shapesInShape: function (a, b, d, g) {
  19194. null == b && (b = !1);
  19195. if (null == a) throw "Error: Cannot evaluate shapes in a null shapes :)";
  19196. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null)) throw "Error: Query shape needs to be inside a Body to be well defined :)";
  19197. if (a.zpp_inner.type ==
  19198. c.util.ZPP_Flags.id_ShapeType_POLYGON) {
  19199. var e = a.zpp_inner.polygon.valid();
  19200. null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  19201. if (e != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Polygon query shape is invalid : " + e.toString();
  19202. }
  19203. return this.zpp_inner.shapesInShape(a.zpp_inner, b, null == d ? null : d.zpp_inner, g)
  19204. },
  19205. bodiesInCircle: function (a, b, d, c, e) {
  19206. null == d && (d = !1);
  19207. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19208. if (null == a) throw "Error: Cannot evaluate objects at null circle :)";
  19209. if (b != b) throw "Error: Circle radius cannot be NaN";
  19210. if (0 >= b) throw "Error: Circle radius must be strictly positive";
  19211. b = this.zpp_inner.bodiesInCircle(a, b, d, null == c ? null : c.zpp_inner, e);
  19212. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  19213. return b
  19214. },
  19215. shapesInCircle: function (a, b, d, c, e) {
  19216. null == d && (d = !1);
  19217. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19218. if (null == a) throw "Error: Cannot evaluate shapes at null circle :)";
  19219. if (b != b) throw "Error: Circle radius cannot be NaN";
  19220. if (0 >= b) throw "Error: Circle radius must be strictly positive";
  19221. b = this.zpp_inner.shapesInCircle(a, b, d, null == c ? null : c.zpp_inner, e);
  19222. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  19223. return b
  19224. },
  19225. bodiesInAABB: function (a, b, d, c, e) {
  19226. null == d && (d = !0);
  19227. null == b && (b = !1);
  19228. if (null == a) throw "Error: Cannot evaluate objects in a null AABB :)";
  19229. var f;
  19230. a.zpp_inner.validate();
  19231. (f = 0 == a.zpp_inner.width()) || (a.zpp_inner.validate(), f = 0 == a.zpp_inner.height());
  19232. if (f) throw "Error: Cannot evaluate objects in degenerate AABB :/";
  19233. return this.zpp_inner.bodiesInAABB(a,
  19234. d, b, null == c ? null : c.zpp_inner, e)
  19235. },
  19236. shapesInAABB: function (a, b, d, c, e) {
  19237. null == d && (d = !0);
  19238. null == b && (b = !1);
  19239. if (null == a) throw "Error: Cannot evaluate shapes in a null AABB :)";
  19240. var f;
  19241. a.zpp_inner.validate();
  19242. (f = 0 == a.zpp_inner.width()) || (a.zpp_inner.validate(), f = 0 == a.zpp_inner.height());
  19243. if (f) throw "Error: Cannot evaluate shapes in degenerate AABB :/";
  19244. return this.zpp_inner.shapesInAABB(a, d, b, null == c ? null : c.zpp_inner, e)
  19245. },
  19246. bodiesUnderPoint: function (a, b, d) {
  19247. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19248. if (null == a) throw "Error: Cannot evaluate objects under a null point :)";
  19249. b = this.zpp_inner.bodiesUnderPoint(function (b) {
  19250. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19251. a.zpp_inner.validate();
  19252. return a.zpp_inner.x
  19253. }(this), function (b) {
  19254. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19255. a.zpp_inner.validate();
  19256. return a.zpp_inner.y
  19257. }(this), null == b ? null : b.zpp_inner, d);
  19258. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  19259. return b
  19260. },
  19261. shapesUnderPoint: function (a, b, d) {
  19262. if (null !=
  19263. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19264. if (null == a) throw "Error: Cannot evaluate shapes under a null point :)";
  19265. b = this.zpp_inner.shapesUnderPoint(function (b) {
  19266. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19267. a.zpp_inner.validate();
  19268. return a.zpp_inner.x
  19269. }(this), function (b) {
  19270. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19271. a.zpp_inner.validate();
  19272. return a.zpp_inner.y
  19273. }(this), null == b ? null : b.zpp_inner, d);
  19274. a.zpp_inner.weak ?
  19275. (a.dispose(), !0) : !1;
  19276. return b
  19277. },
  19278. interactionType: function (a, b) {
  19279. if (null == a || null == b) throw "Error: Cannot evaluate interaction type for null shapes";
  19280. if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null) || null == (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null)) throw "Error: Cannot evaluate interaction type for shapes not part of a Body";
  19281. if ((null != a.zpp_inner.body ? a.zpp_inner.body.outer : null).zpp_inner.type == c.util.ZPP_Flags.id_BodyType_STATIC && (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null).zpp_inner.type ==
  19282. c.util.ZPP_Flags.id_BodyType_STATIC || (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null) == (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null)) return null;
  19283. var d = a.zpp_inner,
  19284. g = b.zpp_inner;
  19285. switch (this.zpp_inner.interactionType(d, g, d.body, g.body)) {
  19286. case 0:
  19287. null == c.util.ZPP_Flags.InteractionType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_FLUID = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1);
  19288. d = c.util.ZPP_Flags.InteractionType_FLUID;
  19289. break;
  19290. case 1:
  19291. null == c.util.ZPP_Flags.InteractionType_COLLISION &&
  19292. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_COLLISION = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1);
  19293. d = c.util.ZPP_Flags.InteractionType_COLLISION;
  19294. break;
  19295. case 2:
  19296. null == c.util.ZPP_Flags.InteractionType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.InteractionType_SENSOR = new h.callbacks.InteractionType, c.util.ZPP_Flags.internal = !1);
  19297. d = c.util.ZPP_Flags.InteractionType_SENSOR;
  19298. break;
  19299. default:
  19300. d = null
  19301. }
  19302. return d
  19303. },
  19304. get_elapsedTime: function () {
  19305. return this.zpp_inner.time
  19306. },
  19307. get_timeStamp: function () {
  19308. return this.zpp_inner.stamp
  19309. },
  19310. step: function (a, b, d) {
  19311. null == d && (d = 10);
  19312. null == b && (b = 10);
  19313. if (a != a) throw "Error: deltaTime cannot be NaN";
  19314. if (0 >= a) throw "Error: deltaTime must be strictly positive";
  19315. if (0 >= b) throw "Error: must use atleast one velocity iteration";
  19316. if (0 >= d) throw "Error: must use atleast one position iteration";
  19317. this.zpp_inner.step(a, b, d)
  19318. },
  19319. clear: function () {
  19320. if (this.zpp_inner.midstep) throw "Error: Space::clear() cannot be called during space step()";
  19321. this.zpp_inner.clear()
  19322. },
  19323. get_listeners: function () {
  19324. return this.zpp_inner.wrap_listeners
  19325. },
  19326. get_arbiters: function () {
  19327. if (null == this.zpp_inner.wrap_arbiters) {
  19328. var a = new c.dynamics.ZPP_SpaceArbiterList;
  19329. a.space = this.zpp_inner;
  19330. this.zpp_inner.wrap_arbiters = a
  19331. }
  19332. return this.zpp_inner.wrap_arbiters
  19333. },
  19334. get_world: function () {
  19335. return this.zpp_inner.__static
  19336. },
  19337. visitCompounds: function (a) {
  19338. if (null == a) throw "Error: lambda cannot be null for Space::visitCompounds";
  19339. for (var b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) {
  19340. var d = b.next();
  19341. a(d);
  19342. d.visitCompounds(a)
  19343. }
  19344. },
  19345. visitConstraints: function (a) {
  19346. if (null == a) throw "Error: lambda cannot be null for Space::visitConstraints";
  19347. for (var b = this.zpp_inner.wrap_constraints.iterator(); b.hasNext();) {
  19348. var d = b.next();
  19349. a(d)
  19350. }
  19351. for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) d = b.next(), d.visitConstraints(a)
  19352. },
  19353. visitBodies: function (a) {
  19354. if (null == a) throw "Error: lambda cannot be null for Space::visitBodies";
  19355. for (var b = this.zpp_inner.wrap_bodies.iterator(); b.hasNext();) {
  19356. var d = b.next();
  19357. a(d)
  19358. }
  19359. for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) b.next().visitBodies(a)
  19360. },
  19361. get_liveConstraints: function () {
  19362. return this.zpp_inner.wrap_livecon
  19363. },
  19364. get_constraints: function () {
  19365. return this.zpp_inner.wrap_constraints
  19366. },
  19367. get_liveBodies: function () {
  19368. return this.zpp_inner.wrap_live
  19369. },
  19370. get_bodies: function () {
  19371. return this.zpp_inner.wrap_bodies
  19372. },
  19373. get_compounds: function () {
  19374. return this.zpp_inner.wrap_compounds
  19375. },
  19376. set_worldLinearDrag: function (a) {
  19377. if (a != a) throw "Error: Space::worldLinearDrag cannot be NaN";
  19378. this.zpp_inner.global_lin_drag = a;
  19379. return this.zpp_inner.global_lin_drag
  19380. },
  19381. get_worldLinearDrag: function () {
  19382. return this.zpp_inner.global_lin_drag
  19383. },
  19384. set_worldAngularDrag: function (a) {
  19385. if (a !=
  19386. a) throw "Error: Space::worldAngularDrag cannot be NaN";
  19387. this.zpp_inner.global_ang_drag = a;
  19388. return this.zpp_inner.global_ang_drag
  19389. },
  19390. get_worldAngularDrag: function () {
  19391. return this.zpp_inner.global_ang_drag
  19392. },
  19393. set_sortContacts: function (a) {
  19394. this.zpp_inner.sortcontacts = a;
  19395. return this.zpp_inner.sortcontacts
  19396. },
  19397. get_sortContacts: function () {
  19398. return this.zpp_inner.sortcontacts
  19399. },
  19400. get_broadphase: function () {
  19401. var a;
  19402. this.zpp_inner.bphase.is_sweep ? (null == c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE && (c.util.ZPP_Flags.internal = !0,
  19403. c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE = new h.space.Broadphase, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE) : (null == c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE = new h.space.Broadphase, c.util.ZPP_Flags.internal = !1), a = c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE);
  19404. return a
  19405. },
  19406. set_gravity: function (a) {
  19407. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19408. if (null == a) throw "Error: Space::gravity cannot be null";
  19409. null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
  19410. this.zpp_inner.wrap_gravity.set(a);
  19411. null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
  19412. return this.zpp_inner.wrap_gravity
  19413. },
  19414. get_gravity: function () {
  19415. null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
  19416. return this.zpp_inner.wrap_gravity
  19417. },
  19418. get_userData: function () {
  19419. null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
  19420. return this.zpp_inner.userData
  19421. },
  19422. __class__: h.space.Space
  19423. };
  19424. h.util = {};
  19425. h.util.Debug = function () {
  19426. this.cullingEnabled = !1;
  19427. this.colour = null;
  19428. this.drawCollisionArbiters = this.drawFluidArbiters = this.drawSensorArbiters = this.drawBodies = this.drawBodyDetail = this.drawShapeDetail = this.drawShapeAngleIndicators = this.drawConstraints = !1;
  19429. this.zpp_inner = null;
  19430. if (!c.util.ZPP_Debug.internal) throw "Error: Cannot instantiate Debug derp! Use ShapeDebug, or BitmapDebug on flash10+";
  19431. this.drawSensorArbiters = this.drawFluidArbiters = this.drawCollisionArbiters = !1;
  19432. this.drawShapeAngleIndicators = this.drawBodies = !0;
  19433. this.cullingEnabled = this.drawConstraints =
  19434. this.drawShapeDetail = this.drawBodyDetail = !1;
  19435. this.colour = null
  19436. };
  19437. s["nape.util.Debug"] = h.util.Debug;
  19438. h.util.Debug.__name__ = ["nape", "util", "Debug"];
  19439. h.util.Debug.version = function () {
  19440. return "Nape 2.0.12"
  19441. };
  19442. h.util.Debug.clearObjectPools = function () {
  19443. for (; null != h.constraint.ConstraintIterator.zpp_pool;) {
  19444. var a = h.constraint.ConstraintIterator.zpp_pool.zpp_next;
  19445. h.constraint.ConstraintIterator.zpp_pool.zpp_next = null;
  19446. h.constraint.ConstraintIterator.zpp_pool = a
  19447. }
  19448. for (; null != h.phys.InteractorIterator.zpp_pool;) a = h.phys.InteractorIterator.zpp_pool.zpp_next,
  19449. h.phys.InteractorIterator.zpp_pool.zpp_next = null, h.phys.InteractorIterator.zpp_pool = a;
  19450. for (; null != h.phys.BodyIterator.zpp_pool;) a = h.phys.BodyIterator.zpp_pool.zpp_next, h.phys.BodyIterator.zpp_pool.zpp_next = null, h.phys.BodyIterator.zpp_pool = a;
  19451. for (; null != h.phys.CompoundIterator.zpp_pool;) a = h.phys.CompoundIterator.zpp_pool.zpp_next, h.phys.CompoundIterator.zpp_pool.zpp_next = null, h.phys.CompoundIterator.zpp_pool = a;
  19452. for (; null != h.callbacks.ListenerIterator.zpp_pool;) a = h.callbacks.ListenerIterator.zpp_pool.zpp_next,
  19453. h.callbacks.ListenerIterator.zpp_pool.zpp_next = null, h.callbacks.ListenerIterator.zpp_pool = a;
  19454. for (; null != h.callbacks.CbTypeIterator.zpp_pool;) a = h.callbacks.CbTypeIterator.zpp_pool.zpp_next, h.callbacks.CbTypeIterator.zpp_pool.zpp_next = null, h.callbacks.CbTypeIterator.zpp_pool = a;
  19455. for (; null != h.geom.ConvexResultIterator.zpp_pool;) a = h.geom.ConvexResultIterator.zpp_pool.zpp_next, h.geom.ConvexResultIterator.zpp_pool.zpp_next = null, h.geom.ConvexResultIterator.zpp_pool = a;
  19456. for (; null != h.geom.GeomPolyIterator.zpp_pool;) a =
  19457. h.geom.GeomPolyIterator.zpp_pool.zpp_next, h.geom.GeomPolyIterator.zpp_pool.zpp_next = null, h.geom.GeomPolyIterator.zpp_pool = a;
  19458. for (; null != h.geom.Vec2Iterator.zpp_pool;) a = h.geom.Vec2Iterator.zpp_pool.zpp_next, h.geom.Vec2Iterator.zpp_pool.zpp_next = null, h.geom.Vec2Iterator.zpp_pool = a;
  19459. for (; null != h.geom.RayResultIterator.zpp_pool;) a = h.geom.RayResultIterator.zpp_pool.zpp_next, h.geom.RayResultIterator.zpp_pool.zpp_next = null, h.geom.RayResultIterator.zpp_pool = a;
  19460. for (; null != h.shape.ShapeIterator.zpp_pool;) a = h.shape.ShapeIterator.zpp_pool.zpp_next,
  19461. h.shape.ShapeIterator.zpp_pool.zpp_next = null, h.shape.ShapeIterator.zpp_pool = a;
  19462. for (; null != h.shape.EdgeIterator.zpp_pool;) a = h.shape.EdgeIterator.zpp_pool.zpp_next, h.shape.EdgeIterator.zpp_pool.zpp_next = null, h.shape.EdgeIterator.zpp_pool = a;
  19463. for (; null != h.dynamics.ContactIterator.zpp_pool;) a = h.dynamics.ContactIterator.zpp_pool.zpp_next, h.dynamics.ContactIterator.zpp_pool.zpp_next = null, h.dynamics.ContactIterator.zpp_pool = a;
  19464. for (; null != h.dynamics.ArbiterIterator.zpp_pool;) a = h.dynamics.ArbiterIterator.zpp_pool.zpp_next,
  19465. h.dynamics.ArbiterIterator.zpp_pool.zpp_next = null, h.dynamics.ArbiterIterator.zpp_pool = a;
  19466. for (; null != h.dynamics.InteractionGroupIterator.zpp_pool;) a = h.dynamics.InteractionGroupIterator.zpp_pool.zpp_next, h.dynamics.InteractionGroupIterator.zpp_pool.zpp_next = null, h.dynamics.InteractionGroupIterator.zpp_pool = a;
  19467. for (; null != c.util.ZNPNode_ZPP_CbType.zpp_pool;) a = c.util.ZNPNode_ZPP_CbType.zpp_pool.next, c.util.ZNPNode_ZPP_CbType.zpp_pool.next = null, c.util.ZNPNode_ZPP_CbType.zpp_pool = a;
  19468. for (; null != c.util.ZNPNode_ZPP_CallbackSet.zpp_pool;) a =
  19469. c.util.ZNPNode_ZPP_CallbackSet.zpp_pool.next, c.util.ZNPNode_ZPP_CallbackSet.zpp_pool.next = null, c.util.ZNPNode_ZPP_CallbackSet.zpp_pool = a;
  19470. for (; null != c.phys.ZPP_Material.zpp_pool;) a = c.phys.ZPP_Material.zpp_pool.next, c.phys.ZPP_Material.zpp_pool.next = null, c.phys.ZPP_Material.zpp_pool = a;
  19471. for (; null != c.util.ZNPNode_ZPP_Shape.zpp_pool;) a = c.util.ZNPNode_ZPP_Shape.zpp_pool.next, c.util.ZNPNode_ZPP_Shape.zpp_pool.next = null, c.util.ZNPNode_ZPP_Shape.zpp_pool = a;
  19472. for (; null != c.phys.ZPP_FluidProperties.zpp_pool;) a =
  19473. c.phys.ZPP_FluidProperties.zpp_pool.next, c.phys.ZPP_FluidProperties.zpp_pool.next = null, c.phys.ZPP_FluidProperties.zpp_pool = a;
  19474. for (; null != c.util.ZNPNode_ZPP_Body.zpp_pool;) a = c.util.ZNPNode_ZPP_Body.zpp_pool.next, c.util.ZNPNode_ZPP_Body.zpp_pool.next = null, c.util.ZNPNode_ZPP_Body.zpp_pool = a;
  19475. for (; null != c.util.ZNPNode_ZPP_Constraint.zpp_pool;) a = c.util.ZNPNode_ZPP_Constraint.zpp_pool.next, c.util.ZNPNode_ZPP_Constraint.zpp_pool.next = null, c.util.ZNPNode_ZPP_Constraint.zpp_pool = a;
  19476. for (; null != c.util.ZNPNode_ZPP_Compound.zpp_pool;) a =
  19477. c.util.ZNPNode_ZPP_Compound.zpp_pool.next, c.util.ZNPNode_ZPP_Compound.zpp_pool.next = null, c.util.ZNPNode_ZPP_Compound.zpp_pool = a;
  19478. for (; null != c.callbacks.ZPP_CbSetPair.zpp_pool;) a = c.callbacks.ZPP_CbSetPair.zpp_pool.next, c.callbacks.ZPP_CbSetPair.zpp_pool.next = null, c.callbacks.ZPP_CbSetPair.zpp_pool = a;
  19479. for (; null != c.util.ZNPNode_ZPP_InteractionListener.zpp_pool;) a = c.util.ZNPNode_ZPP_InteractionListener.zpp_pool.next, c.util.ZNPNode_ZPP_InteractionListener.zpp_pool.next = null, c.util.ZNPNode_ZPP_InteractionListener.zpp_pool =
  19480. a;
  19481. for (; null != c.util.ZNPNode_ZPP_CbSet.zpp_pool;) a = c.util.ZNPNode_ZPP_CbSet.zpp_pool.next, c.util.ZNPNode_ZPP_CbSet.zpp_pool.next = null, c.util.ZNPNode_ZPP_CbSet.zpp_pool = a;
  19482. for (; null != c.util.ZNPNode_ZPP_Interactor.zpp_pool;) a = c.util.ZNPNode_ZPP_Interactor.zpp_pool.next, c.util.ZNPNode_ZPP_Interactor.zpp_pool.next = null, c.util.ZNPNode_ZPP_Interactor.zpp_pool = a;
  19483. for (; null != c.util.ZNPNode_ZPP_Arbiter.zpp_pool;) a = c.util.ZNPNode_ZPP_Arbiter.zpp_pool.next, c.util.ZNPNode_ZPP_Arbiter.zpp_pool.next = null, c.util.ZNPNode_ZPP_Arbiter.zpp_pool =
  19484. a;
  19485. for (; null != c.util.ZNPNode_ZPP_BodyListener.zpp_pool;) a = c.util.ZNPNode_ZPP_BodyListener.zpp_pool.next, c.util.ZNPNode_ZPP_BodyListener.zpp_pool.next = null, c.util.ZNPNode_ZPP_BodyListener.zpp_pool = a;
  19486. for (; null != c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool;) a = c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool.next, c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool.next = null, c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool = a;
  19487. for (; null != c.util.ZPP_Set_ZPP_Body.zpp_pool;) a = c.util.ZPP_Set_ZPP_Body.zpp_pool.next,
  19488. c.util.ZPP_Set_ZPP_Body.zpp_pool.next = null, c.util.ZPP_Set_ZPP_Body.zpp_pool = a;
  19489. for (; null != c.callbacks.ZPP_Callback.zpp_pool;) a = c.callbacks.ZPP_Callback.zpp_pool.next, c.callbacks.ZPP_Callback.zpp_pool.next = null, c.callbacks.ZPP_Callback.zpp_pool = a;
  19490. for (; null != c.callbacks.ZPP_CbSet.zpp_pool;) a = c.callbacks.ZPP_CbSet.zpp_pool.next, c.callbacks.ZPP_CbSet.zpp_pool.next = null, c.callbacks.ZPP_CbSet.zpp_pool = a;
  19491. for (; null != c.util.ZNPNode_ZPP_CbSetPair.zpp_pool;) a = c.util.ZNPNode_ZPP_CbSetPair.zpp_pool.next, c.util.ZNPNode_ZPP_CbSetPair.zpp_pool.next =
  19492. null, c.util.ZNPNode_ZPP_CbSetPair.zpp_pool = a;
  19493. for (; null != c.geom.ZPP_GeomVert.zpp_pool;) a = c.geom.ZPP_GeomVert.zpp_pool.next, c.geom.ZPP_GeomVert.zpp_pool.next = null, c.geom.ZPP_GeomVert.zpp_pool = a;
  19494. for (; null != c.geom.ZPP_GeomVertexIterator.zpp_pool;) a = c.geom.ZPP_GeomVertexIterator.zpp_pool.next, c.geom.ZPP_GeomVertexIterator.zpp_pool.next = null, c.geom.ZPP_GeomVertexIterator.zpp_pool = a;
  19495. for (; null != c.geom.ZPP_Mat23.zpp_pool;) a = c.geom.ZPP_Mat23.zpp_pool.next, c.geom.ZPP_Mat23.zpp_pool.next = null, c.geom.ZPP_Mat23.zpp_pool =
  19496. a;
  19497. for (; null != c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool;) a = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool.next, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool.next = null, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = a;
  19498. for (; null != c.geom.ZPP_CutVert.zpp_pool;) a = c.geom.ZPP_CutVert.zpp_pool.next, c.geom.ZPP_CutVert.zpp_pool.next = null, c.geom.ZPP_CutVert.zpp_pool = a;
  19499. for (; null != c.geom.ZPP_CutInt.zpp_pool;) a = c.geom.ZPP_CutInt.zpp_pool.next, c.geom.ZPP_CutInt.zpp_pool.next = null, c.geom.ZPP_CutInt.zpp_pool = a;
  19500. for (; null != c.util.ZNPNode_ZPP_CutInt.zpp_pool;) a =
  19501. c.util.ZNPNode_ZPP_CutInt.zpp_pool.next, c.util.ZNPNode_ZPP_CutInt.zpp_pool.next = null, c.util.ZNPNode_ZPP_CutInt.zpp_pool = a;
  19502. for (; null != c.util.ZNPNode_ZPP_CutVert.zpp_pool;) a = c.util.ZNPNode_ZPP_CutVert.zpp_pool.next, c.util.ZNPNode_ZPP_CutVert.zpp_pool.next = null, c.util.ZNPNode_ZPP_CutVert.zpp_pool = a;
  19503. for (; null != c.geom.ZPP_Vec2.zpp_pool;) a = c.geom.ZPP_Vec2.zpp_pool.next, c.geom.ZPP_Vec2.zpp_pool.next = null, c.geom.ZPP_Vec2.zpp_pool = a;
  19504. for (; null != c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool;) a = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool.next,
  19505. c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool.next = null, c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool = a;
  19506. for (; null != c.geom.ZPP_PartitionVertex.zpp_pool;) a = c.geom.ZPP_PartitionVertex.zpp_pool.next, c.geom.ZPP_PartitionVertex.zpp_pool.next = null, c.geom.ZPP_PartitionVertex.zpp_pool = a;
  19507. for (; null != c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool;) a = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool.next, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool.next = null, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = a;
  19508. for (; null != c.geom.ZPP_PartitionPair.zpp_pool;) a =
  19509. c.geom.ZPP_PartitionPair.zpp_pool.next, c.geom.ZPP_PartitionPair.zpp_pool.next = null, c.geom.ZPP_PartitionPair.zpp_pool = a;
  19510. for (; null != c.geom.ZPP_PartitionedPoly.zpp_pool;) a = c.geom.ZPP_PartitionedPoly.zpp_pool.next, c.geom.ZPP_PartitionedPoly.zpp_pool.next = null, c.geom.ZPP_PartitionedPoly.zpp_pool = a;
  19511. for (; null != c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool;) a = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool.next, c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool.next = null, c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool = a;
  19512. for (; null != c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool;) a = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool.next, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool.next = null, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = a;
  19513. for (; null != c.util.ZNPNode_ZPP_GeomVert.zpp_pool;) a = c.util.ZNPNode_ZPP_GeomVert.zpp_pool.next, c.util.ZNPNode_ZPP_GeomVert.zpp_pool.next = null, c.util.ZNPNode_ZPP_GeomVert.zpp_pool = a;
  19514. for (; null != c.geom.ZPP_SimplifyV.zpp_pool;) a = c.geom.ZPP_SimplifyV.zpp_pool.next, c.geom.ZPP_SimplifyV.zpp_pool.next = null, c.geom.ZPP_SimplifyV.zpp_pool =
  19515. a;
  19516. for (; null != c.geom.ZPP_SimplifyP.zpp_pool;) a = c.geom.ZPP_SimplifyP.zpp_pool.next, c.geom.ZPP_SimplifyP.zpp_pool.next = null, c.geom.ZPP_SimplifyP.zpp_pool = a;
  19517. for (; null != c.util.ZNPNode_ZPP_SimplifyP.zpp_pool;) a = c.util.ZNPNode_ZPP_SimplifyP.zpp_pool.next, c.util.ZNPNode_ZPP_SimplifyP.zpp_pool.next = null, c.util.ZNPNode_ZPP_SimplifyP.zpp_pool = a;
  19518. for (; null != c.geom.ZPP_AABB.zpp_pool;) a = c.geom.ZPP_AABB.zpp_pool.next, c.geom.ZPP_AABB.zpp_pool.next = null, c.geom.ZPP_AABB.zpp_pool = a;
  19519. for (; null != c.geom.ZPP_ToiEvent.zpp_pool;) a =
  19520. c.geom.ZPP_ToiEvent.zpp_pool.next, c.geom.ZPP_ToiEvent.zpp_pool.next = null, c.geom.ZPP_ToiEvent.zpp_pool = a;
  19521. for (; null != c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool;) a = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool.next, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool.next = null, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = a;
  19522. for (; null != c.geom.ZPP_SimpleVert.zpp_pool;) a = c.geom.ZPP_SimpleVert.zpp_pool.next, c.geom.ZPP_SimpleVert.zpp_pool.next = null, c.geom.ZPP_SimpleVert.zpp_pool = a;
  19523. for (; null != c.geom.ZPP_SimpleSeg.zpp_pool;) a = c.geom.ZPP_SimpleSeg.zpp_pool.next,
  19524. c.geom.ZPP_SimpleSeg.zpp_pool.next = null, c.geom.ZPP_SimpleSeg.zpp_pool = a;
  19525. for (; null != c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool;) a = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool.next, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool.next = null, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = a;
  19526. for (; null != c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool;) a = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool.next, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool.next = null, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = a;
  19527. for (; null != c.geom.ZPP_MarchSpan.zpp_pool;) a = c.geom.ZPP_MarchSpan.zpp_pool.next,
  19528. c.geom.ZPP_MarchSpan.zpp_pool.next = null, c.geom.ZPP_MarchSpan.zpp_pool = a;
  19529. for (; null != c.geom.ZPP_MarchPair.zpp_pool;) a = c.geom.ZPP_MarchPair.zpp_pool.next, c.geom.ZPP_MarchPair.zpp_pool.next = null, c.geom.ZPP_MarchPair.zpp_pool = a;
  19530. for (; null != c.geom.ZPP_SimpleEvent.zpp_pool;) a = c.geom.ZPP_SimpleEvent.zpp_pool.next, c.geom.ZPP_SimpleEvent.zpp_pool.next = null, c.geom.ZPP_SimpleEvent.zpp_pool = a;
  19531. for (; null != c.util.Hashable2_Boolfalse.zpp_pool;) a = c.util.Hashable2_Boolfalse.zpp_pool.next, c.util.Hashable2_Boolfalse.zpp_pool.next =
  19532. null, c.util.Hashable2_Boolfalse.zpp_pool = a;
  19533. for (; null != c.util.ZNPNode_ZPP_SimpleVert.zpp_pool;) a = c.util.ZNPNode_ZPP_SimpleVert.zpp_pool.next, c.util.ZNPNode_ZPP_SimpleVert.zpp_pool.next = null, c.util.ZNPNode_ZPP_SimpleVert.zpp_pool = a;
  19534. for (; null != c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool;) a = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool.next, c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool.next = null, c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = a;
  19535. for (; null != c.util.ZNPNode_ZPP_AABBPair.zpp_pool;) a = c.util.ZNPNode_ZPP_AABBPair.zpp_pool.next,
  19536. c.util.ZNPNode_ZPP_AABBPair.zpp_pool.next = null, c.util.ZNPNode_ZPP_AABBPair.zpp_pool = a;
  19537. for (; null != c.shape.ZPP_Edge.zpp_pool;) a = c.shape.ZPP_Edge.zpp_pool.next, c.shape.ZPP_Edge.zpp_pool.next = null, c.shape.ZPP_Edge.zpp_pool = a;
  19538. for (; null != c.util.ZNPNode_ZPP_Edge.zpp_pool;) a = c.util.ZNPNode_ZPP_Edge.zpp_pool.next, c.util.ZNPNode_ZPP_Edge.zpp_pool.next = null, c.util.ZNPNode_ZPP_Edge.zpp_pool = a;
  19539. for (; null != c.util.ZNPNode_ZPP_Vec2.zpp_pool;) a = c.util.ZNPNode_ZPP_Vec2.zpp_pool.next, c.util.ZNPNode_ZPP_Vec2.zpp_pool.next =
  19540. null, c.util.ZNPNode_ZPP_Vec2.zpp_pool = a;
  19541. for (; null != c.space.ZPP_SweepData.zpp_pool;) a = c.space.ZPP_SweepData.zpp_pool.next, c.space.ZPP_SweepData.zpp_pool.next = null, c.space.ZPP_SweepData.zpp_pool = a;
  19542. for (; null != c.space.ZPP_AABBNode.zpp_pool;) a = c.space.ZPP_AABBNode.zpp_pool.next, c.space.ZPP_AABBNode.zpp_pool.next = null, c.space.ZPP_AABBNode.zpp_pool = a;
  19543. for (; null != c.space.ZPP_AABBPair.zpp_pool;) a = c.space.ZPP_AABBPair.zpp_pool.next, c.space.ZPP_AABBPair.zpp_pool.next = null, c.space.ZPP_AABBPair.zpp_pool = a;
  19544. for (; null !=
  19545. c.dynamics.ZPP_Contact.zpp_pool;) a = c.dynamics.ZPP_Contact.zpp_pool.next, c.dynamics.ZPP_Contact.zpp_pool.next = null, c.dynamics.ZPP_Contact.zpp_pool = a;
  19546. for (; null != c.util.ZNPNode_ZPP_Component.zpp_pool;) a = c.util.ZNPNode_ZPP_Component.zpp_pool.next, c.util.ZNPNode_ZPP_Component.zpp_pool.next = null, c.util.ZNPNode_ZPP_Component.zpp_pool = a;
  19547. for (; null != c.util.ZNPNode_ZPP_AABBNode.zpp_pool;) a = c.util.ZNPNode_ZPP_AABBNode.zpp_pool.next, c.util.ZNPNode_ZPP_AABBNode.zpp_pool.next = null, c.util.ZNPNode_ZPP_AABBNode.zpp_pool =
  19548. a;
  19549. for (; null != c.space.ZPP_Island.zpp_pool;) a = c.space.ZPP_Island.zpp_pool.next, c.space.ZPP_Island.zpp_pool.next = null, c.space.ZPP_Island.zpp_pool = a;
  19550. for (; null != c.space.ZPP_Component.zpp_pool;) a = c.space.ZPP_Component.zpp_pool.next, c.space.ZPP_Component.zpp_pool.next = null, c.space.ZPP_Component.zpp_pool = a;
  19551. for (; null != c.space.ZPP_CallbackSet.zpp_pool;) a = c.space.ZPP_CallbackSet.zpp_pool.next, c.space.ZPP_CallbackSet.zpp_pool.next = null, c.space.ZPP_CallbackSet.zpp_pool = a;
  19552. for (; null != c.util.ZPP_Set_ZPP_CbSet.zpp_pool;) a =
  19553. c.util.ZPP_Set_ZPP_CbSet.zpp_pool.next, c.util.ZPP_Set_ZPP_CbSet.zpp_pool.next = null, c.util.ZPP_Set_ZPP_CbSet.zpp_pool = a;
  19554. for (; null != c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool;) a = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool.next, c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool.next = null, c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = a;
  19555. for (; null != c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool;) a = c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool.next, c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool.next = null, c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool =
  19556. a;
  19557. for (; null != c.dynamics.ZPP_InteractionFilter.zpp_pool;) a = c.dynamics.ZPP_InteractionFilter.zpp_pool.next, c.dynamics.ZPP_InteractionFilter.zpp_pool.next = null, c.dynamics.ZPP_InteractionFilter.zpp_pool = a;
  19558. for (; null != c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool;) a = c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool.next, c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool.next = null, c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool = a;
  19559. for (; null != c.dynamics.ZPP_SensorArbiter.zpp_pool;) a = c.dynamics.ZPP_SensorArbiter.zpp_pool.next, c.dynamics.ZPP_SensorArbiter.zpp_pool.next =
  19560. null, c.dynamics.ZPP_SensorArbiter.zpp_pool = a;
  19561. for (; null != c.dynamics.ZPP_FluidArbiter.zpp_pool;) a = c.dynamics.ZPP_FluidArbiter.zpp_pool.next, c.dynamics.ZPP_FluidArbiter.zpp_pool.next = null, c.dynamics.ZPP_FluidArbiter.zpp_pool = a;
  19562. for (; null != c.util.ZNPNode_ZPP_Listener.zpp_pool;) a = c.util.ZNPNode_ZPP_Listener.zpp_pool.next, c.util.ZNPNode_ZPP_Listener.zpp_pool.next = null, c.util.ZNPNode_ZPP_Listener.zpp_pool = a;
  19563. for (; null != c.util.ZNPNode_ZPP_ColArbiter.zpp_pool;) a = c.util.ZNPNode_ZPP_ColArbiter.zpp_pool.next, c.util.ZNPNode_ZPP_ColArbiter.zpp_pool.next =
  19564. null, c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = a;
  19565. for (; null != c.util.ZNPNode_ZPP_ToiEvent.zpp_pool;) a = c.util.ZNPNode_ZPP_ToiEvent.zpp_pool.next, c.util.ZNPNode_ZPP_ToiEvent.zpp_pool.next = null, c.util.ZNPNode_ZPP_ToiEvent.zpp_pool = a;
  19566. for (; null != c.dynamics.ZPP_ColArbiter.zpp_pool;) a = c.dynamics.ZPP_ColArbiter.zpp_pool.next, c.dynamics.ZPP_ColArbiter.zpp_pool.next = null, c.dynamics.ZPP_ColArbiter.zpp_pool = a;
  19567. for (; null != c.util.ZNPNode_ConvexResult.zpp_pool;) a = c.util.ZNPNode_ConvexResult.zpp_pool.next, c.util.ZNPNode_ConvexResult.zpp_pool.next =
  19568. null, c.util.ZNPNode_ConvexResult.zpp_pool = a;
  19569. for (; null != c.util.ZNPNode_ZPP_GeomPoly.zpp_pool;) a = c.util.ZNPNode_ZPP_GeomPoly.zpp_pool.next, c.util.ZNPNode_ZPP_GeomPoly.zpp_pool.next = null, c.util.ZNPNode_ZPP_GeomPoly.zpp_pool = a;
  19570. for (; null != c.util.ZNPNode_RayResult.zpp_pool;) a = c.util.ZNPNode_RayResult.zpp_pool.next, c.util.ZNPNode_RayResult.zpp_pool.next = null, c.util.ZNPNode_RayResult.zpp_pool = a;
  19571. for (; null != c.util.ZPP_PubPool.poolGeomPoly;) a = c.util.ZPP_PubPool.poolGeomPoly.zpp_pool, c.util.ZPP_PubPool.poolGeomPoly.zpp_pool =
  19572. null, c.util.ZPP_PubPool.poolGeomPoly = a;
  19573. for (; null != c.util.ZPP_PubPool.poolVec2;) a = c.util.ZPP_PubPool.poolVec2.zpp_pool, c.util.ZPP_PubPool.poolVec2.zpp_pool = null, c.util.ZPP_PubPool.poolVec2 = a;
  19574. for (; null != c.util.ZPP_PubPool.poolVec3;) a = c.util.ZPP_PubPool.poolVec3.zpp_pool, c.util.ZPP_PubPool.poolVec3.zpp_pool = null, c.util.ZPP_PubPool.poolVec3 = a
  19575. };
  19576. h.util.Debug.createGraphic = function (a) {
  19577. if (null == a) throw "Error: Cannot create debug graphic for null Body";
  19578. var b = new k.display.Shape,
  19579. d = b.graphics,
  19580. g = 16777215 * Math.exp(-a.zpp_inner_i.id /
  19581. 1500) | 0;
  19582. d.lineStyle(0.1, (0.7 * ((g & 16711680) >> 16) | 0) << 16 | (0.7 * ((g & 65280) >> 8) | 0) << 8 | 0.7 * (g & 255) | 0, 1);
  19583. for (a = a.zpp_inner.wrap_shapes.iterator(); a.hasNext();) {
  19584. var e = a.next();
  19585. if (e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
  19586. var f = e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? e.zpp_inner.circle.outer_zn : null;
  19587. d.drawCircle(function (a) {
  19588. null == f.zpp_inner.wrap_localCOM && (f.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? f.zpp_inner.circle.setupLocalCOM() : f.zpp_inner.polygon.setupLocalCOM());
  19589. return f.zpp_inner.wrap_localCOM
  19590. }(this).get_x(), function (a) {
  19591. null == f.zpp_inner.wrap_localCOM && (f.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? f.zpp_inner.circle.setupLocalCOM() : f.zpp_inner.polygon.setupLocalCOM());
  19592. return f.zpp_inner.wrap_localCOM
  19593. }(this).get_y(), f.zpp_inner_zn.radius)
  19594. } else {
  19595. g = e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? e.zpp_inner.polygon.outer_zn : null;
  19596. d.moveTo(function (a) {
  19597. null == e.zpp_inner.wrap_localCOM && (e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? e.zpp_inner.circle.setupLocalCOM() :
  19598. e.zpp_inner.polygon.setupLocalCOM());
  19599. return e.zpp_inner.wrap_localCOM
  19600. }(this).get_x(), function (a) {
  19601. null == e.zpp_inner.wrap_localCOM && (e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? e.zpp_inner.circle.setupLocalCOM() : e.zpp_inner.polygon.setupLocalCOM());
  19602. return e.zpp_inner.wrap_localCOM
  19603. }(this).get_y());
  19604. var l = 0;
  19605. null == g.zpp_inner_zn.wrap_gverts && g.zpp_inner_zn.getgverts();
  19606. for (var m = g.zpp_inner_zn.wrap_gverts.zpp_gl(); l < m;) {
  19607. var h = l++;
  19608. null == g.zpp_inner_zn.wrap_lverts && g.zpp_inner_zn.getlverts();
  19609. var p =
  19610. g.zpp_inner_zn.wrap_lverts.at(h);
  19611. d.lineTo(function (a) {
  19612. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19613. p.zpp_inner.validate();
  19614. return p.zpp_inner.x
  19615. }(this), function (a) {
  19616. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19617. p.zpp_inner.validate();
  19618. return p.zpp_inner.y
  19619. }(this))
  19620. }
  19621. null == g.zpp_inner_zn.wrap_lverts && g.zpp_inner_zn.getlverts();
  19622. p = g.zpp_inner_zn.wrap_lverts.at(0);
  19623. d.lineTo(function (a) {
  19624. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19625. p.zpp_inner.validate();
  19626. return p.zpp_inner.x
  19627. }(this), function (a) {
  19628. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19629. p.zpp_inner.validate();
  19630. return p.zpp_inner.y
  19631. }(this))
  19632. }
  19633. e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE && (f = e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? e.zpp_inner.circle.outer_zn : null, d.moveTo(function (a) {
  19634. null == f.zpp_inner.wrap_localCOM && (f.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? f.zpp_inner.circle.setupLocalCOM() : f.zpp_inner.polygon.setupLocalCOM());
  19635. return f.zpp_inner.wrap_localCOM
  19636. }(this).get_x() + 0.3 * f.zpp_inner_zn.radius, function (a) {
  19637. null == f.zpp_inner.wrap_localCOM && (f.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? f.zpp_inner.circle.setupLocalCOM() : f.zpp_inner.polygon.setupLocalCOM());
  19638. return f.zpp_inner.wrap_localCOM
  19639. }(this).get_y()), d.lineTo(function (a) {
  19640. null == f.zpp_inner.wrap_localCOM && (f.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? f.zpp_inner.circle.setupLocalCOM() : f.zpp_inner.polygon.setupLocalCOM());
  19641. return f.zpp_inner.wrap_localCOM
  19642. }(this).get_x() +
  19643. f.zpp_inner_zn.radius, function (a) {
  19644. null == f.zpp_inner.wrap_localCOM && (f.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? f.zpp_inner.circle.setupLocalCOM() : f.zpp_inner.polygon.setupLocalCOM());
  19645. return f.zpp_inner.wrap_localCOM
  19646. }(this).get_y()))
  19647. }
  19648. return b
  19649. };
  19650. h.util.Debug.prototype = {
  19651. drawSpring: function (a, b, d, c, e) {},
  19652. drawFilledPolygon: function (a, b) {},
  19653. drawPolygon: function (a, b) {},
  19654. drawFilledCircle: function (a, b, d) {},
  19655. drawFilledTriangle: function (a, b, d, c) {},
  19656. drawAABB: function (a, b) {},
  19657. drawCircle: function (a, b, d) {},
  19658. drawCurve: function (a, b, d, c) {},
  19659. drawLine: function (a, b, d) {},
  19660. draw: function (a) {},
  19661. flush: function () {},
  19662. clear: function () {},
  19663. set_transform: function (a) {
  19664. if (null == a) throw "Error: Cannot set Debug::transform to null";
  19665. null == this.zpp_inner.xform && this.zpp_inner.setform();
  19666. this.zpp_inner.xform.outer.set(a);
  19667. null == this.zpp_inner.xform && this.zpp_inner.setform();
  19668. return this.zpp_inner.xform.outer
  19669. },
  19670. get_transform: function () {
  19671. null == this.zpp_inner.xform && this.zpp_inner.setform();
  19672. return this.zpp_inner.xform.outer
  19673. },
  19674. get_display: function () {
  19675. return this.zpp_inner.d_shape.shape
  19676. },
  19677. set_bgColour: function (a) {
  19678. this.zpp_inner.d_shape.setbg(a);
  19679. return this.zpp_inner.bg_col
  19680. },
  19681. get_bgColour: function () {
  19682. return this.zpp_inner.bg_col
  19683. },
  19684. __class__: h.util.Debug
  19685. };
  19686. h.util.ShapeDebug = function (a, b, d) {
  19687. null == d && (d = 3355443);
  19688. this.thickness = 0;
  19689. this.zpp_inner_zn = null;
  19690. if (0 >= a) throw "Error: Debug width must be > 0";
  19691. if (0 >= b) throw "Error: Debug height must be > 0";
  19692. c.util.ZPP_Debug.internal = !0;
  19693. h.util.Debug.call(this);
  19694. c.util.ZPP_Debug.internal = !1;
  19695. this.zpp_inner_zn = new c.util.ZPP_ShapeDebug(a, b);
  19696. this.zpp_inner_zn.outer_zn =
  19697. this;
  19698. this.zpp_inner = this.zpp_inner_zn;
  19699. this.zpp_inner.outer = this;
  19700. this.zpp_inner.d_shape.setbg(d);
  19701. this.zpp_inner.bg_col;
  19702. this.thickness = 0.1
  19703. };
  19704. s["nape.util.ShapeDebug"] = h.util.ShapeDebug;
  19705. h.util.ShapeDebug.__name__ = ["nape", "util", "ShapeDebug"];
  19706. h.util.ShapeDebug.__super__ = h.util.Debug;
  19707. h.util.ShapeDebug.prototype = I(h.util.Debug.prototype, {
  19708. drawSpring: function (a, b, d, c, e) {
  19709. null == e && (e = 3);
  19710. null == c && (c = 3);
  19711. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19712. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19713. if (null == a) throw "Error: drawCurve::start cannot be null";
  19714. if (null == b) throw "Error: drawCurve::end cannot be null";
  19715. if (0 > c) throw "Error: drawCurve::coils must be >= 0";
  19716. if (0 == c) this.drawLine(a, b, d);
  19717. else {
  19718. var f;
  19719. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19720. b.zpp_inner.validate();
  19721. f = b.zpp_inner.x;
  19722. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19723. a.zpp_inner.validate();
  19724. f -= a.zpp_inner.x;
  19725. var l;
  19726. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19727. b.zpp_inner.validate();
  19728. l = b.zpp_inner.y;
  19729. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19730. a.zpp_inner.validate();
  19731. l -= a.zpp_inner.y;
  19732. var m = 1 / (4 * c);
  19733. f *= m;
  19734. l *= m;
  19735. var u = 0,
  19736. p = 0,
  19737. u = f,
  19738. p = l;
  19739. if (0.1 > u * u + p * p) return;
  19740. var m = 1 / Math.sqrt(u * u + p * p),
  19741. p = p * m,
  19742. m = u * m,
  19743. u = -p,
  19744. p = m,
  19745. m = 2 * e,
  19746. u = u * m,
  19747. p = p * m,
  19748. C = function (b) {
  19749. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19750. return h.geom.Vec2.get(function (b) {
  19751. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19752. a.zpp_inner.validate();
  19753. return a.zpp_inner.x
  19754. }(b), function (b) {
  19755. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19756. a.zpp_inner.validate();
  19757. return a.zpp_inner.y
  19758. }(b), !1)
  19759. }(this);
  19760. e = h.geom.Vec2.get(null, null, null);
  19761. for (var r = h.geom.Vec2.get(null, null, null), m = 0; m < c;) m++, e.set_x(function (a) {
  19762. if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19763. C.zpp_inner.validate();
  19764. return C.zpp_inner.x
  19765. }(this) + f + u), e.set_y(function (a) {
  19766. if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19767. C.zpp_inner.validate();
  19768. return C.zpp_inner.y
  19769. }(this) + l + p), r.set_x(function (a) {
  19770. if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19771. C.zpp_inner.validate();
  19772. return C.zpp_inner.x
  19773. }(this) + 2 * f), r.set_y(function (a) {
  19774. if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19775. C.zpp_inner.validate();
  19776. return C.zpp_inner.y
  19777. }(this) + 2 * l), this.drawCurve(C, e, r, d), C.set_x(function (a) {
  19778. if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19779. r.zpp_inner.validate();
  19780. return r.zpp_inner.x
  19781. }(this)), C.set_y(function (a) {
  19782. if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19783. r.zpp_inner.validate();
  19784. return r.zpp_inner.y
  19785. }(this)), e.set_x(function (a) {
  19786. if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19787. C.zpp_inner.validate();
  19788. return C.zpp_inner.x
  19789. }(this) + f - u), e.set_y(function (a) {
  19790. if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19791. C.zpp_inner.validate();
  19792. return C.zpp_inner.y
  19793. }(this) + l - p), r.set_x(function (a) {
  19794. if (null !=
  19795. C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19796. C.zpp_inner.validate();
  19797. return C.zpp_inner.x
  19798. }(this) + 2 * f), r.set_y(function (a) {
  19799. if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19800. C.zpp_inner.validate();
  19801. return C.zpp_inner.y
  19802. }(this) + 2 * l), this.drawCurve(C, e, r, d), C.set_x(function (a) {
  19803. if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19804. r.zpp_inner.validate();
  19805. return r.zpp_inner.x
  19806. }(this)), C.set_y(function (a) {
  19807. if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19808. r.zpp_inner.validate();
  19809. return r.zpp_inner.y
  19810. }(this));
  19811. C.dispose();
  19812. e.dispose();
  19813. r.dispose()
  19814. }
  19815. a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  19816. b.zpp_inner.weak ? (b.dispose(), !0) : !1
  19817. },
  19818. draw: function (a) {
  19819. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  19820. if (this.zpp_inner.xnull)
  19821. if (F.Boot.__instanceof(a, h.space.Space)) this.zpp_inner_zn.draw_space(F.Boot.__cast(a, h.space.Space).zpp_inner, null, 1, !0);
  19822. else if (F.Boot.__instanceof(a,
  19823. h.phys.Compound)) this.zpp_inner_zn.draw_compound(F.Boot.__cast(a, h.phys.Compound).zpp_inner, null, 1, !0);
  19824. else if (F.Boot.__instanceof(a, h.phys.Body)) this.zpp_inner_zn.draw_body(F.Boot.__cast(a, h.phys.Body).zpp_inner, null, 1, !0);
  19825. else if (F.Boot.__instanceof(a, h.shape.Shape)) this.zpp_inner_zn.draw_shape(F.Boot.__cast(a, h.shape.Shape).zpp_inner, null, 1, !0);
  19826. else if (F.Boot.__instanceof(a, h.constraint.Constraint)) F.Boot.__cast(a, h.constraint.Constraint).zpp_inner.draw(this);
  19827. else throw "Error: Unhandled object type for Debug draw";
  19828. else if (F.Boot.__instanceof(a, h.space.Space)) this.zpp_inner_zn.draw_space(F.Boot.__cast(a, h.space.Space).zpp_inner, this.zpp_inner.xform, this.zpp_inner.xdet, !1);
  19829. else if (F.Boot.__instanceof(a, h.phys.Body)) this.zpp_inner_zn.draw_body(F.Boot.__cast(a, h.phys.Body).zpp_inner, this.zpp_inner.xform, this.zpp_inner.xdet, !1);
  19830. else if (F.Boot.__instanceof(a, h.shape.Shape)) this.zpp_inner_zn.draw_shape(F.Boot.__cast(a, h.shape.Shape).zpp_inner, this.zpp_inner.xform, this.zpp_inner.xdet, !1);
  19831. else if (F.Boot.__instanceof(a,
  19832. h.constraint.Constraint)) F.Boot.__cast(a, h.constraint.Constraint).zpp_inner.draw(this);
  19833. else throw "Error: Unhandled object type for Debug draw";
  19834. },
  19835. drawFilledPolygon: function (a, b) {
  19836. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  19837. if (null == a) throw "Error: Cannot draw null polygon!";
  19838. var d = this.zpp_inner_zn.graphics;
  19839. d.beginFill(b & 16777215, 1);
  19840. d.lineStyle(0, 0, 0);
  19841. var c = null,
  19842. e = !0;
  19843. if (this.zpp_inner.xnull)
  19844. if (F.Boot.__instanceof(a,
  19845. Array))
  19846. for (var f = a, l = 0; l < f.length;) {
  19847. var m = f[l];
  19848. ++l;
  19849. if (null == m) throw "Error: Array<Vec2> contains null objects";
  19850. if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
  19851. var u = m;
  19852. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19853. e ? (c = function (a) {
  19854. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19855. return h.geom.Vec2.get(function (a) {
  19856. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19857. u.zpp_inner.validate();
  19858. return u.zpp_inner.x
  19859. }(a), function (a) {
  19860. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19861. u.zpp_inner.validate();
  19862. return u.zpp_inner.y
  19863. }(a), !1)
  19864. }(this), d.moveTo(function (a) {
  19865. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19866. u.zpp_inner.validate();
  19867. return u.zpp_inner.x
  19868. }(this), function (a) {
  19869. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19870. u.zpp_inner.validate();
  19871. return u.zpp_inner.y
  19872. }(this))) : d.lineTo(function (a) {
  19873. if (null !=
  19874. u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19875. u.zpp_inner.validate();
  19876. return u.zpp_inner.x
  19877. }(this), function (a) {
  19878. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19879. u.zpp_inner.validate();
  19880. return u.zpp_inner.y
  19881. }(this));
  19882. e = !1
  19883. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  19884. for (f = a.iterator(); f.hasNext();) {
  19885. u = f.next();
  19886. if (null == u) throw "Error: Vec2List contains null objects";
  19887. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19888. e ? (c =
  19889. function (a) {
  19890. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19891. return h.geom.Vec2.get(function (a) {
  19892. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19893. u.zpp_inner.validate();
  19894. return u.zpp_inner.x
  19895. }(a), function (a) {
  19896. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19897. u.zpp_inner.validate();
  19898. return u.zpp_inner.y
  19899. }(a), !1)
  19900. }(this), d.moveTo(function (a) {
  19901. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19902. u.zpp_inner.validate();
  19903. return u.zpp_inner.x
  19904. }(this), function (a) {
  19905. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19906. u.zpp_inner.validate();
  19907. return u.zpp_inner.y
  19908. }(this))) : d.lineTo(function (a) {
  19909. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19910. u.zpp_inner.validate();
  19911. return u.zpp_inner.x
  19912. }(this), function (a) {
  19913. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19914. u.zpp_inner.validate();
  19915. return u.zpp_inner.y
  19916. }(this));
  19917. e = !1
  19918. } else if (F.Boot.__instanceof(a,
  19919. h.geom.GeomPoly)) {
  19920. f = a;
  19921. if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  19922. f = f.zpp_inner.vertices;
  19923. if (null != f) {
  19924. m = f;
  19925. do u = h.geom.Vec2.get(m.x, m.y, null), m = m.next, e ? (c = function (a) {
  19926. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19927. return h.geom.Vec2.get(function (a) {
  19928. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19929. u.zpp_inner.validate();
  19930. return u.zpp_inner.x
  19931. }(a), function (a) {
  19932. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19933. u.zpp_inner.validate();
  19934. return u.zpp_inner.y
  19935. }(a), !1)
  19936. }(this), d.moveTo(function (a) {
  19937. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19938. u.zpp_inner.validate();
  19939. return u.zpp_inner.x
  19940. }(this), function (a) {
  19941. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19942. u.zpp_inner.validate();
  19943. return u.zpp_inner.y
  19944. }(this))) : d.lineTo(function (a) {
  19945. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19946. u.zpp_inner.validate();
  19947. return u.zpp_inner.x
  19948. }(this),
  19949. function (a) {
  19950. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19951. u.zpp_inner.validate();
  19952. return u.zpp_inner.y
  19953. }(this)), e = !1, u.dispose(); while (m != f)
  19954. }
  19955. } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
  19956. else if (F.Boot.__instanceof(a, Array))
  19957. for (f = a, l = 0; l < f.length;) {
  19958. m = f[l];
  19959. ++l;
  19960. if (null == m) throw "Error: Array<Vec2> contains null objects";
  19961. if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
  19962. u = m;
  19963. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19964. var p = this.zpp_inner.xform.outer.transform(u);
  19965. e ? (c = p, d.moveTo(function (a) {
  19966. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19967. p.zpp_inner.validate();
  19968. return p.zpp_inner.x
  19969. }(this), function (a) {
  19970. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19971. p.zpp_inner.validate();
  19972. return p.zpp_inner.y
  19973. }(this))) : d.lineTo(function (a) {
  19974. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19975. p.zpp_inner.validate();
  19976. return p.zpp_inner.x
  19977. }(this), function (a) {
  19978. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19979. p.zpp_inner.validate();
  19980. return p.zpp_inner.y
  19981. }(this));
  19982. e || p.dispose();
  19983. e = !1
  19984. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  19985. for (f = a.iterator(); f.hasNext();) {
  19986. u = f.next();
  19987. if (null == u) throw "Error: Vec2List contains null objects";
  19988. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19989. p = this.zpp_inner.xform.outer.transform(u);
  19990. e ? (c = p, d.moveTo(function (a) {
  19991. if (null !=
  19992. p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19993. p.zpp_inner.validate();
  19994. return p.zpp_inner.x
  19995. }(this), function (a) {
  19996. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  19997. p.zpp_inner.validate();
  19998. return p.zpp_inner.y
  19999. }(this))) : d.lineTo(function (a) {
  20000. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20001. p.zpp_inner.validate();
  20002. return p.zpp_inner.x
  20003. }(this), function (a) {
  20004. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20005. p.zpp_inner.validate();
  20006. return p.zpp_inner.y
  20007. }(this));
  20008. e || p.dispose();
  20009. e = !1
  20010. } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
  20011. f = a;
  20012. if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  20013. f = f.zpp_inner.vertices;
  20014. if (null != f) {
  20015. m = f;
  20016. do u = h.geom.Vec2.get(m.x, m.y, null), m = m.next, p = this.zpp_inner.xform.outer.transform(u), e ? (c = p, d.moveTo(function (a) {
  20017. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20018. p.zpp_inner.validate();
  20019. return p.zpp_inner.x
  20020. }(this), function (a) {
  20021. if (null !=
  20022. p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20023. p.zpp_inner.validate();
  20024. return p.zpp_inner.y
  20025. }(this))) : d.lineTo(function (a) {
  20026. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20027. p.zpp_inner.validate();
  20028. return p.zpp_inner.x
  20029. }(this), function (a) {
  20030. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20031. p.zpp_inner.validate();
  20032. return p.zpp_inner.y
  20033. }(this)), e || p.dispose(), e = !1, u.dispose(); while (m != f)
  20034. }
  20035. } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
  20036. d.lineTo(function (a) {
  20037. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20038. c.zpp_inner.validate();
  20039. return c.zpp_inner.x
  20040. }(this), function (a) {
  20041. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20042. c.zpp_inner.validate();
  20043. return c.zpp_inner.y
  20044. }(this));
  20045. c.dispose();
  20046. d.endFill();
  20047. if (F.Boot.__instanceof(a, Array))
  20048. for (f = a, e = 0; e < f.length;) {
  20049. d = f[e];
  20050. if (m = d.zpp_inner.weak) d.dispose(), m = !0;
  20051. m ? f.splice(e, 1) : e++
  20052. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  20053. for (f = a, null !=
  20054. f.zpp_inner._validate && f.zpp_inner._validate(), e = f.zpp_inner.inner, f = null, d = e.head; null != d;) m = d.elt, m.outer.zpp_inner.weak ? (d = e.erase(f), m.outer.zpp_inner.weak ? (m.outer.dispose(), !0) : !1) : (f = d, d = d.next)
  20055. },
  20056. drawPolygon: function (a, b) {
  20057. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  20058. if (null == a) throw "Error: Cannot draw null polygon";
  20059. var d = this.zpp_inner_zn.graphics;
  20060. d.lineStyle(0.1, b & 16777215, 1);
  20061. var c = null,
  20062. e = !0;
  20063. if (this.zpp_inner.xnull)
  20064. if (F.Boot.__instanceof(a, Array))
  20065. for (var f = a, l = 0; l < f.length;) {
  20066. var m = f[l];
  20067. ++l;
  20068. if (null == m) throw "Error: Array<Vec2> contains null objects";
  20069. if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
  20070. var u = m;
  20071. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20072. e ? (c = function (a) {
  20073. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20074. return h.geom.Vec2.get(function (a) {
  20075. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20076. u.zpp_inner.validate();
  20077. return u.zpp_inner.x
  20078. }(a), function (a) {
  20079. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20080. u.zpp_inner.validate();
  20081. return u.zpp_inner.y
  20082. }(a), !1)
  20083. }(this), d.moveTo(function (a) {
  20084. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20085. u.zpp_inner.validate();
  20086. return u.zpp_inner.x
  20087. }(this), function (a) {
  20088. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20089. u.zpp_inner.validate();
  20090. return u.zpp_inner.y
  20091. }(this))) : d.lineTo(function (a) {
  20092. if (null !=
  20093. u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20094. u.zpp_inner.validate();
  20095. return u.zpp_inner.x
  20096. }(this), function (a) {
  20097. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20098. u.zpp_inner.validate();
  20099. return u.zpp_inner.y
  20100. }(this));
  20101. e = !1
  20102. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  20103. for (f = a.iterator(); f.hasNext();) {
  20104. u = f.next();
  20105. if (null == u) throw "Error: Vec2List contains null objects";
  20106. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20107. e ? (c =
  20108. function (a) {
  20109. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20110. return h.geom.Vec2.get(function (a) {
  20111. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20112. u.zpp_inner.validate();
  20113. return u.zpp_inner.x
  20114. }(a), function (a) {
  20115. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20116. u.zpp_inner.validate();
  20117. return u.zpp_inner.y
  20118. }(a), !1)
  20119. }(this), d.moveTo(function (a) {
  20120. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20121. u.zpp_inner.validate();
  20122. return u.zpp_inner.x
  20123. }(this), function (a) {
  20124. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20125. u.zpp_inner.validate();
  20126. return u.zpp_inner.y
  20127. }(this))) : d.lineTo(function (a) {
  20128. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20129. u.zpp_inner.validate();
  20130. return u.zpp_inner.x
  20131. }(this), function (a) {
  20132. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20133. u.zpp_inner.validate();
  20134. return u.zpp_inner.y
  20135. }(this));
  20136. e = !1
  20137. } else if (F.Boot.__instanceof(a,
  20138. h.geom.GeomPoly)) {
  20139. f = a;
  20140. if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  20141. f = f.zpp_inner.vertices;
  20142. if (null != f) {
  20143. m = f;
  20144. do u = h.geom.Vec2.get(m.x, m.y, null), m = m.next, e ? (c = function (a) {
  20145. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20146. return h.geom.Vec2.get(function (a) {
  20147. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20148. u.zpp_inner.validate();
  20149. return u.zpp_inner.x
  20150. }(a), function (a) {
  20151. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20152. u.zpp_inner.validate();
  20153. return u.zpp_inner.y
  20154. }(a), !1)
  20155. }(this), d.moveTo(function (a) {
  20156. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20157. u.zpp_inner.validate();
  20158. return u.zpp_inner.x
  20159. }(this), function (a) {
  20160. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20161. u.zpp_inner.validate();
  20162. return u.zpp_inner.y
  20163. }(this))) : d.lineTo(function (a) {
  20164. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20165. u.zpp_inner.validate();
  20166. return u.zpp_inner.x
  20167. }(this),
  20168. function (a) {
  20169. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20170. u.zpp_inner.validate();
  20171. return u.zpp_inner.y
  20172. }(this)), e = !1, u.dispose(); while (m != f)
  20173. }
  20174. } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
  20175. else if (F.Boot.__instanceof(a, Array))
  20176. for (f = a, l = 0; l < f.length;) {
  20177. m = f[l];
  20178. ++l;
  20179. if (null == m) throw "Error: Array<Vec2> contains null objects";
  20180. if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
  20181. u = m;
  20182. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20183. var p = this.zpp_inner.xform.outer.transform(u);
  20184. e ? (c = p, d.moveTo(function (a) {
  20185. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20186. p.zpp_inner.validate();
  20187. return p.zpp_inner.x
  20188. }(this), function (a) {
  20189. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20190. p.zpp_inner.validate();
  20191. return p.zpp_inner.y
  20192. }(this))) : d.lineTo(function (a) {
  20193. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20194. p.zpp_inner.validate();
  20195. return p.zpp_inner.x
  20196. }(this), function (a) {
  20197. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20198. p.zpp_inner.validate();
  20199. return p.zpp_inner.y
  20200. }(this));
  20201. e || p.dispose();
  20202. e = !1
  20203. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  20204. for (f = a.iterator(); f.hasNext();) {
  20205. u = f.next();
  20206. if (null == u) throw "Error: Vec2List contains null objects";
  20207. if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20208. p = this.zpp_inner.xform.outer.transform(u);
  20209. e ? (c = p, d.moveTo(function (a) {
  20210. if (null !=
  20211. p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20212. p.zpp_inner.validate();
  20213. return p.zpp_inner.x
  20214. }(this), function (a) {
  20215. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20216. p.zpp_inner.validate();
  20217. return p.zpp_inner.y
  20218. }(this))) : d.lineTo(function (a) {
  20219. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20220. p.zpp_inner.validate();
  20221. return p.zpp_inner.x
  20222. }(this), function (a) {
  20223. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20224. p.zpp_inner.validate();
  20225. return p.zpp_inner.y
  20226. }(this));
  20227. e || p.dispose();
  20228. e = !1
  20229. } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
  20230. f = a;
  20231. if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
  20232. f = f.zpp_inner.vertices;
  20233. if (null != f) {
  20234. m = f;
  20235. do u = h.geom.Vec2.get(m.x, m.y, null), m = m.next, p = this.zpp_inner.xform.outer.transform(u), e ? (c = p, d.moveTo(function (a) {
  20236. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20237. p.zpp_inner.validate();
  20238. return p.zpp_inner.x
  20239. }(this), function (a) {
  20240. if (null !=
  20241. p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20242. p.zpp_inner.validate();
  20243. return p.zpp_inner.y
  20244. }(this))) : d.lineTo(function (a) {
  20245. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20246. p.zpp_inner.validate();
  20247. return p.zpp_inner.x
  20248. }(this), function (a) {
  20249. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20250. p.zpp_inner.validate();
  20251. return p.zpp_inner.y
  20252. }(this)), e || p.dispose(), e = !1, u.dispose(); while (m != f)
  20253. }
  20254. } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
  20255. d.lineTo(function (a) {
  20256. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20257. c.zpp_inner.validate();
  20258. return c.zpp_inner.x
  20259. }(this), function (a) {
  20260. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20261. c.zpp_inner.validate();
  20262. return c.zpp_inner.y
  20263. }(this));
  20264. c.dispose();
  20265. if (F.Boot.__instanceof(a, Array))
  20266. for (f = a, e = 0; e < f.length;) {
  20267. d = f[e];
  20268. if (m = d.zpp_inner.weak) d.dispose(), m = !0;
  20269. m ? f.splice(e, 1) : e++
  20270. } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
  20271. for (f = a, null != f.zpp_inner._validate &&
  20272. f.zpp_inner._validate(), e = f.zpp_inner.inner, f = null, d = e.head; null != d;) m = d.elt, m.outer.zpp_inner.weak ? (d = e.erase(f), m.outer.zpp_inner.weak ? (m.outer.dispose(), !0) : !1) : (f = d, d = d.next)
  20273. },
  20274. drawFilledCircle: function (a, b, d) {
  20275. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  20276. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20277. if (null == a) throw "Error: drawFilledCircle::position cannot be null";
  20278. if (b != b || 0 > b) throw "Error: drawFilledCircle::radius must be >=0";
  20279. var c = this.zpp_inner_zn.graphics;
  20280. c.lineStyle(0, 0, 0);
  20281. c.beginFill(d & 16777215, 1);
  20282. if (this.zpp_inner.xnull) c.drawCircle(function (b) {
  20283. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20284. a.zpp_inner.validate();
  20285. return a.zpp_inner.x
  20286. }(this), function (b) {
  20287. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20288. a.zpp_inner.validate();
  20289. return a.zpp_inner.y
  20290. }(this), b), a.zpp_inner.weak ? (a.dispose(), !0) :
  20291. !1;
  20292. else {
  20293. var e = this.zpp_inner.xform.outer.transform(a);
  20294. c.drawCircle(function (a) {
  20295. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20296. e.zpp_inner.validate();
  20297. return e.zpp_inner.x
  20298. }(this), function (a) {
  20299. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20300. e.zpp_inner.validate();
  20301. return e.zpp_inner.y
  20302. }(this), b * this.zpp_inner.xdet);
  20303. e.dispose()
  20304. }
  20305. c.endFill()
  20306. },
  20307. drawFilledTriangle: function (a, b, d, c) {
  20308. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  20309. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20310. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20311. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20312. if (null == a || null == b || null == d) throw "Error: drawFilledTriangle can't use null points";
  20313. var e = this.zpp_inner_zn.graphics;
  20314. e.lineStyle(0, 0, 0);
  20315. e.beginFill(c & 16777215, 1);
  20316. if (this.zpp_inner.xnull) e.moveTo(function (b) {
  20317. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20318. a.zpp_inner.validate();
  20319. return a.zpp_inner.x
  20320. }(this), function (b) {
  20321. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20322. a.zpp_inner.validate();
  20323. return a.zpp_inner.y
  20324. }(this)), e.lineTo(function (a) {
  20325. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20326. b.zpp_inner.validate();
  20327. return b.zpp_inner.x
  20328. }(this), function (a) {
  20329. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20330. b.zpp_inner.validate();
  20331. return b.zpp_inner.y
  20332. }(this)), e.lineTo(function (a) {
  20333. if (null !=
  20334. d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20335. d.zpp_inner.validate();
  20336. return d.zpp_inner.x
  20337. }(this), function (a) {
  20338. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20339. d.zpp_inner.validate();
  20340. return d.zpp_inner.y
  20341. }(this)), a.zpp_inner.weak ? (a.dispose(), !0) : !1, b.zpp_inner.weak ? (b.dispose(), !0) : !1, d.zpp_inner.weak ? (d.dispose(), !0) : !1;
  20342. else {
  20343. var f = this.zpp_inner.xform.outer.transform(a);
  20344. e.moveTo(function (a) {
  20345. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20346. f.zpp_inner.validate();
  20347. return f.zpp_inner.x
  20348. }(this), function (a) {
  20349. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20350. f.zpp_inner.validate();
  20351. return f.zpp_inner.y
  20352. }(this));
  20353. f.dispose();
  20354. f = this.zpp_inner.xform.outer.transform(b);
  20355. e.lineTo(function (a) {
  20356. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20357. f.zpp_inner.validate();
  20358. return f.zpp_inner.x
  20359. }(this), function (a) {
  20360. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20361. f.zpp_inner.validate();
  20362. return f.zpp_inner.y
  20363. }(this));
  20364. f.dispose();
  20365. f = this.zpp_inner.xform.outer.transform(d);
  20366. e.lineTo(function (a) {
  20367. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20368. f.zpp_inner.validate();
  20369. return f.zpp_inner.x
  20370. }(this), function (a) {
  20371. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20372. f.zpp_inner.validate();
  20373. return f.zpp_inner.y
  20374. }(this));
  20375. f.dispose()
  20376. }
  20377. e.endFill()
  20378. },
  20379. drawAABB: function (a, b) {
  20380. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  20381. if (null == a) throw "Error: drawAABB::aabb cannot be null";
  20382. var d = this.zpp_inner_zn.graphics;
  20383. d.lineStyle(0.1, b & 16777215, 1);
  20384. if (this.zpp_inner.xnull) d.drawRect(function (b) {
  20385. a.zpp_inner.validate();
  20386. return a.zpp_inner.minx
  20387. }(this), function (b) {
  20388. a.zpp_inner.validate();
  20389. return a.zpp_inner.miny
  20390. }(this), function (b) {
  20391. a.zpp_inner.validate();
  20392. return a.zpp_inner.width()
  20393. }(this), function (b) {
  20394. a.zpp_inner.validate();
  20395. return a.zpp_inner.height()
  20396. }(this));
  20397. else {
  20398. var c = this.zpp_inner.xform.outer.transform(a.zpp_inner.getmin()),
  20399. e = h.geom.Vec2.get(function (b) {
  20400. a.zpp_inner.validate();
  20401. return a.zpp_inner.width()
  20402. }(this), 0, null),
  20403. f = this.zpp_inner.xform.outer.transform(e, !0),
  20404. l = h.geom.Vec2.get(0, function (b) {
  20405. a.zpp_inner.validate();
  20406. return a.zpp_inner.height()
  20407. }(this), null),
  20408. m = this.zpp_inner.xform.outer.transform(l, !0);
  20409. d.moveTo(function (a) {
  20410. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20411. c.zpp_inner.validate();
  20412. return c.zpp_inner.x
  20413. }(this), function (a) {
  20414. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20415. c.zpp_inner.validate();
  20416. return c.zpp_inner.y
  20417. }(this));
  20418. d.lineTo(function (a) {
  20419. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20420. c.zpp_inner.validate();
  20421. return c.zpp_inner.x
  20422. }(this) + function (a) {
  20423. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20424. f.zpp_inner.validate();
  20425. return f.zpp_inner.x
  20426. }(this), function (a) {
  20427. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20428. c.zpp_inner.validate();
  20429. return c.zpp_inner.y
  20430. }(this) + function (a) {
  20431. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20432. f.zpp_inner.validate();
  20433. return f.zpp_inner.y
  20434. }(this));
  20435. d.lineTo(function (a) {
  20436. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20437. c.zpp_inner.validate();
  20438. return c.zpp_inner.x
  20439. }(this) + function (a) {
  20440. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20441. f.zpp_inner.validate();
  20442. return f.zpp_inner.x
  20443. }(this) + function (a) {
  20444. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20445. m.zpp_inner.validate();
  20446. return m.zpp_inner.x
  20447. }(this), function (a) {
  20448. if (null !=
  20449. c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20450. c.zpp_inner.validate();
  20451. return c.zpp_inner.y
  20452. }(this) + function (a) {
  20453. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20454. f.zpp_inner.validate();
  20455. return f.zpp_inner.y
  20456. }(this) + function (a) {
  20457. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20458. m.zpp_inner.validate();
  20459. return m.zpp_inner.y
  20460. }(this));
  20461. d.lineTo(function (a) {
  20462. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20463. c.zpp_inner.validate();
  20464. return c.zpp_inner.x
  20465. }(this) + function (a) {
  20466. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20467. m.zpp_inner.validate();
  20468. return m.zpp_inner.x
  20469. }(this), function (a) {
  20470. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20471. c.zpp_inner.validate();
  20472. return c.zpp_inner.y
  20473. }(this) + function (a) {
  20474. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20475. m.zpp_inner.validate();
  20476. return m.zpp_inner.y
  20477. }(this));
  20478. d.lineTo(function (a) {
  20479. if (null !=
  20480. c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20481. c.zpp_inner.validate();
  20482. return c.zpp_inner.x
  20483. }(this), function (a) {
  20484. if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20485. c.zpp_inner.validate();
  20486. return c.zpp_inner.y
  20487. }(this));
  20488. c.dispose();
  20489. e.dispose();
  20490. f.dispose();
  20491. l.dispose();
  20492. m.dispose()
  20493. }
  20494. },
  20495. drawCircle: function (a, b, d) {
  20496. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  20497. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20498. if (null == a) throw "Error: drawCircle::position cannot be null";
  20499. if (b != b || 0 > b) throw "Error: drawCircle::radius must be >=0";
  20500. var c = this.zpp_inner_zn.graphics;
  20501. c.lineStyle(0.1, d & 16777215, 1);
  20502. if (this.zpp_inner.xnull) c.drawCircle(function (b) {
  20503. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20504. a.zpp_inner.validate();
  20505. return a.zpp_inner.x
  20506. }(this), function (b) {
  20507. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20508. a.zpp_inner.validate();
  20509. return a.zpp_inner.y
  20510. }(this), b), a.zpp_inner.weak ? (a.dispose(), !0) : !1;
  20511. else {
  20512. var e = this.zpp_inner.xform.outer.transform(a);
  20513. c.drawCircle(function (a) {
  20514. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20515. e.zpp_inner.validate();
  20516. return e.zpp_inner.x
  20517. }(this), function (a) {
  20518. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20519. e.zpp_inner.validate();
  20520. return e.zpp_inner.y
  20521. }(this), b * this.zpp_inner.xdet);
  20522. e.dispose()
  20523. }
  20524. },
  20525. drawCurve: function (a, b,
  20526. d, c) {
  20527. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  20528. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20529. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20530. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20531. if (null == a) throw "Error: drawCurve::start cannot be null";
  20532. if (null == b) throw "Error: drawCurve::control cannot be null";
  20533. if (null == d) throw "Error: drawCurve::end cannot be null";
  20534. var e = this.zpp_inner_zn.graphics;
  20535. e.lineStyle(0.1, c & 16777215, 1);
  20536. if (this.zpp_inner.xnull) e.moveTo(function (b) {
  20537. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20538. a.zpp_inner.validate();
  20539. return a.zpp_inner.x
  20540. }(this), function (b) {
  20541. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20542. a.zpp_inner.validate();
  20543. return a.zpp_inner.y
  20544. }(this)), e.curveTo(function (a) {
  20545. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20546. b.zpp_inner.validate();
  20547. return b.zpp_inner.x
  20548. }(this), function (a) {
  20549. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20550. b.zpp_inner.validate();
  20551. return b.zpp_inner.y
  20552. }(this), function (a) {
  20553. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20554. d.zpp_inner.validate();
  20555. return d.zpp_inner.x
  20556. }(this), function (a) {
  20557. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20558. d.zpp_inner.validate();
  20559. return d.zpp_inner.y
  20560. }(this)), a.zpp_inner.weak ? (a.dispose(), !0) : !1, b.zpp_inner.weak ? (b.dispose(), !0) : !1, d.zpp_inner.weak ? (d.dispose(), !0) : !1;
  20561. else {
  20562. var f = this.zpp_inner.xform.outer.transform(a),
  20563. l = this.zpp_inner.xform.outer.transform(b),
  20564. m = this.zpp_inner.xform.outer.transform(d);
  20565. e.moveTo(function (a) {
  20566. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20567. f.zpp_inner.validate();
  20568. return f.zpp_inner.x
  20569. }(this), function (a) {
  20570. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20571. f.zpp_inner.validate();
  20572. return f.zpp_inner.y
  20573. }(this));
  20574. e.curveTo(function (a) {
  20575. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20576. l.zpp_inner.validate();
  20577. return l.zpp_inner.x
  20578. }(this), function (a) {
  20579. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20580. l.zpp_inner.validate();
  20581. return l.zpp_inner.y
  20582. }(this), function (a) {
  20583. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20584. m.zpp_inner.validate();
  20585. return m.zpp_inner.x
  20586. }(this), function (a) {
  20587. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20588. m.zpp_inner.validate();
  20589. return m.zpp_inner.y
  20590. }(this));
  20591. f.dispose();
  20592. l.dispose();
  20593. m.dispose()
  20594. }
  20595. },
  20596. drawLine: function (a, b, d) {
  20597. if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
  20598. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20599. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20600. if (null == a) throw "Error: drawLine::start cannot be null";
  20601. if (null == b) throw "Error: drawLine::end cannot be null";
  20602. var c = this.zpp_inner_zn.graphics;
  20603. c.lineStyle(0.1, d & 16777215, 1);
  20604. if (this.zpp_inner.xnull) c.moveTo(function (b) {
  20605. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20606. a.zpp_inner.validate();
  20607. return a.zpp_inner.x
  20608. }(this), function (b) {
  20609. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20610. a.zpp_inner.validate();
  20611. return a.zpp_inner.y
  20612. }(this)), c.lineTo(function (a) {
  20613. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20614. b.zpp_inner.validate();
  20615. return b.zpp_inner.x
  20616. }(this), function (a) {
  20617. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20618. b.zpp_inner.validate();
  20619. return b.zpp_inner.y
  20620. }(this)), a.zpp_inner.weak ? (a.dispose(), !0) : !1, b.zpp_inner.weak ? (b.dispose(), !0) : !1;
  20621. else {
  20622. var e = this.zpp_inner.xform.outer.transform(a);
  20623. c.moveTo(function (a) {
  20624. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20625. e.zpp_inner.validate();
  20626. return e.zpp_inner.x
  20627. }(this), function (a) {
  20628. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20629. e.zpp_inner.validate();
  20630. return e.zpp_inner.y
  20631. }(this));
  20632. e.dispose();
  20633. e = this.zpp_inner.xform.outer.transform(b);
  20634. c.lineTo(function (a) {
  20635. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20636. e.zpp_inner.validate();
  20637. return e.zpp_inner.x
  20638. }(this), function (a) {
  20639. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  20640. e.zpp_inner.validate();
  20641. return e.zpp_inner.y
  20642. }(this));
  20643. e.dispose()
  20644. }
  20645. },
  20646. clear: function () {
  20647. this.zpp_inner_zn.graphics.clear()
  20648. },
  20649. __class__: h.util.ShapeDebug
  20650. });
  20651. var X;
  20652. X = function () {};
  20653. s["nme.AssetData"] = X;
  20654. X.__name__ = ["nme", "AssetData"];
  20655. X.initialize = function () {
  20656. if (!X.initialized) {
  20657. X.path.set("assets/ggg.png", "assets/ggg.png");
  20658. var a = W.field(J.AssetType, "IMAGE");
  20659. X.type.set("assets/ggg.png", a);
  20660. X.path.set("assets/FontCourier.png", "assets/FontCourier.png");
  20661. a = W.field(J.AssetType, "IMAGE");
  20662. X.type.set("assets/FontCourier.png", a);
  20663. X.path.set("assets/FontGame.png", "assets/FontGame.png");
  20664. a = W.field(J.AssetType, "IMAGE");
  20665. X.type.set("assets/FontGame.png", a);
  20666. X.path.set("assets/Objects.png",
  20667. "assets/Objects.png");
  20668. a = W.field(J.AssetType, "IMAGE");
  20669. X.type.set("assets/Objects.png", a);
  20670. X.initialized = !0
  20671. }
  20672. };
  20673. var J = {
  20674. Assets: function () {}
  20675. };
  20676. s["openfl.Assets"] = J.Assets;
  20677. J.Assets.__name__ = ["openfl", "Assets"];
  20678. J.Assets.initialize = function () {
  20679. J.Assets.initialized || (X.initialize(), J.Assets.initialized = !0)
  20680. };
  20681. J.Assets.getBitmapData = function (a, b) {
  20682. null == b && (b = !0);
  20683. J.Assets.initialize();
  20684. if (X.type.exists(a) && X.type.get(a) == J.AssetType.IMAGE) {
  20685. if (b && J.Assets.cachedBitmapData.exists(a)) return J.Assets.cachedBitmapData.get(a);
  20686. var d = F.Boot.__cast(P.loaders.get(X.path.get(a)).contentLoaderInfo.content, k.display.Bitmap).bitmapData;
  20687. b && J.Assets.cachedBitmapData.set(a, d);
  20688. return d
  20689. } - 1 < a.indexOf(":") ? (d = S.substr(a, 0, a.indexOf(":")), S.substr(a, a.indexOf(":") + 1, null), X.library.exists(d) || y.Log.trace('[openfl.Assets] There is no asset library named "' + d + '"', {
  20690. fileName: "Assets.hx",
  20691. lineNumber: 175,
  20692. className: "openfl.Assets",
  20693. methodName: "getBitmapData"
  20694. })) : y.Log.trace('[openfl.Assets] There is no BitmapData asset with an ID of "' + a + '"', {
  20695. fileName: "Assets.hx",
  20696. lineNumber: 181,
  20697. className: "openfl.Assets",
  20698. methodName: "getBitmapData"
  20699. });
  20700. return null
  20701. };
  20702. J.Assets.getBytes = function (a) {
  20703. J.Assets.initialize();
  20704. if (X.type.exists(a)) {
  20705. var b = null;
  20706. a = P.urlLoaders.get(X.path.get(a)).data;
  20707. F.Boot.__instanceof(a, String) ? (new k.utils.ByteArray).writeUTFBytes(a) : b = F.Boot.__instanceof(a, k.utils.ByteArray) ? a : null;
  20708. if (null != b) return b.position = 0, b
  20709. } else y.Log.trace('[openfl.Assets] There is no String or ByteArray asset with an ID of "' + a + '"', {
  20710. fileName: "Assets.hx",
  20711. lineNumber: 238,
  20712. className: "openfl.Assets",
  20713. methodName: "getBytes"
  20714. });
  20715. return null
  20716. };
  20717. J.Assets.getFont = function (a) {
  20718. J.Assets.initialize();
  20719. if (X.type.exists(a) && X.type.get(a) == J.AssetType.FONT) return F.Boot.__cast(Y.createInstance(X.className.get(a), []), k.text.Font);
  20720. y.Log.trace('[openfl.Assets] There is no Font asset with an ID of "' + a + '"', {
  20721. fileName: "Assets.hx",
  20722. lineNumber: 275,
  20723. className: "openfl.Assets",
  20724. methodName: "getFont"
  20725. });
  20726. return null
  20727. };
  20728. J.Assets.getMovieClip = function (a) {
  20729. J.Assets.initialize();
  20730. var b = S.substr(a, 0, a.indexOf(":"));
  20731. S.substr(a, a.indexOf(":") +
  20732. 1, null);
  20733. X.library.exists(b) || y.Log.trace('[openfl.Assets] There is no asset library named "' + b + '"', {
  20734. fileName: "Assets.hx",
  20735. lineNumber: 348,
  20736. className: "openfl.Assets",
  20737. methodName: "getMovieClip"
  20738. });
  20739. return null
  20740. };
  20741. J.Assets.getSound = function (a) {
  20742. J.Assets.initialize();
  20743. if (X.type.exists(a)) {
  20744. var b = X.type.get(a);
  20745. if (b == J.AssetType.SOUND || b == J.AssetType.MUSIC) return new k.media.Sound(new k.net.URLRequest(X.path.get(a)))
  20746. }
  20747. y.Log.trace('[openfl.Assets] There is no Sound asset with an ID of "' + a + '"', {
  20748. fileName: "Assets.hx",
  20749. lineNumber: 396,
  20750. className: "openfl.Assets",
  20751. methodName: "getSound"
  20752. });
  20753. return null
  20754. };
  20755. J.Assets.getText = function (a) {
  20756. a = J.Assets.getBytes(a);
  20757. return null == a ? null : a.readUTFBytes(a.length)
  20758. };
  20759. J.Assets.resolveClass = function (a) {
  20760. a = $.replace(a, "native.", "browser.");
  20761. return Y.resolveClass(a)
  20762. };
  20763. J.Assets.resolveEnum = function (a) {
  20764. a = $.replace(a, "native.", "browser.");
  20765. return Y.resolveEnum(a)
  20766. };
  20767. J.Assets.get_id = function () {
  20768. J.Assets.initialize();
  20769. for (var a = [], b = X.type.keys(); b.hasNext();) {
  20770. var d = b.next();
  20771. a.push(d)
  20772. }
  20773. return a
  20774. };
  20775. J.Assets.get_library =
  20776. function () {
  20777. J.Assets.initialize();
  20778. return X.library
  20779. };
  20780. J.Assets.get_path = function () {
  20781. J.Assets.initialize();
  20782. return X.path
  20783. };
  20784. J.Assets.get_type = function () {
  20785. J.Assets.initialize();
  20786. return X.type
  20787. };
  20788. J.AssetType = s["openfl.AssetType"] = {
  20789. __ename__: ["openfl", "AssetType"],
  20790. __constructs__: "BINARY FONT IMAGE MUSIC SOUND TEXT".split(" ")
  20791. };
  20792. J.AssetType.BINARY = ["BINARY", 0];
  20793. J.AssetType.BINARY.toString = N;
  20794. J.AssetType.BINARY.__enum__ = J.AssetType;
  20795. J.AssetType.FONT = ["FONT", 1];
  20796. J.AssetType.FONT.toString = N;
  20797. J.AssetType.FONT.__enum__ = J.AssetType;
  20798. J.AssetType.IMAGE = ["IMAGE", 2];
  20799. J.AssetType.IMAGE.toString = N;
  20800. J.AssetType.IMAGE.__enum__ = J.AssetType;
  20801. J.AssetType.MUSIC = ["MUSIC", 3];
  20802. J.AssetType.MUSIC.toString = N;
  20803. J.AssetType.MUSIC.__enum__ = J.AssetType;
  20804. J.AssetType.SOUND = ["SOUND", 4];
  20805. J.AssetType.SOUND.toString = N;
  20806. J.AssetType.SOUND.__enum__ = J.AssetType;
  20807. J.AssetType.TEXT = ["TEXT", 5];
  20808. J.AssetType.TEXT.toString = N;
  20809. J.AssetType.TEXT.__enum__ = J.AssetType;
  20810. J.LibraryType = s["openfl.LibraryType"] = {
  20811. __ename__: ["openfl", "LibraryType"],
  20812. __constructs__: ["SWF", "XFL"]
  20813. };
  20814. J.LibraryType.SWF = ["SWF", 0];
  20815. J.LibraryType.SWF.toString = N;
  20816. J.LibraryType.SWF.__enum__ = J.LibraryType;
  20817. J.LibraryType.XFL = ["XFL", 1];
  20818. J.LibraryType.XFL.toString = N;
  20819. J.LibraryType.XFL.__enum__ = J.LibraryType;
  20820. J.display = {};
  20821. J.display.Tilesheet = function (a) {
  20822. this.nmeBitmap = a;
  20823. this.qOffsets = [];
  20824. this.qRects = [];
  20825. this.bounds = new k.geom.Rectangle;
  20826. this.tile = new k.geom.Rectangle;
  20827. this.matrix = new k.geom.Matrix
  20828. };
  20829. s["openfl.display.Tilesheet"] = J.display.Tilesheet;
  20830. J.display.Tilesheet.__name__ = ["openfl", "display", "Tilesheet"];
  20831. J.display.Tilesheet.prototype = {
  20832. drawTiles: function (a, b, d, c) {
  20833. null == c && (c = 0);
  20834. d = a.rec;
  20835. var e = a.len,
  20836. f, l = 0,
  20837. m = b.length,
  20838. h = 0,
  20839. p, k, r = this.bounds,
  20840. Q = this.tile,
  20841. w = this.matrix,
  20842. t, n, q = 0 != (c & 1),
  20843. s = 0 != (c & 2),
  20844. z = 0 != (c & 16),
  20845. x = q || s || z;
  20846. d[e++] = 16;
  20847. d[e++] = this.nmeBitmap;
  20848. d[e++] = c;
  20849. f = e;
  20850. d[e++] = 0;
  20851. 0 != (c & 4) && (h += 3);
  20852. 0 != (c & 8) && h++;
  20853. for (r.setVoid(); l < m;)
  20854. for (d[e++] = t = b[l++], d[e++] = n = b[l++], p = b[l++], c = this.qRects[p], p = this.qOffsets[p], d[e++] = p.x, d[e++] = p.y, d[e++] = c.x, d[e++] = c.y, d[e++] = c.width, d[e++] = c.height, Q.x = -p.x, Q.width = c.width, Q.y = -p.y, Q.height = c.height, x && (w.identity(),
  20855. z ? (d[e++] = w.a = b[l++], d[e++] = w.b = b[l++], d[e++] = w.c = b[l++], d[e++] = w.d = b[l++]) : (q && w.scale(d[e++] = k = b[l++], k), s && w.rotate(d[e++] = b[l++])), w.translate(c.x, c.y), Q.transform(w)), Q.x += t, Q.y += n, r.join(Q), c = 0; c++ < h;) d[e++] = b[l++];
  20856. d[f] = e;
  20857. a.len = e;
  20858. a.grab(r.x, r.y, r.x + r.width, r.y + r.height)
  20859. },
  20860. addTileRect: function (a, b) {
  20861. null == b && (b = new k.geom.Point);
  20862. this.qRects.push(a);
  20863. this.qOffsets.push(b);
  20864. return this.qRects.length - 1
  20865. },
  20866. __class__: J.display.Tilesheet
  20867. };
  20868. var q = {
  20869. OzEvent: function (a) {
  20870. this.target = a
  20871. }
  20872. };
  20873. s["oz.OzEvent"] = q.OzEvent;
  20874. q.OzEvent.__name__ = ["oz", "OzEvent"];
  20875. q.OzEvent.prototype = {
  20876. __class__: q.OzEvent
  20877. };
  20878. q.OzFont = function () {
  20879. this.chars = [];
  20880. this.kernings = []
  20881. };
  20882. s["oz.OzFont"] = q.OzFont;
  20883. q.OzFont.__name__ = ["oz", "OzFont"];
  20884. q.OzFont.prototype = {
  20885. RegisterCharacters: function () {
  20886. this.frames = [];
  20887. this.movieClips = [];
  20888. for (var a = 0, b = 0, d = this.chars.length; b < d;) {
  20889. var c = b++;
  20890. null != this.chars[c] && 32 != c && (this.frames.push([this.chars[c].x, this.chars[c].y, this.chars[c].width, this.chars[c].height, 0, 0]), this.movieClips.push({
  20891. name: this.fontName + "_" + this.chars[c].letter,
  20892. tilesheetId: -1,
  20893. frames: [a]
  20894. }), this.chars[c].movieClip = this.movieClips[this.movieClips.length - 1], a++)
  20895. }
  20896. q.OzSprite.RegisterTilesheet(this.bitmapName, this.movieClips, this.frames);
  20897. this.tilesheetId = this.movieClips[0].tilesheetId
  20898. },
  20899. addKerning: function (a, b, d) {
  20900. null == this.kernings[a] && (this.kernings[a] = []);
  20901. this.kernings[a][b] = d
  20902. },
  20903. __class__: q.OzFont
  20904. };
  20905. q.OzGeometry = function () {};
  20906. s["oz.OzGeometry"] = q.OzGeometry;
  20907. q.OzGeometry.__name__ = ["oz", "OzGeometry"];
  20908. q.OzGeometry.InitPool = function (a) {
  20909. null == a && (a = -1); - 1 == a && (a = 1E4);
  20910. q.OzGeometry.freePointers = [];
  20911. for (var b = 0; b < a;) {
  20912. var d = b++;
  20913. q.OzGeometry.freePointers[d] = new q.OzGeometry
  20914. }
  20915. q.OzGeometry.freePointerId = 0
  20916. };
  20917. q.OzGeometry.GetNew = function () {
  20918. return q.OzGeometry.freePointers[q.OzGeometry.freePointerId++]
  20919. };
  20920. q.OzGeometry.Release = function (a) {
  20921. q.OzGeometry.freePointers[--q.OzGeometry.freePointerId] = a
  20922. };
  20923. q.OzGeometry.prototype = {
  20924. pi: function (a) {
  20925. return K.parseInt(a)
  20926. },
  20927. pf: function (a) {
  20928. return K.parseFloat(a)
  20929. },
  20930. init: function (a, b, d, c, e, f, l, m, h) {
  20931. null == h && (h = !0);
  20932. null == f && (f = 0);
  20933. null == e && (e = 0);
  20934. null ==
  20935. c && (c = 0);
  20936. this.type = a;
  20937. this.x = b;
  20938. this.y = d;
  20939. this.degrees = c;
  20940. if (1 == this.type) this.halfWidth = e, this.halfHeight = f;
  20941. else if (2 == this.type) this.radius = e;
  20942. else if (3 == this.type)
  20943. if (h)
  20944. for (this.vx = [], this.vy = [], a = 0, b = l.length; a < b;) d = a++, this.vx[d] = l[d], this.vy[d] = m[d];
  20945. else this.vx = l, this.vy = m;
  20946. else 4 != this.type && 6 == this.type && (this.halfWidth = e, this.halfHeight = f)
  20947. },
  20948. fromXML: function (a) {
  20949. switch (a.get("type")) {
  20950. case "rect":
  20951. this.init(1, this.pf(a.get("x")), this.pf(a.get("y")), this.pf(a.get("degrees")), this.pf(a.get("halfWidth")),
  20952. this.pf(a.get("halfHeight")));
  20953. break;
  20954. case "poly":
  20955. this.pi(a.get("nVertices"));
  20956. for (var b = a.get("vertices").split(","), d = [], c = [], e = 0, f = b.length / 2 | 0; e < f;) {
  20957. var l = 2 * e++;
  20958. d[l / 2 | 0] = this.pf(b[l]);
  20959. c[l / 2 | 0] = this.pf(b[l + 1])
  20960. }
  20961. this.init(3, this.pf(a.get("x")), this.pf(a.get("y")), this.pf(a.get("degrees")), 0, 0, d, c);
  20962. break;
  20963. case "circ":
  20964. this.init(2, this.pf(a.get("x")), this.pf(a.get("y")), this.pf(a.get("degrees")), this.pf(a.get("radius")));
  20965. break;
  20966. case "line":
  20967. this.x1 = this.pf(a.get("x1"));
  20968. this.x2 = this.pf(a.get("x2"));
  20969. this.y1 =
  20970. this.pf(a.get("y1"));
  20971. this.y2 = this.pf(a.get("y2"));
  20972. this.init(4, this.pf(a.get("x")), this.pf(a.get("y")), 0, 0, 0);
  20973. break;
  20974. case "dot":
  20975. this.init(5, this.pf(a.get("x")), this.pf(a.get("y")));
  20976. break;
  20977. case "trie":
  20978. this.init(6, this.pf(a.get("x")), this.pf(a.get("y")), this.pf(a.get("degrees")), this.pf(a.get("helfWidth")), this.pf(a.get("halfHeight")));
  20979. break;
  20980. default:
  20981. throw new k.errors.Error("Invalid shape Xml type");
  20982. }
  20983. },
  20984. toXML: function () {
  20985. var a = O.createElement("geometry");
  20986. switch (this.type) {
  20987. case 1:
  20988. a.set("type", "rect");
  20989. a.set("x",
  20990. this._f(this.x));
  20991. a.set("y", this._f(this.y));
  20992. a.set("degrees", this._f(this.degrees));
  20993. a.set("halfWidth", this._f(this.halfWidth));
  20994. a.set("halfHeight", this._f(this.halfHeight));
  20995. break;
  20996. case 2:
  20997. a.set("type", "circ");
  20998. a.set("x", this._f(this.x));
  20999. a.set("y", this._f(this.y));
  21000. a.set("degrees", this._f(this.degrees));
  21001. a.set("radius", this._f(this.radius));
  21002. break;
  21003. case 3:
  21004. a.set("type", "poly");
  21005. a.set("x", this._f(this.x));
  21006. a.set("y", this._f(this.y));
  21007. a.set("degrees", this._f(this.degrees));
  21008. a.set("nVertices", "" + this.vx.length);
  21009. for (var b =
  21010. "", d = 0, c = this.vx.length - 1; d < c;) var e = d++,
  21011. b = b + (this._f(this.vx[e]) + "," + this._f(this.vy[e]) + ",");
  21012. b += this._f(this.vx[this.vx.length - 1]) + "," + this._f(this.vy[this.vx.length - 1]);
  21013. a.set("vertices", b);
  21014. break;
  21015. case 4:
  21016. a.set("type", "line");
  21017. a.set("x", this._f(this.x));
  21018. a.set("y", this._f(this.y));
  21019. a.set("x1", this._f(this.x1));
  21020. a.set("y1", this._f(this.y1));
  21021. a.set("x2", this._f(this.x2));
  21022. a.set("y2", this._f(this.y2));
  21023. break;
  21024. case 5:
  21025. a.set("type", "dot");
  21026. a.set("x", this._f(this.x));
  21027. a.set("y", this._f(this.y));
  21028. break;
  21029. case 6:
  21030. a.set("type",
  21031. "tri"), a.set("x", this._f(this.x)), a.set("y", this._f(this.y)), a.set("degrees", this._f(this.degrees)), a.set("halfWidth", this._f(this.halfWidth)), a.set("halfHeight", this._f(this.halfHeight))
  21032. }
  21033. return a
  21034. },
  21035. _f: function (a) {
  21036. return "" + q.OzUtil.round(a, 2)
  21037. },
  21038. pointSelects: function (a, b) {
  21039. var d = !1,
  21040. c = q.OzGeometry.temp2;
  21041. this.applyOriginRotation(a, b, -this.degrees, c);
  21042. switch (this.type) {
  21043. case 1:
  21044. d = Math.abs(this.x - c[0]) < this.halfWidth && Math.abs(this.y - c[1]) < this.halfHeight;
  21045. break;
  21046. case 2:
  21047. d = this.radius * this.radius >= (c[0] - this.x) *
  21048. (c[0] - this.x) + (c[1] - this.y) * (c[1] - this.y);
  21049. break;
  21050. case 3:
  21051. c[0] -= this.x;
  21052. c[1] -= this.y;
  21053. for (var e = d = 0, f = this.vx.length; e < f;) {
  21054. var l = e++,
  21055. m = (l + 1) % this.vx.length;
  21056. this.vy[l] <= c[1] ? this.vy[m] > c[1] && 0 < q.OzUtil.CrossPoints(c[0], c[1], this.vx[l], this.vy[l], this.vx[m], this.vy[m]) && d++ : this.vy[m] <= c[1] && 0 > q.OzUtil.CrossPoints(c[0], c[1], this.vx[l], this.vy[l], this.vx[m], this.vy[m]) && d--
  21057. }
  21058. d = 0 != d;
  21059. break;
  21060. case 6:
  21061. var h, p, e = this.x - this.halfWidth,
  21062. f = this.y + this.halfHeight,
  21063. l = this.x,
  21064. m = this.y - this.halfHeight;
  21065. h = this.x + this.halfWidth;
  21066. p = this.y + this.halfHeight;
  21067. d = (d = (d = 0 <= q.OzUtil.CrossPoints(e, f, l, m, c[0], c[1])) && 0 <= q.OzUtil.CrossPoints(l, m, h, p, c[0], c[1])) && 0 <= q.OzUtil.CrossPoints(h, p, e, f, c[0], c[1]);
  21068. break;
  21069. case 4:
  21070. 5 > q.OzUtil.PointLineDistance(this.x1, this.y1, this.x2, this.y2, c[0] - this.x, c[1] - this.y, !0) && (d = !0);
  21071. break;
  21072. case 5:
  21073. 5 > Math.abs(this.x - c[0]) && 5 > Math.abs(this.y - c[1]) && (d = !0)
  21074. }
  21075. return d
  21076. },
  21077. getMinMaxXY: function (a) {
  21078. a[0] = 2E6;
  21079. a[1] = 2E6;
  21080. a[2] = -2E6;
  21081. a[3] = -2E6;
  21082. var b = q.OzGeometry.temp2;
  21083. switch (this.type) {
  21084. case 1:
  21085. this.applyOriginRotation(this.x - this.halfWidth,
  21086. this.y - this.halfHeight, this.degrees, b);
  21087. this.adjustMinMaxXY(a, b);
  21088. this.applyOriginRotation(this.x + this.halfWidth, this.y - this.halfHeight, this.degrees, b);
  21089. this.adjustMinMaxXY(a, b);
  21090. this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees, b);
  21091. this.adjustMinMaxXY(a, b);
  21092. this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees, b);
  21093. this.adjustMinMaxXY(a, b);
  21094. break;
  21095. case 2:
  21096. a[0] = this.x - this.radius;
  21097. a[1] = this.y - this.radius;
  21098. a[2] = this.x + this.radius;
  21099. a[3] = this.y + this.radius;
  21100. break;
  21101. case 3:
  21102. for (var d = 0, c = this.vx.length; d < c;) {
  21103. var e = d++;
  21104. this.applyOriginRotation(this.vx[e] + this.x, this.vy[e] + this.y, this.degrees, b);
  21105. this.adjustMinMaxXY(a, b)
  21106. }
  21107. break;
  21108. case 6:
  21109. this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees, b);
  21110. this.adjustMinMaxXY(a, b);
  21111. this.applyOriginRotation(this.x, this.y - this.halfHeight, this.degrees, b);
  21112. this.adjustMinMaxXY(a, b);
  21113. this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees, b);
  21114. this.adjustMinMaxXY(a, b);
  21115. break;
  21116. case 4:
  21117. b[0] =
  21118. this.x + this.x1;
  21119. b[1] = this.y + this.y1;
  21120. this.adjustMinMaxXY(a, b);
  21121. b[0] = this.x + this.x2;
  21122. b[1] = this.y + this.y2;
  21123. this.adjustMinMaxXY(a, b);
  21124. break;
  21125. case 5:
  21126. a[0] = this.x - 3, a[1] = this.y - 3, a[2] = this.x + 3, a[3] = this.y + 3
  21127. }
  21128. },
  21129. drawLocalOutline: function (a) {
  21130. switch (this.type) {
  21131. case 1:
  21132. a.moveTo(-this.halfWidth, -this.halfHeight);
  21133. a.lineTo(this.halfWidth, -this.halfHeight);
  21134. a.lineTo(this.halfWidth, this.halfHeight);
  21135. a.lineTo(-this.halfWidth, this.halfHeight);
  21136. a.lineTo(-this.halfWidth, -this.halfHeight);
  21137. break;
  21138. case 2:
  21139. a.drawCircle(0, 0, this.radius);
  21140. break;
  21141. case 3:
  21142. a.moveTo(this.vx[0], this.vy[0]);
  21143. for (var b = 1, d = this.vx.length; b < d;) {
  21144. var c = b++;
  21145. a.lineTo(this.vx[c], this.vy[c])
  21146. }
  21147. a.lineTo(this.vx[0], this.vy[0]);
  21148. break;
  21149. case 6:
  21150. a.moveTo(-this.halfWidth, this.halfHeight), a.lineTo(0, -this.halfHeight), a.lineTo(this.halfWidth, this.halfHeight), a.lineTo(-this.halfWidth, this.halfHeight)
  21151. }
  21152. },
  21153. drawGlobalOutline: function (a, b, d, c) {
  21154. null == c && (c = 0);
  21155. null == d && (d = 0);
  21156. null == b && (b = 0);
  21157. var e = q.OzGeometry.temp2;
  21158. switch (this.type) {
  21159. case 1:
  21160. this.applyOriginRotation(this.x - this.halfWidth,
  21161. this.y - this.halfHeight, this.degrees + c, e);
  21162. a.moveTo(b + e[0], d + e[1]);
  21163. this.applyOriginRotation(this.x + this.halfWidth, this.y - this.halfHeight, this.degrees + c, e);
  21164. a.lineTo(b + e[0], d + e[1]);
  21165. this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
  21166. a.lineTo(b + e[0], d + e[1]);
  21167. this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
  21168. a.lineTo(b + e[0], d + e[1]);
  21169. this.applyOriginRotation(this.x - this.halfWidth, this.y - this.halfHeight, this.degrees + c, e);
  21170. a.lineTo(b + e[0],
  21171. d + e[1]);
  21172. break;
  21173. case 2:
  21174. a.drawCircle(b + this.x, d + this.y, this.radius);
  21175. break;
  21176. case 3:
  21177. this.applyOriginRotation(this.vx[0] + this.x, this.vy[0] + this.y, this.degrees, e);
  21178. a.moveTo(b + e[0], d + e[1]);
  21179. c = 1;
  21180. for (var f = this.vx.length; c < f;) {
  21181. var l = c++;
  21182. this.applyOriginRotation(this.vx[l] + this.x, this.vy[l] + this.y, this.degrees, e);
  21183. a.lineTo(b + e[0], d + e[1])
  21184. }
  21185. this.applyOriginRotation(this.vx[0] + this.x, this.vy[0] + this.y, this.degrees, e);
  21186. a.lineTo(b + e[0], d + e[1]);
  21187. break;
  21188. case 6:
  21189. this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight,
  21190. this.degrees + c, e);
  21191. a.moveTo(b + e[0], d + e[1]);
  21192. this.applyOriginRotation(this.x, this.y - this.halfHeight, this.degrees + c, e);
  21193. a.lineTo(b + e[0], d + e[1]);
  21194. this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
  21195. a.lineTo(b + e[0], d + e[1]);
  21196. this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
  21197. a.lineTo(b + e[0], d + e[1]);
  21198. break;
  21199. case 5:
  21200. a.drawCircle(b + this.x, d + this.y, 3);
  21201. break;
  21202. case 4:
  21203. this.applyOriginRotation(this.x + this.x1, this.y + this.y1, this.degrees + c, e), a.moveTo(b +
  21204. e[0], d + e[1]), this.applyOriginRotation(this.x + this.x2, this.y + this.y2, this.degrees + c, e), a.lineTo(b + e[0], d + e[1])
  21205. }
  21206. },
  21207. adjustMinMaxXY: function (a, b) {
  21208. a[0] = Math.min(a[0], b[0]);
  21209. a[1] = Math.min(a[1], b[1]);
  21210. a[2] = Math.max(a[2], b[0]);
  21211. a[3] = Math.max(a[3], b[1])
  21212. },
  21213. applyOriginRotation: function (a, b, d, c) {
  21214. q.OzUtil.rotateAroundPoint(a, b, d, this.x, this.y, c)
  21215. },
  21216. makePhysics: function (a) {
  21217. switch (this.type) {
  21218. case 1:
  21219. var b = new h.shape.Polygon(h.shape.Polygon.box(2 * this.halfWidth, 2 * this.halfHeight));
  21220. b.zpp_inner.immutable_midstep("Shape::body");
  21221. (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null) != a && (null != b.zpp_inner.body && (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null).zpp_inner.wrap_shapes.remove(b), null != a && a.zpp_inner.wrap_shapes.add(b));
  21222. null != b.zpp_inner.body ? b.zpp_inner.body.outer : null;
  21223. break;
  21224. case 2:
  21225. b = new h.shape.Circle(this.radius);
  21226. b.zpp_inner.immutable_midstep("Shape::body");
  21227. (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null) != a && (null != b.zpp_inner.body && (null != b.zpp_inner.body ? b.zpp_inner.body.outer : null).zpp_inner.wrap_shapes.remove(b),
  21228. null != a && a.zpp_inner.wrap_shapes.add(b));
  21229. null != b.zpp_inner.body ? b.zpp_inner.body.outer : null;
  21230. break;
  21231. case 3:
  21232. for (var b = [], d = 0, c = this.vx.length; d < c;) {
  21233. var e = d++;
  21234. b[e] = new h.geom.Vec2(this.vx[e], this.vy[e])
  21235. }(new h.geom.GeomPoly(b)).convexDecomposition().foreach(function (b) {
  21236. a.zpp_inner.wrap_shapes.add(new h.shape.Polygon(b))
  21237. });
  21238. break;
  21239. default:
  21240. throw new k.errors.Error("unsupported nape geo");
  21241. }
  21242. },
  21243. __class__: q.OzGeometry
  21244. };
  21245. q.OzMatrix = function () {
  21246. this.identity()
  21247. };
  21248. s["oz.OzMatrix"] = q.OzMatrix;
  21249. q.OzMatrix.__name__ = ["oz",
  21250. "OzMatrix"
  21251. ];
  21252. q.OzMatrix.getCurrentMatrix = function () {
  21253. return q.OzMatrix.matrixStack[q.OzMatrix.matrixId]
  21254. };
  21255. q.OzMatrix.InitPool = function () {
  21256. q.OzMatrix.matrixStack = [];
  21257. for (var a = 0; 1E3 > a;) {
  21258. var b = a++;
  21259. q.OzMatrix.matrixStack[b] = new q.OzMatrix
  21260. }
  21261. q.OzMatrix.matrixId = 0;
  21262. q.OzMatrix.DEG2RAD = Math.PI / 180;
  21263. q.OzMatrix.RAD2DEG = 180 / Math.PI;
  21264. q.OzMatrix.um = new q.OzMatrix
  21265. };
  21266. q.OzMatrix.PreMatrixMultiply = function (a) {
  21267. var b = q.OzMatrix.matrixStack[q.OzMatrix.matrixId];
  21268. q.OzMatrix.Multiply(b, a, b)
  21269. };
  21270. q.OzMatrix.PostMatrixMultiply = function (a) {
  21271. var b =
  21272. q.OzMatrix.matrixStack[q.OzMatrix.matrixId];
  21273. new k.geom.Matrix;
  21274. q.OzMatrix.Multiply(b, b, a)
  21275. };
  21276. q.OzMatrix.PushMatrix = function () {
  21277. q.OzMatrix.matrixStack[q.OzMatrix.matrixId + 1].copy(q.OzMatrix.matrixStack[q.OzMatrix.matrixId]);
  21278. q.OzMatrix.matrixId++
  21279. };
  21280. q.OzMatrix.PopMatrix = function () {
  21281. q.OzMatrix.matrixId--
  21282. };
  21283. q.OzMatrix.getTemp = function (a) {
  21284. return q.OzMatrix.matrixStack[q.OzMatrix.matrixId + a]
  21285. };
  21286. q.OzMatrix.Multiply = function (a, b, d) {
  21287. var c = b.m00 * d.m01 + b.m01 * d.m11 + b.m02 * d.m21,
  21288. e = b.m00 * d.m02 + b.m01 * d.m12 + b.m02 * d.m22,
  21289. f = b.m10 *
  21290. d.m00 + b.m11 * d.m10 + b.m12 * d.m20,
  21291. l = b.m10 * d.m01 + b.m11 * d.m11 + b.m12 * d.m21,
  21292. m = b.m10 * d.m02 + b.m11 * d.m12 + b.m12 * d.m22,
  21293. h = b.m20 * d.m00 + b.m21 * d.m10 + b.m22 * d.m20,
  21294. p = b.m20 * d.m01 + b.m21 * d.m11 + b.m22 * d.m21,
  21295. k = b.m20 * d.m02 + b.m21 * d.m12 + b.m22 * d.m22;
  21296. a.m00 = b.m00 * d.m00 + b.m01 * d.m10 + b.m02 * d.m20;
  21297. a.m01 = c;
  21298. a.m02 = e;
  21299. a.m10 = f;
  21300. a.m11 = l;
  21301. a.m12 = m;
  21302. a.m20 = h;
  21303. a.m21 = p;
  21304. a.m22 = k;
  21305. a.transformed = !0
  21306. };
  21307. q.OzMatrix.prototype = {
  21308. toMatrix: function (a) {
  21309. a.a = this.m00;
  21310. a.c = this.m01;
  21311. a.tx = this.m02;
  21312. a.b = this.m10;
  21313. a.d = this.m11;
  21314. a.ty = this.m12
  21315. },
  21316. fromMatrix: function (a) {
  21317. this.m00 = a.a;
  21318. this.m01 = a.c;
  21319. this.m02 = a.tx;
  21320. this.m10 = a.b;
  21321. this.m11 = a.d;
  21322. this.m12 = a.ty;
  21323. this.m21 = this.m20 = 0;
  21324. this.m22 = 1;
  21325. this.transformed = !0
  21326. },
  21327. Scaling: function (a, b) {
  21328. this.m00 = a;
  21329. this.m10 = this.m02 = this.m01 = 0;
  21330. this.m11 = b;
  21331. this.m21 = this.m20 = this.m12 = 0;
  21332. this.m22 = 1;
  21333. this.transformed = !0
  21334. },
  21335. Translation: function (a, b) {
  21336. this.m00 = 1;
  21337. this.m01 = 0;
  21338. this.m02 = a;
  21339. this.m10 = 0;
  21340. this.m11 = 1;
  21341. this.m12 = b;
  21342. this.m21 = this.m20 = 0;
  21343. this.m22 = 1;
  21344. this.transformed = !1
  21345. },
  21346. Rotation: function (a) {
  21347. a *= q.OzMatrix.DEG2RAD;
  21348. this.m00 = Math.cos(a);
  21349. this.m01 = -Math.sin(a);
  21350. this.m02 = 0;
  21351. this.m10 = -this.m01;
  21352. this.m11 = this.m00;
  21353. this.m21 = this.m20 = this.m12 = 0;
  21354. this.m22 = 1;
  21355. this.transformed = !0
  21356. },
  21357. toString: function () {
  21358. var a = "Matrix Transformed = " + K.string(this.transformed) + "\n",
  21359. a = a + ("{" + this.m00 + ":" + this.m01 + ":" + this.m02 + "}\n"),
  21360. a = a + ("{" + this.m10 + ":" + this.m11 + ":" + this.m12 + "}\n");
  21361. return a += "{" + this.m20 + ":" + this.m21 + ":" + this.m22 + "}\n"
  21362. },
  21363. rotate: function (a) {
  21364. q.OzMatrix.um.Rotation(a);
  21365. q.OzMatrix.Multiply(this, q.OzMatrix.um, this)
  21366. },
  21367. scale: function (a, b) {
  21368. q.OzMatrix.um.Scaling(a, b);
  21369. q.OzMatrix.Multiply(this, q.OzMatrix.um,
  21370. this)
  21371. },
  21372. translate: function (a, b) {
  21373. q.OzMatrix.um.Translation(a, b);
  21374. q.OzMatrix.Multiply(this, q.OzMatrix.um, this)
  21375. },
  21376. PostRotate: function (a) {
  21377. q.OzMatrix.um.Rotation(a);
  21378. q.OzMatrix.Multiply(this, this, q.OzMatrix.um)
  21379. },
  21380. PostScale: function (a, b) {
  21381. q.OzMatrix.um.Scaling(a, b);
  21382. q.OzMatrix.Multiply(this, this, q.OzMatrix.um)
  21383. },
  21384. PostTranslate: function (a, b) {
  21385. q.OzMatrix.um.Translation(a, b);
  21386. q.OzMatrix.Multiply(this, this, q.OzMatrix.um)
  21387. },
  21388. copy: function (a) {
  21389. this.m00 = a.m00;
  21390. this.m01 = a.m01;
  21391. this.m02 = a.m02;
  21392. this.m10 = a.m10;
  21393. this.m11 = a.m11;
  21394. this.m12 =
  21395. a.m12;
  21396. this.m20 = a.m20;
  21397. this.m21 = a.m21;
  21398. this.m22 = a.m22
  21399. },
  21400. identity: function () {
  21401. this.m00 = 1;
  21402. this.m10 = this.m02 = this.m01 = 0;
  21403. this.m11 = 1;
  21404. this.m21 = this.m20 = this.m12 = 0;
  21405. this.m22 = 1;
  21406. this.transformed = !1
  21407. },
  21408. __class__: q.OzMatrix
  21409. };
  21410. q.SpriteType = s["oz.SpriteType"] = {
  21411. __ename__: ["oz", "SpriteType"],
  21412. __constructs__: ["EMPTY", "BITMAP", "TEXT", "POLYGON"]
  21413. };
  21414. q.SpriteType.EMPTY = ["EMPTY", 0];
  21415. q.SpriteType.EMPTY.toString = N;
  21416. q.SpriteType.EMPTY.__enum__ = q.SpriteType;
  21417. q.SpriteType.BITMAP = ["BITMAP", 1];
  21418. q.SpriteType.BITMAP.toString = N;
  21419. q.SpriteType.BITMAP.__enum__ =
  21420. q.SpriteType;
  21421. q.SpriteType.TEXT = ["TEXT", 2];
  21422. q.SpriteType.TEXT.toString = N;
  21423. q.SpriteType.TEXT.__enum__ = q.SpriteType;
  21424. q.SpriteType.POLYGON = ["POLYGON", 3];
  21425. q.SpriteType.POLYGON.toString = N;
  21426. q.SpriteType.POLYGON.__enum__ = q.SpriteType;
  21427. q.TextAlign = s["oz.TextAlign"] = {
  21428. __ename__: ["oz", "TextAlign"],
  21429. __constructs__: ["LEFT", "RIGHT", "CENTER", "JUSTIFIED"]
  21430. };
  21431. q.TextAlign.LEFT = ["LEFT", 0];
  21432. q.TextAlign.LEFT.toString = N;
  21433. q.TextAlign.LEFT.__enum__ = q.TextAlign;
  21434. q.TextAlign.RIGHT = ["RIGHT", 1];
  21435. q.TextAlign.RIGHT.toString = N;
  21436. q.TextAlign.RIGHT.__enum__ =
  21437. q.TextAlign;
  21438. q.TextAlign.CENTER = ["CENTER", 2];
  21439. q.TextAlign.CENTER.toString = N;
  21440. q.TextAlign.CENTER.__enum__ = q.TextAlign;
  21441. q.TextAlign.JUSTIFIED = ["JUSTIFIED", 3];
  21442. q.TextAlign.JUSTIFIED.toString = N;
  21443. q.TextAlign.JUSTIFIED.__enum__ = q.TextAlign;
  21444. q.OzSprite = function (a, b) {
  21445. this.reset();
  21446. null == b && (b = q.SpriteType.EMPTY);
  21447. this.mc = a;
  21448. this.type = null != a ? q.SpriteType.BITMAP : b;
  21449. b == q.SpriteType.POLYGON ? this.flSprite = new k.display.Sprite : b == q.SpriteType.TEXT && (this.textAlign = q.TextAlign.LEFT, this.text = "")
  21450. };
  21451. s["oz.OzSprite"] = q.OzSprite;
  21452. q.OzSprite.__name__ = ["oz", "OzSprite"];
  21453. q.OzSprite.StaticInit = function () {
  21454. q.OzSprite.TilesheetId = -1;
  21455. q.OzSprite.DrawingAlpha = !1;
  21456. q.OzSprite.FloatArrays = new y.ds.IntMap;
  21457. q.OzSprite.DrawArray = [];
  21458. for (var a = q.OzSprite.DrawArrayLength = 0; 5E3 > a;) a++, q.OzSprite.DrawArray.push(0);
  21459. q.OzSprite.Tilesheets = [];
  21460. q.OzSprite.Bitmaps = [];
  21461. q.OzSprite.BitmapsIds = [];
  21462. q.OzSprite.BitmapsNames = [];
  21463. q.OzSprite.TilesheetFrames = [];
  21464. q.OzSprite.TilesheetBitmapDatas = [];
  21465. q.OzSprite.DrawMatrix = new k.geom.Matrix;
  21466. q.OzSprite.DrawPoint = new k.geom.Point;
  21467. q.OzSprite.DrawRect = new k.geom.Rectangle;
  21468. q.OzSprite.AlphaColorTransform = new k.geom.ColorTransform
  21469. };
  21470. q.OzSprite.RegisterTilesheet = function (a, b, d) {
  21471. a = J.Assets.getBitmapData("assets/" + a);
  21472. for (var c = new J.display.Tilesheet(a), e = 0, f = d.length; e < f;) {
  21473. var l = e++;
  21474. c.addTileRect(new k.geom.Rectangle(d[l][0], d[l][1], d[l][2], d[l][3]), new k.geom.Point(d[l][4], d[l][5]))
  21475. }
  21476. for (var m = q.OzSprite.Tilesheets.length, e = 0, f = b.length; e < f;) l = e++, b[l].tilesheetId = m, q.OzSprite.Bitmaps.push(b[l]), q.OzSprite.BitmapsIds.push(q.OzSprite.BitmapsIds.length),
  21477. q.OzSprite.BitmapsNames.push(b[l].name);
  21478. q.OzSprite.Tilesheets.push(c);
  21479. q.OzSprite.TilesheetFrames.push(d);
  21480. q.OzSprite.TilesheetBitmapDatas.push([]);
  21481. e = 0;
  21482. for (f = d.length; e < f;) l = e++, b = new k.display.BitmapData(Math.floor(d[l][2]), Math.floor(d[l][3])), q.OzSprite.DrawRect.x = d[l][0], q.OzSprite.DrawRect.y = d[l][1], q.OzSprite.DrawRect.width = d[l][2], q.OzSprite.DrawRect.height = d[l][3], q.OzSprite.DrawPoint.x = q.OzSprite.DrawPoint.y = 0, b.copyPixels(a, q.OzSprite.DrawRect, q.OzSprite.DrawPoint), q.OzSprite.TilesheetBitmapDatas[m].push(b);
  21483. return m
  21484. };
  21485. q.OzSprite.GetSpriteAtPoint = function (a, b, d, c, e, f, l, m) {
  21486. null == m && (m = 0);
  21487. null == l && (l = 1);
  21488. null == f && (f = 1);
  21489. null == e && (e = 0);
  21490. null == c && (c = 0);
  21491. if (1E-4 > a.alpha || !1 == a.visible) return null;
  21492. if (null != a.child) {
  21493. var h = a.child.prev,
  21494. p = h;
  21495. do {
  21496. var k = q.OzSprite.GetSpriteAtPoint(h, b, d, c + a.x * f, e + a.y * l, f * a.scaleX, l * a.scaleY, m * a.rotation);
  21497. if (null != k) return k;
  21498. h = h.prev
  21499. } while (h != p)
  21500. }
  21501. return a.type == q.SpriteType.BITMAP && a.mouseEnabled && (m = q.OzSprite.TilesheetFrames[a.mc.tilesheetId][a.mc.frames[a.currentFrame - 1]], h = c + a.x + (m[2] -
  21502. m[4]) * a.scaleX * f, c + a.x - m[4] * a.scaleX * f <= b && b <= h && (b = e + a.y + (m[3] - m[5]) * a.scaleY * l, e + a.y - m[5] * a.scaleY * l <= d && d <= b)) ? a : null
  21503. };
  21504. q.OzSprite.Flush = function () {
  21505. if (0 < q.OzSprite.DrawArrayLength) {
  21506. if (q.OzSprite.DrawingAlpha)
  21507. for (var a = 0, b = q.OzSprite.DrawArrayLength / 8 | 0; a < b;) {
  21508. var d = a++,
  21509. d = 8 * d;
  21510. q.OzSprite.DrawMatrix.tx = q.OzSprite.DrawArray[d];
  21511. q.OzSprite.DrawMatrix.ty = q.OzSprite.DrawArray[d + 1];
  21512. q.OzSprite.DrawMatrix.a = q.OzSprite.DrawArray[d + 3];
  21513. q.OzSprite.DrawMatrix.b = q.OzSprite.DrawArray[d + 4];
  21514. q.OzSprite.DrawMatrix.c =
  21515. q.OzSprite.DrawArray[d + 5];
  21516. q.OzSprite.DrawMatrix.d = q.OzSprite.DrawArray[d + 6];
  21517. q.OzSprite.AlphaColorTransform.alphaMultiplier = q.OzSprite.DrawArray[d + 7];
  21518. R.instance.ScreenBMD.draw(q.OzSprite.TilesheetBitmapDatas[q.OzSprite.TilesheetId][q.OzSprite.DrawArray[d + 2] | 0], q.OzSprite.DrawMatrix, q.OzSprite.AlphaColorTransform, null, null, !0)
  21519. } else
  21520. for (a = 0, b = q.OzSprite.DrawArrayLength / 7 | 0; a < b;) d = a++, d *= 7, q.OzSprite.DrawMatrix.tx = q.OzSprite.DrawArray[d], q.OzSprite.DrawMatrix.ty = q.OzSprite.DrawArray[d + 1], q.OzSprite.DrawMatrix.a =
  21521. q.OzSprite.DrawArray[d + 3], q.OzSprite.DrawMatrix.b = q.OzSprite.DrawArray[d + 4], q.OzSprite.DrawMatrix.c = q.OzSprite.DrawArray[d + 5], q.OzSprite.DrawMatrix.d = q.OzSprite.DrawArray[d + 6], 1 == q.OzSprite.DrawMatrix.a && 1 == q.OzSprite.DrawMatrix.d && 0 == q.OzSprite.DrawMatrix.c && 0 == q.OzSprite.DrawMatrix.b ? (d = q.OzSprite.TilesheetBitmapDatas[q.OzSprite.TilesheetId][q.OzSprite.DrawArray[d + 2] | 0], q.OzSprite.DrawRect.x = 0, q.OzSprite.DrawRect.y = 0, q.OzSprite.DrawRect.width = d.component.width, q.OzSprite.DrawRect.height = d.component.height,
  21522. q.OzSprite.DrawPoint.x = q.OzSprite.DrawMatrix.tx, q.OzSprite.DrawPoint.y = q.OzSprite.DrawMatrix.ty, R.instance.ScreenBMD.copyPixels(d, q.OzSprite.DrawRect, q.OzSprite.DrawPoint, null, null, !0)) : R.instance.ScreenBMD.draw(q.OzSprite.TilesheetBitmapDatas[q.OzSprite.TilesheetId][q.OzSprite.DrawArray[d + 2] | 0], q.OzSprite.DrawMatrix, null, null, null, !0);
  21523. q.OzSprite.DrawArrayLength = 0
  21524. }
  21525. };
  21526. q.OzSprite.prototype = {
  21527. getLineLength: function (a) {
  21528. null == a && (a = 0);
  21529. for (var b = 0; a != S.cca("\n", 0) && a < this.text.length;) {
  21530. var d = S.cca(this.text,
  21531. a),
  21532. c = this.font.chars[d],
  21533. c = c.xOffset + c.xAdvance;
  21534. if (0 < a) {
  21535. var e = S.cca(this.text, a - 1);
  21536. null == this.font.kernings[e] || Math.isNaN(this.font.kernings[e][d]) || (c += this.font.kernings[e][d])
  21537. }
  21538. b += c;
  21539. a++
  21540. }
  21541. return b
  21542. },
  21543. draw: function (a) {
  21544. null == a && (a = 1);
  21545. a *= this.alpha;
  21546. if (this.visible && !(0.001 > a)) {
  21547. q.OzMatrix.PushMatrix();
  21548. if (this.type == q.SpriteType.EMPTY) {
  21549. var b = q.OzMatrix.getCurrentMatrix();
  21550. this.rotation %= 360;
  21551. b.PostTranslate(this.x, this.y);
  21552. b.PostRotate(this.rotation);
  21553. b.PostScale(this.scaleX, this.scaleY)
  21554. } else if (this.type ==
  21555. q.SpriteType.BITMAP) {
  21556. -1 == q.OzSprite.TilesheetId && (q.OzSprite.TilesheetId = this.mc.tilesheetId);
  21557. q.OzSprite.TilesheetId != this.mc.tilesheetId && (q.OzSprite.Flush(), q.OzSprite.TilesheetId = this.mc.tilesheetId);
  21558. if (0.999 > a && !q.OzSprite.DrawingAlpha || 0.999 < a && q.OzSprite.DrawingAlpha) q.OzSprite.Flush(), q.OzSprite.DrawingAlpha = !q.OzSprite.DrawingAlpha;
  21559. b = q.OzMatrix.getCurrentMatrix();
  21560. this.rotation %= 360;
  21561. b.PostTranslate(this.x, this.y);
  21562. b.PostRotate(this.rotation);
  21563. b.PostScale(this.scaleX, this.scaleY);
  21564. var d;
  21565. d = q.OzSprite.TilesheetFrames[this.mc.tilesheetId][this.mc.frames[this.currentFrame -
  21566. 1]];
  21567. var c = q.OzMatrix.getTemp(1);
  21568. c.Translation(-d[4], -d[5]);
  21569. q.OzMatrix.Multiply(c, b, c);
  21570. q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m02;
  21571. q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m12;
  21572. q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = this.mc.frames[this.currentFrame - 1];
  21573. q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m00;
  21574. q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m10;
  21575. q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m01;
  21576. q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] =
  21577. c.m11;
  21578. q.OzSprite.DrawingAlpha && (q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = a);
  21579. this.playing && (this.currentFrame = 1 + this.currentFrame % this.mc.frames.length)
  21580. } else if (this.type == q.SpriteType.POLYGON) {
  21581. q.OzSprite.Flush();
  21582. b = q.OzMatrix.getCurrentMatrix();
  21583. this.rotation %= 360;
  21584. if (0.999 > a && !q.OzSprite.DrawingAlpha || 0.999 < a && q.OzSprite.DrawingAlpha) q.OzSprite.DrawingAlpha = !q.OzSprite.DrawingAlpha;
  21585. b.PostTranslate(this.x, this.y);
  21586. b.PostRotate(this.rotation);
  21587. b.PostScale(this.scaleX, this.scaleY);
  21588. b.toMatrix(q.OzSprite.DrawMatrix);
  21589. q.OzSprite.DrawingAlpha ? (q.OzSprite.AlphaColorTransform.alphaMultiplier = a, R.instance.ScreenBMD.draw(this.flSprite, q.OzSprite.DrawMatrix, q.OzSprite.AlphaColorTransform, null, null, !0)) : R.instance.ScreenBMD.draw(this.flSprite, q.OzSprite.DrawMatrix, null, null, null, !0)
  21590. } else if (this.type == q.SpriteType.TEXT) {
  21591. -1 == q.OzSprite.TilesheetId && (q.OzSprite.TilesheetId = this.font.tilesheetId);
  21592. q.OzSprite.TilesheetId != this.font.tilesheetId && (q.OzSprite.Flush(), q.OzSprite.TilesheetId = this.font.tilesheetId);
  21593. if (0.999 > a &&
  21594. !q.OzSprite.DrawingAlpha || 0.999 < a && q.OzSprite.DrawingAlpha) q.OzSprite.Flush(), q.OzSprite.DrawingAlpha = !q.OzSprite.DrawingAlpha;
  21595. q.OzMatrix.PushMatrix();
  21596. d = q.OzMatrix.getCurrentMatrix();
  21597. var e = 0;
  21598. this.textAlign == q.TextAlign.CENTER ? e = -this.getLineLength() / 2 : this.textAlign == q.TextAlign.RIGHT && (e = -this.getLineLength());
  21599. c = 0;
  21600. b = q.OzMatrix.getCurrentMatrix();
  21601. b.PostTranslate(this.x + e, this.y + 0);
  21602. b.PostRotate(this.rotation);
  21603. b.PostScale(this.scaleX, this.scaleY);
  21604. for (var e = 0, f = this.text.length; e < f;) {
  21605. var l = e++;
  21606. this.rotation %=
  21607. 360;
  21608. var m = S.cca(this.text, l),
  21609. h = this.font.chars[m],
  21610. p = h.xOffset;
  21611. if (0 < l) {
  21612. var k = S.cca(this.text, l - 1),
  21613. p = p + this.font.chars[k].xAdvance;
  21614. null == this.font.kernings[k] || Math.isNaN(this.font.kernings[k][m]) || (p += this.font.kernings[k][m])
  21615. }
  21616. h = 0 + h.yOffset - c;
  21617. c += h;
  21618. b.PostTranslate(p, h);
  21619. 32 != m && (q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = d.m02, q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = d.m12, q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = this.font.chars[S.cca(this.text, l)].movieClip.frames[0], q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] =
  21620. d.m00, q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = d.m10, q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = d.m01, q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = d.m11, q.OzSprite.DrawingAlpha && (q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = a))
  21621. }
  21622. q.OzMatrix.PopMatrix()
  21623. }
  21624. if (null != this.child) {
  21625. b = this.child;
  21626. do b.draw(a), b = b.next; while (b != this.child)
  21627. }
  21628. q.OzMatrix.PopMatrix()
  21629. }
  21630. },
  21631. getTotalRotation: function () {
  21632. return null == this.parent ? this.rotation : this.rotation + this.parent.getTotalRotation()
  21633. },
  21634. addChild: function (a) {
  21635. if (null !=
  21636. a)
  21637. if (null != a.parent && a.parent.removeChild(a), a.parent = this, null == this.child) this.child = a, a.prev = a, a.next = a;
  21638. else {
  21639. var b = this.child.prev,
  21640. d = this.child;
  21641. b.next = a;
  21642. d.prev = a;
  21643. a.prev = b;
  21644. a.next = d
  21645. }
  21646. },
  21647. removeChildren: function () {
  21648. for (y.Log.trace("new call", {
  21649. fileName: "OzSprite.hx",
  21650. lineNumber: 230,
  21651. className: "oz.OzSprite",
  21652. methodName: "removeChildren"
  21653. }); null != this.child;) this.child.removeChildren(), this.removeChild(this.child), y.Log.trace(null == this.child, {
  21654. fileName: "OzSprite.hx",
  21655. lineNumber: 234,
  21656. className: "oz.OzSprite",
  21657. methodName: "removeChildren",
  21658. customParams: ["is null?"]
  21659. });
  21660. y.Log.trace("end call", {
  21661. fileName: "OzSprite.hx",
  21662. lineNumber: 236,
  21663. className: "oz.OzSprite",
  21664. methodName: "removeChildren"
  21665. })
  21666. },
  21667. clear: function () {
  21668. this.removeChildren();
  21669. y.Log.trace("remove children end", {
  21670. fileName: "OzSprite.hx",
  21671. lineNumber: 226,
  21672. className: "oz.OzSprite",
  21673. methodName: "clear"
  21674. });
  21675. this.type = q.SpriteType.EMPTY
  21676. },
  21677. removeChild: function (a) {
  21678. if (null != a && a.parent == this) {
  21679. this.child == a && (this.child = this.child.next == this.child ? null : this.child.next);
  21680. var b = a.prev,
  21681. d = a.next;
  21682. null != b && (b.next = d);
  21683. null != d && (d.prev = b);
  21684. a.prev = a;
  21685. a.next = a;
  21686. a.parent = null
  21687. }
  21688. },
  21689. changeMC: function (a) {
  21690. this.mc = a;
  21691. this.currentFrame = 1
  21692. },
  21693. getChild: function (a) {
  21694. if (null != this.child) {
  21695. var b = this.child;
  21696. do {
  21697. if (null != b.name && b.name == a) return b;
  21698. b = b.next
  21699. } while (b != this.child)
  21700. }
  21701. return null
  21702. },
  21703. init: function () {},
  21704. play: function () {
  21705. this.playing = !0
  21706. },
  21707. stop: function () {
  21708. this.playing = !1
  21709. },
  21710. gotoAndStop: function (a) {
  21711. 1 > a || a > this.mc.frames.length ? y.Log.trace("Error! Invalid frame", {
  21712. fileName: "OzSprite.hx",
  21713. lineNumber: 179,
  21714. className: "oz.OzSprite",
  21715. methodName: "gotoAndStop",
  21716. customParams: [a]
  21717. }) : this.currentFrame = a;
  21718. this.playing = !1
  21719. },
  21720. reset: function () {
  21721. this.parent = this.child = this.mc = null;
  21722. this.next = this;
  21723. this.prev = this;
  21724. this.x = this.y = this.rotation = 0;
  21725. this.scaleX = this.scaleY = 1;
  21726. this.type = q.SpriteType.EMPTY;
  21727. this.alpha = 1;
  21728. this.mouseEnabled = this.visible = !0;
  21729. this.currentFrame = 1;
  21730. this.playing = !0
  21731. },
  21732. addEventListener: function (a, b) {
  21733. null == this.eventListeners && (this.eventListeners = new y.ds.IntMap);
  21734. this.eventListeners.set(a, b)
  21735. },
  21736. setxy: function (a, b) {
  21737. this.x = a;
  21738. this.y = b
  21739. },
  21740. __class__: q.OzSprite
  21741. };
  21742. q.OzUtil =
  21743. function () {};
  21744. s["oz.OzUtil"] = q.OzUtil;
  21745. q.OzUtil.__name__ = ["oz", "OzUtil"];
  21746. q.OzUtil.SortIdsByName = function (a, b) {
  21747. var d, c;
  21748. for (d = a.length - 1; 0 <= d;) {
  21749. for (c = 0; c < d;) {
  21750. if (b[c] > b[c + 1]) {
  21751. var e = b[c];
  21752. b[c] = b[c + 1];
  21753. b[c + 1] = e;
  21754. e = a[c];
  21755. a[c] = a[c + 1];
  21756. a[c + 1] = e
  21757. }
  21758. c++
  21759. }
  21760. d--
  21761. }
  21762. };
  21763. q.OzUtil.FindStringId = function (a, b) {
  21764. for (var d = -1, c = a.length; d + 1 < c;) {
  21765. var e = Math.floor((d + c) / 2);
  21766. if (a[e] < b) d = e;
  21767. else if (a[e] > b) c = e;
  21768. else return e
  21769. }
  21770. return -1
  21771. };
  21772. q.OzUtil.PointInsideSegment = function (a, b, d) {
  21773. return b <= a && a <= d
  21774. };
  21775. q.OzUtil.round = function (a, b) {
  21776. null == b && (b = 2);
  21777. for (var d =
  21778. 1, c = 0; c < b;) c++, d *= 10;
  21779. return Math.round(a * d) / d
  21780. };
  21781. q.OzUtil.rotateAroundPoint = function (a, b, d, c, e, f) {
  21782. var l = Math.sin(d / 180 * Math.PI);
  21783. d = Math.cos(d / 180 * Math.PI);
  21784. a -= c;
  21785. b -= e;
  21786. f[0] = c + a * d - b * l;
  21787. f[1] = e + b * d + a * l
  21788. };
  21789. q.OzUtil.DotPoints = function (a, b, d, c, e, f, l, m) {
  21790. return (d - a) * (l - e) + (c - b) * (m - f)
  21791. };
  21792. q.OzUtil.CrossPoints = function (a, b, d, c, e, f) {
  21793. return (d - a) * (f - b) - (c - b) * (e - a)
  21794. };
  21795. q.OzUtil.AnglePoints = function (a, b, d, c, e, f) {
  21796. var l = q.OzUtil.DistancePoints(a, b, d, c) * q.OzUtil.DistancePoints(d, c, e, f);
  21797. return 1E-6 > Math.abs(l) ? 0 : 180 / Math.PI * Math.acos(q.OzUtil.DotPoints(d,
  21798. c, a, b, d, c, e, f) / l)
  21799. };
  21800. q.OzUtil.DistancePoints = function (a, b, d, c) {
  21801. a -= d;
  21802. b -= c;
  21803. return Math.sqrt(a * a + b * b)
  21804. };
  21805. q.OzUtil.PointLineDistance = function (a, b, d, c, e, f, l) {
  21806. var m = q.OzUtil.CrossPoints(a, b, d, c, e, f) / q.OzUtil.DistancePoints(a, b, d, c);
  21807. if (l) {
  21808. if (0 < q.OzUtil.DotPoints(a, b, d, c, d, c, e, f)) return q.OzUtil.DistancePoints(d, c, e, f);
  21809. if (0 < q.OzUtil.DotPoints(d, c, a, b, a, b, e, f)) return q.OzUtil.DistancePoints(a, b, e, f)
  21810. }
  21811. return Math.abs(m)
  21812. };
  21813. q.OzUtil.LineSegmentCrossOrLie = function (a, b, d, c, e, f, l, m) {
  21814. return Math.max(a, d) < Math.min(e, l) ||
  21815. Math.min(a, d) > Math.max(e, l) || Math.max(c, b) < Math.min(f, m) || Math.min(b, c) > Math.max(f, m) || 0 < q.OzUtil.CrossPoints(a, b, d, c, e, f) * q.OzUtil.CrossPoints(a, b, d, c, l, m) ? !1 : 0 >= q.OzUtil.CrossPoints(e, f, l, m, a, b) * q.OzUtil.CrossPoints(e, f, l, m, d, c)
  21816. };
  21817. q.OzUtil.LineSegmentCross = function (a, b, d, c, e, f, l, m) {
  21818. return Math.max(a, d) < Math.min(e, l) || Math.min(a, d) > Math.max(e, l) || Math.max(c, b) < Math.min(f, m) || Math.min(b, c) > Math.max(f, m) || 0 < q.OzUtil.CrossPoints(a, b, d, c, e, f) * q.OzUtil.CrossPoints(a, b, d, c, l, m) ? !1 : 0 > q.OzUtil.CrossPoints(e,
  21819. f, l, m, a, b) * q.OzUtil.CrossPoints(e, f, l, m, d, c)
  21820. };
  21821. q.OzUtil.DoublePolygonArea = function (a, b) {
  21822. for (var d = a.length, c = 0, e = 0; e < d;) var f = e++,
  21823. l = (f + 1) % d,
  21824. c = c + (a[f] * b[l] - a[l] * b[f]);
  21825. return c
  21826. };
  21827. q.OzUtil.ReverseVerticesOrder = function (a, b) {
  21828. for (var d = a.length, c, e = 0, f = d / 2 | 0; e < f;) {
  21829. var l = e++;
  21830. c = a[l];
  21831. a[l] = a[d - 1 - l];
  21832. a[d - 1 - l] = c;
  21833. c = b[l];
  21834. b[l] = b[d - 1 - l];
  21835. b[d - 1 - l] = c
  21836. }
  21837. };
  21838. q.OzUtil.PointInsidePolygon = function (a, b, d, c) {
  21839. for (var e = 0, f = 0, l = d.length; f < l;) {
  21840. var m = f++,
  21841. h = (m + 1) % d.length;
  21842. c[m] <= b ? c[h] > b && 0 < q.OzUtil.CrossPoints(a, b, d[m], c[m], d[h], c[h]) &&
  21843. e++ : c[h] <= b && 0 > q.OzUtil.CrossPoints(a, b, d[m], c[m], d[h], c[h]) && e--
  21844. }
  21845. return 0 != e
  21846. };
  21847. q.OzUtil.CleanPolygonCollinears = function (a, b) {
  21848. for (var d = 0, c = 0; d < a.length && 3 < a.length;) {
  21849. var e = (c + 1) % a.length,
  21850. f = (c - 1 + a.length) % a.length;
  21851. 1E-4 > q.OzUtil.PointLineDistance(a[f], b[f], a[e], b[e], a[c], b[c], !0) ? (a.splice(c, 1), b.splice(c, 1), d = 0, c %= a.length) : (c = (c + 1) % a.length, d++)
  21852. }
  21853. };
  21854. q.OzUtil.dashLine = function (a, b, d, c, e, f, l, m, h) {
  21855. null == h && (h = 0);
  21856. null == m && (m = !1);
  21857. null == l && (l = 0);
  21858. null == f && (f = 0);
  21859. var p = c - b,
  21860. k = e - d,
  21861. r = Math.sqrt(p * p + k * k),
  21862. p = Math.atan2(k,
  21863. p),
  21864. n = Math.cos(p),
  21865. w = Math.sin(p),
  21866. p = n * f,
  21867. k = w * f,
  21868. t = n * l,
  21869. s = w * l,
  21870. n = b + Math.min(h, r) * n,
  21871. w = d + Math.min(h, r) * w;
  21872. if (0 < h && (q.OzUtil.dashLine(a, n, w, b, d, l, f, !0), h > r)) return;
  21873. a.moveTo(n, w);
  21874. if (0 == l) a.lineTo(c, e);
  21875. else if (b = Math.floor((r - h) / (f + l)), m) {
  21876. for (m = 0; m < b;) m++, a.moveTo(n += p, w += k), a.lineTo(n += t, w += s);
  21877. r - h - (f + l) * b >= f && (a.moveTo(n + p, w + k), a.lineTo(c, e))
  21878. } else {
  21879. for (m = 0; m < b;) m++, a.lineTo(n += p, w += k), a.moveTo(n += t, w += s);
  21880. r - h - (f + l) * b >= f ? a.lineTo(n + p, w + k) : a.lineTo(c, e)
  21881. }
  21882. };
  21883. q.Xu = function () {};
  21884. s["oz.Xu"] = q.Xu;
  21885. q.Xu.__name__ = ["oz", "Xu"];
  21886. q.Xu.fc = function (a, b) {
  21887. var d = null;
  21888. if (null != a)
  21889. for (var c = a.elementsNamed(b); c.hasNext();) {
  21890. d = c.next();
  21891. break
  21892. }
  21893. return d
  21894. };
  21895. q.Xu.cwav = function (a, b, d, c) {
  21896. var e = null;
  21897. if (null != a)
  21898. for (a = a.elementsNamed(b); a.hasNext();) {
  21899. b = a.next();
  21900. var f = b.get(d);
  21901. if (null != f && f == c) {
  21902. e = b;
  21903. break
  21904. }
  21905. }
  21906. return e
  21907. };
  21908. var Z = {
  21909. PlatformHTML5: function () {}
  21910. };
  21911. s["platforms.PlatformHTML5"] = Z.PlatformHTML5;
  21912. Z.PlatformHTML5.__name__ = ["platforms", "PlatformHTML5"];
  21913. Z.PlatformHTML5.hasInside = function (a) {
  21914. y.Log.trace(F.Browser.window.location.toString(), {
  21915. fileName: "PlatformHTML5.hx",
  21916. lineNumber: 12,
  21917. className: "platforms.PlatformHTML5",
  21918. methodName: "hasInside"
  21919. });
  21920. return 0 <= F.Browser.window.location.toString().indexOf(a)
  21921. };
  21922. Z.PlatformHTML5.invalidRect = function () {
  21923. return Z.PlatformHTML5.resizeW != Z.PlatformHTML5.getWidth() || Z.PlatformHTML5.resizeH != Z.PlatformHTML5.getHeight()
  21924. };
  21925. Z.PlatformHTML5.getWidth = function () {
  21926. return F.Browser.window.innerWidth
  21927. };
  21928. Z.PlatformHTML5.getHeight = function () {
  21929. return F.Browser.window.innerHeight
  21930. };
  21931. Z.PlatformHTML5.hideAddressBar = function () {};
  21932. Z.PlatformHTML5.resize = function () {
  21933. var a =
  21934. 1 * R.RESIZE_WIDTH / R.RESIZE_HEIGHT,
  21935. b = F.Browser.window.innerWidth,
  21936. d = F.Browser.window.innerHeight;
  21937. Z.PlatformHTML5.resizeW = b;
  21938. Z.PlatformHTML5.resizeH = d;
  21939. var c = b,
  21940. e = d;
  21941. Z.PlatformHTML5.offsetX = Z.PlatformHTML5.offsetY = 0;
  21942. c / e > a ? (c = e * a, Z.PlatformHTML5.offsetX = (b - c) / 2) : (e = c / a, Z.PlatformHTML5.offsetY = (d - e) / 2);
  21943. a = c / R.RESIZE_WIDTH;
  21944. R.instance.set_scaleX(a);
  21945. R.instance.set_scaleY(a);
  21946. m = document.getElementById("gameDiv");
  21947. m.style.width = c + "px";
  21948. m.style.height = 2 * e + "px";
  21949. m.style.left = Z.PlatformHTML5.offsetX +
  21950. "px";
  21951. m.style.top = Z.PlatformHTML5.offsetY + "px";
  21952. m.style.position = "absolute"
  21953. /* for (var a = new F.JQuery("body>div"), f = 0, l = a.length; f < l;) {
  21954. var m = f++,
  21955. m = a[m];
  21956. m.style.width = c + "px";
  21957. m.style.height = 2 * e + "px";
  21958. m.style.left = Z.PlatformHTML5.offsetX +
  21959. "px";
  21960. m.style.top = Z.PlatformHTML5.offsetY + "px";
  21961. m.style.position = "absolute"
  21962. } */
  21963. R.instance.debugText.text = "browser window: " + b + " : " + d;
  21964. R.instance.debugText.text += "offsets: " + Z.PlatformHTML5.offsetX + " : " + Z.PlatformHTML5.offsetY;
  21965. F.Browser.window.scrollTo(0, 1);
  21966. y.Log.trace("resizing html5", {
  21967. fileName: "PlatformHTML5.hx",
  21968. lineNumber: 84,
  21969. className: "platforms.PlatformHTML5",
  21970. methodName: "resize"
  21971. })
  21972. };
  21973. Z.PlatformHTML5.prototype = {
  21974. __class__: Z.PlatformHTML5
  21975. };
  21976. var M = {
  21977. State: function (a) {
  21978. this.p = a;
  21979. this.doc = new q.OzSprite;
  21980. a.stateSprite.addChild(this.doc);
  21981. this.cnt = 0
  21982. }
  21983. };
  21984. s["states.State"] = M.State;
  21985. M.State.__name__ = ["states", "State"];
  21986. M.State.prototype = {
  21987. destroy: function () {
  21988. null != this.doc && null != this.doc.parent && this.doc.parent.removeChild(this.doc)
  21989. },
  21990. update: function () {
  21991. this.cnt++
  21992. },
  21993. __class__: M.State
  21994. };
  21995. M.StateCredits = function (a) {
  21996. M.State.call(this, a);
  21997. ba.cmcCredits(this.doc);
  21998. this.doc.getChild("btnBack").addEventListener(2, A(this, this.goToMenu));
  21999. this.doc.getChild("sponsor").addEventListener(2, T.moreGames)
  22000. };
  22001. s["states.StateCredits"] = M.StateCredits;
  22002. M.StateCredits.__name__ = ["states", "StateCredits"];
  22003. M.StateCredits.__super__ = M.State;
  22004. M.StateCredits.prototype = I(M.State.prototype, {
  22005. goToMenu: function (a) {
  22006. this.p.changeState(new M.StateMenu(this.p))
  22007. },
  22008. update: function () {
  22009. M.State.prototype.update.call(this)
  22010. },
  22011. __class__: M.StateCredits
  22012. });
  22013. M.StateGGG = function (a) {
  22014. M.State.call(this, a);
  22015. ba.cmcGGG(this.doc);
  22016. this.doc.x = R.WIDTH / 2;
  22017. this.doc.y = R.HEIGHT / 2;
  22018. this.doc.getChild("bg").addEventListener(2, T.moreGames);
  22019. this.doc.getChild("sponsor").addEventListener(2, T.moreGames)
  22020. };
  22021. s["states.StateGGG"] = M.StateGGG;
  22022. M.StateGGG.__name__ = ["states", "StateGGG"];
  22023. M.StateGGG.__super__ = M.State;
  22024. M.StateGGG.prototype = I(M.State.prototype, {
  22025. update: function () {
  22026. M.State.prototype.update.call(this);
  22027. 90 <= this.cnt && this.p.changeState(new M.StateMenu(this.p))
  22028. },
  22029. __class__: M.StateGGG
  22030. });
  22031. M.StateLevels = function (a) {
  22032. M.State.call(this, a);
  22033. ba.cmcLevels(this.doc);
  22034. this.doc.getChild("btnBack").addEventListener(2, A(this, this.goToMenu));
  22035. this.doc.getChild("sponsor").addEventListener(2, T.moreGames);
  22036. this.buttons = [];
  22037. for (a = 0; 25 > a;) {
  22038. var b = a++;
  22039. this.buttons[b] =
  22040. new q.OzSprite(E.cmcLevelSelectButton);
  22041. this.buttons[b].x = 60 + 88 * (b % 5);
  22042. this.buttons[b].y = 115 + 85 * (b / 5 | 0);
  22043. this.doc.addChild(this.buttons[b]);
  22044. 0 <= T.levelScores[b] ? (this.buttons[b].addEventListener(2, A(this, this.goToPlay)), this.buttons[b].gotoAndStop(3)) : 0 == b || 0 <= T.levelScores[b - 1] ? (this.buttons[b].addEventListener(2, A(this, this.goToPlay)), this.buttons[b].gotoAndStop(1)) : this.buttons[b].gotoAndStop(2);
  22045. var d = new q.OzSprite(null, q.SpriteType.TEXT);
  22046. d.font = n.Font;
  22047. d.textAlign = q.TextAlign.CENTER;
  22048. d.y -= d.font.lineHeight /
  22049. 2;
  22050. this.buttons[b].addChild(d);
  22051. d.text = "" + (b + 1)
  22052. }
  22053. };
  22054. s["states.StateLevels"] = M.StateLevels;
  22055. M.StateLevels.__name__ = ["states", "StateLevels"];
  22056. M.StateLevels.__super__ = M.State;
  22057. M.StateLevels.prototype = I(M.State.prototype, {
  22058. goToMenu: function (a) {
  22059. this.p.changeState(new M.StateMenu(this.p))
  22060. },
  22061. goToPlay: function (a) {
  22062. for (var b = -1, d = 0, c = this.buttons.length; d < c;) {
  22063. var e = d++;
  22064. if (a.target == this.buttons[e]) {
  22065. b = e;
  22066. break
  22067. }
  22068. }
  22069. T.currentLevel = b;
  22070. y.Log.trace(b, {
  22071. fileName: "StateLevels.hx",
  22072. lineNumber: 50,
  22073. className: "states.StateLevels",
  22074. methodName: "goToPlay"
  22075. });
  22076. this.p.changeState(new M.StatePlay(this.p))
  22077. },
  22078. update: function () {
  22079. M.State.prototype.update.call(this)
  22080. },
  22081. __class__: M.StateLevels
  22082. });
  22083. M.StateMenu = function (a) {
  22084. M.State.call(this, a);
  22085. ba.cmcMenu(this.doc);
  22086. this.doc.getChild("btnCredits").addEventListener(2, A(this, this.goToCredits));
  22087. this.doc.getChild("btnPlay").addEventListener(2, A(this, this.goToLevels));
  22088. this.doc.getChild("btnMore").addEventListener(2, T.moreGames);
  22089. this.doc.getChild("sponsor").addEventListener(2, T.moreGames)
  22090. };
  22091. s["states.StateMenu"] = M.StateMenu;
  22092. M.StateMenu.__name__ = ["states", "StateMenu"];
  22093. M.StateMenu.__super__ = M.State;
  22094. M.StateMenu.prototype = I(M.State.prototype, {
  22095. goToLevels: function (a) {
  22096. this.p.changeState(new M.StateLevels(this.p))
  22097. },
  22098. goToCredits: function (a) {
  22099. // play68_submitScore(); //dp_Ranking(); /*this.p.changeState(new M.StateCredits(this.p))*/
  22100. },
  22101. update: function () {
  22102. M.State.prototype.update.call(this)
  22103. },
  22104. __class__: M.StateMenu
  22105. });
  22106. M.StatePlay = function (a, b) {
  22107. M.State.call(this, a);
  22108. this.bounds = [];
  22109. this.touch = !1;
  22110. this.weStart = this.touch = !0;
  22111. this.curShape = 0;
  22112. this.world = new h.space.Space(new h.geom.Vec2(0, 500));
  22113. this.objects = [];
  22114. this.hovers = [];
  22115. this.hoverSprite = new q.OzSprite;
  22116. this.hoverSprite.alpha = 0.5;
  22117. this.doc.addChild(this.menuSprite = new q.OzSprite);
  22118. ba.cmcPlay(this.menuSprite);
  22119. this.menuSprite.getChild("btnPause").addEventListener(2, A(this, this.pause));
  22120. this.menuSprite.getChild("sponsor").addEventListener(2, T.moreGames);
  22121. this.doc.addChild(this.nextSprite = new q.OzSprite);
  22122. this.doc.addChild(this.objectSprite = new q.OzSprite);
  22123. this.doc.addChild(this.hoverSprite);
  22124. this.doc.addChild(this.clockSprite = new q.OzSprite);
  22125. this.doc.addChild(this.menuSprite.getChild("btnPause"));
  22126. this.doc.addChild(this.menuSprite.getChild("sponsor"));
  22127. this.doc.addChild(this.dialogSprite = new q.OzSprite);
  22128. this.state = M.StatePlay.NORMAL;
  22129. var d;
  22130. null != b ? (this.fromEditor = !0, d = b) : d = q.Xu.cwav(T.levelsXML, "level", "name", "" + (T.currentLevel + 1));
  22131. if (this.fromEditor || 0 != T.currentLevel) this.menuSprite.getChild("instructions").visible = !1;
  22132. for (d = d.elementsNamed("object"); d.hasNext();) {
  22133. var c = d.next(),
  22134. e = new ea;
  22135. e.fromXML(c, q.Xu.cwav(q.Xu.fc(T.definitionsXML, "objects"), "object", "type", c.get("type")), T.definitionsXML);
  22136. 0 == e.attributes.get("type").indexOf("static") ? (e.initPhysics(this.world), this.objectSprite.addChild(e.sprite), this.objects.push(e)) : this.hovers.push(e)
  22137. }
  22138. this.hovers.sort(function (a, b) {
  22139. return a.position - b.position
  22140. });
  22141. this.texts = [];
  22142. d = 0;
  22143. for (c = this.hovers.length; d < c;) {
  22144. e = d++;
  22145. this.nextSprite.addChild(this.hovers[e].sprite);
  22146. this.hovers[e].sprite.x = 40 + 80 * e;
  22147. this.hovers[e].sprite.y = 40;
  22148. this.hovers[e].sprite.scaleX = this.hovers[e].sprite.scaleY = 0.5;
  22149. this.hovers[e].geometry.getMinMaxXY(this.bounds);
  22150. var f = this.bounds[2] -
  22151. this.hovers[e].geometry.x,
  22152. l = this.bounds[3] - this.hovers[e].geometry.y,
  22153. m = Math.round(f / 10) + "x" + Math.round(l / 10);
  22154. 60 <= l && (this.hovers[e].sprite.scaleY = 0.25);
  22155. 60 <= f && (this.hovers[e].sprite.scaleX = 0.25);
  22156. f = new q.OzSprite(null, q.SpriteType.TEXT);
  22157. f.font = n.Font;
  22158. f.textAlign = q.TextAlign.CENTER;
  22159. f.x = 40 + 80 * e;
  22160. f.y = 50;
  22161. f.text = m;
  22162. this.nextSprite.addChild(f);
  22163. this.texts.push(f)
  22164. }
  22165. D.reFocus(a)
  22166. };
  22167. s["states.StatePlay"] = M.StatePlay;
  22168. M.StatePlay.__name__ = ["states", "StatePlay"];
  22169. M.StatePlay.__super__ = M.State;
  22170. M.StatePlay.prototype = I(M.State.prototype, {
  22171. goNext: function (a) {
  22172. T.currentLevel == T.NUMLEVELS - 1 ? this.goToLevels(null) : (T.currentLevel++, this.p.changeState(new M.StatePlay(this.p)))
  22173. },
  22174. goRestart: function (a) {
  22175. this.p.changeState(new M.StatePlay(this.p))
  22176. },
  22177. goToLevels: function (a) {
  22178. this.p.changeState(new M.StateLevels(this.p))
  22179. },
  22180. update: function () {
  22181. M.State.prototype.update.call(this);
  22182. if (!this.paused && this.state != M.StatePlay.LOSE && this.state != M.StatePlay.WIN) {
  22183. if (this.state == M.StatePlay.NORMAL) {
  22184. var a = !1;
  22185. this.hoverSprite.x = D.mx;
  22186. var b = 0;
  22187. this.curShape < this.hovers.length &&
  22188. (this.hovers[this.curShape].geometry.getMinMaxXY(this.bounds), b = this.bounds[3] - this.hovers[this.curShape].geometry.y + 80);
  22189. this.hoverSprite.y = D.my - b;
  22190. D.mup && this.hoverSprite.visible && (a = !0);
  22191. D.mdown ? (this.hoverSprite.visible = !0, 0 == this.showNext && (this.showNext = 1)) : this.hoverSprite.visible = !1;
  22192. if (a || this.weStart && !this.touch) this.weStart ? this.weStart = !1 : (this.hovers[this.curShape].geometry.x = this.hoverSprite.x, this.hovers[this.curShape].geometry.y = this.hoverSprite.y, this.hovers[this.curShape].sprite.scaleX =
  22193. this.hovers[this.curShape].sprite.scaleY = 1, this.objectSprite.addChild(this.hovers[this.curShape].sprite), this.hovers[this.curShape].initPhysics(this.world), this.objects.push(this.hovers[this.curShape]), this.curShape++), this.curShape >= this.hovers.length ? (this.state = M.StatePlay.WAITING, ba.cmcClock(this.clockSprite), this.clockSprite.setxy(R.WIDTH / 2, 50), this.clockSprite.alpha = 0.8, this.nextSprite.x -= 80, this.showNext = 3) : this.showNext = this.touch ? 0 : 1;
  22194. 1 == this.showNext && (this.showNext = 2, this.nextSprite.x -=
  22195. 80, this.hoverSprite.addChild(this.hovers[this.curShape].sprite), this.hovers[this.curShape].sprite.scaleX = this.hovers[this.curShape].sprite.scaleY = 1, this.hovers[this.curShape].sprite.x = this.hovers[this.curShape].sprite.y = 0, this.hoverSprite.alpha = 0.5)
  22196. }
  22197. if (this.state == M.StatePlay.WAITING) {
  22198. this.clockSprite.getChild("arrow").rotation += 2.5;
  22199. for (var a = !0, b = 0, d = this.objects.length; b < d;) {
  22200. var c = b++;
  22201. if (null != this.objects[c].body && !this.objects[c].body.get_isSleeping()) {
  22202. a = !1;
  22203. break
  22204. }
  22205. }
  22206. if (a || 360 <= this.clockSprite.getChild("arrow").rotation) this.state =
  22207. M.StatePlay.WIN, ba.cmcYouWin(this.dialogSprite), this.dialogSprite.x = R.WIDTH / 2, this.dialogSprite.y = R.HEIGHT / 2, this.dialogSprite.getChild("btnLevels").addEventListener(2, A(this, this.goToLevels)), this.dialogSprite.getChild("btnRestart").addEventListener(2, A(this, this.goRestart)), this.dialogSprite.getChild("btnNext").addEventListener(2, A(this, this.goNext)), this.dialogSprite.getChild("btnMore").addEventListener(2, T.moreGames), T.levelScores[T.currentLevel] = 1, T.save()
  22208. }
  22209. this.world.step(1 / R.FPS);
  22210. b = 0;
  22211. for (d =
  22212. this.objects.length; b < d;) c = b++, this.objects[c].sprite.x = this.objects[c].body.get_position().get_x(), this.objects[c].sprite.y = this.objects[c].body.get_position().get_y(), this.objects[c].sprite.rotation = 180 * this.objects[c].body.zpp_inner.rot / Math.PI;
  22213. b = 0;
  22214. for (d = this.objects.length; b < d;)
  22215. if (c = b++, this.objects[c].body.get_position().get_y() > R.HEIGHT && (this.state == M.StatePlay.NORMAL || this.state == M.StatePlay.WAITING)) {
  22216. this.state = M.StatePlay.LOSE;
  22217. ba.cmcYouLose(this.dialogSprite);
  22218. this.dialogSprite.x = R.WIDTH /
  22219. 2;
  22220. this.dialogSprite.y = R.HEIGHT / 2;
  22221. this.dialogSprite.getChild("btnLevels").addEventListener(2, A(this, this.goToLevels));
  22222. this.dialogSprite.getChild("btnRestart").addEventListener(2, A(this, this.goRestart));
  22223. this.dialogSprite.getChild("btnMore").addEventListener(2, T.moreGames);
  22224. break
  22225. }
  22226. }
  22227. },
  22228. pause: function (a) {
  22229. this.paused = !0;
  22230. this.dialogSprite.clear();
  22231. ba.cmcPaused(this.dialogSprite);
  22232. this.dialogSprite.getChild("btnPlay").addEventListener(2, A(this, this.resume));
  22233. this.dialogSprite.getChild("btnLevels").addEventListener(2,
  22234. A(this, this.goToLevels));
  22235. this.dialogSprite.getChild("btnRestart").addEventListener(2, A(this, this.goRestart));
  22236. this.dialogSprite.getChild("btnMore").addEventListener(2, T.moreGames);
  22237. this.dialogSprite.x = R.WIDTH / 2;
  22238. this.dialogSprite.y = R.HEIGHT / 2
  22239. },
  22240. resume: function (a) {
  22241. this.dialogSprite.clear();
  22242. this.paused = !1;
  22243. y.Log.trace("go on", {
  22244. fileName: "StatePlay.hx",
  22245. lineNumber: 133,
  22246. className: "states.StatePlay",
  22247. methodName: "resume"
  22248. })
  22249. },
  22250. echoXY: function () {
  22251. y.Log.trace("Echo stuff", {
  22252. fileName: "StatePlay.hx",
  22253. lineNumber: 127,
  22254. className: "states.StatePlay",
  22255. methodName: "echoXY"
  22256. })
  22257. },
  22258. __class__: M.StatePlay
  22259. });
  22260. var c = {
  22261. ZPP_Const: function () {}
  22262. };
  22263. s["zpp_nape.ZPP_Const"] = c.ZPP_Const;
  22264. c.ZPP_Const.__name__ = ["zpp_nape", "ZPP_Const"];
  22265. c.ZPP_Const.POSINF = function () {
  22266. return Math.POSITIVE_INFINITY
  22267. };
  22268. c.ZPP_Const.NEGINF = function () {
  22269. return Math.NEGATIVE_INFINITY
  22270. };
  22271. c.ZPP_ID = function () {};
  22272. s["zpp_nape.ZPP_ID"] = c.ZPP_ID;
  22273. c.ZPP_ID.__name__ = ["zpp_nape", "ZPP_ID"];
  22274. c.ZPP_ID.Constraint = function () {
  22275. return c.ZPP_ID._Constraint++
  22276. };
  22277. c.ZPP_ID.Interactor = function () {
  22278. return c.ZPP_ID._Interactor++
  22279. };
  22280. c.ZPP_ID.CbType =
  22281. function () {
  22282. return c.ZPP_ID._CbType++
  22283. };
  22284. c.ZPP_ID.CbSet = function () {
  22285. return c.ZPP_ID._CbSet++
  22286. };
  22287. c.ZPP_ID.Listener = function () {
  22288. return c.ZPP_ID._Listener++
  22289. };
  22290. c.ZPP_ID.ZPP_SimpleVert = function () {
  22291. return c.ZPP_ID._ZPP_SimpleVert++
  22292. };
  22293. c.ZPP_ID.ZPP_SimpleSeg = function () {
  22294. return c.ZPP_ID._ZPP_SimpleSeg++
  22295. };
  22296. c.ZPP_ID.Space = function () {
  22297. return c.ZPP_ID._Space++
  22298. };
  22299. c.ZPP_ID.InteractionGroup = function () {
  22300. return c.ZPP_ID._InteractionGroup++
  22301. };
  22302. c.callbacks = {};
  22303. c.callbacks.ZPP_Callback = function () {
  22304. this.body = this.constraint = null;
  22305. this.pre_swapped = !1;
  22306. this.int1 = this.int2 = this.set = this.wrap_arbiters = this.pre_arbiter = null;
  22307. this.length = 0;
  22308. this.next = this.prev = null;
  22309. this.index = 0;
  22310. this.listener = this.space = null;
  22311. this.event = 0;
  22312. this.outer_body = this.outer_con = this.outer_int = null;
  22313. this.length = 0
  22314. };
  22315. s["zpp_nape.callbacks.ZPP_Callback"] = c.callbacks.ZPP_Callback;
  22316. c.callbacks.ZPP_Callback.__name__ = ["zpp_nape", "callbacks", "ZPP_Callback"];
  22317. c.callbacks.ZPP_Callback.prototype = {
  22318. genarbs: function () {
  22319. null == this.wrap_arbiters ? this.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.set.arbiters, !0) : this.wrap_arbiters.zpp_inner.inner = this.set.arbiters;
  22320. this.wrap_arbiters.zpp_inner.zip_length = !0;
  22321. this.wrap_arbiters.zpp_inner.at_ite = null
  22322. },
  22323. alloc: function () {},
  22324. free: function () {
  22325. this.listener = this.constraint = this.body = this.int1 = this.int2 = null;
  22326. null != this.wrap_arbiters && (this.wrap_arbiters.zpp_inner.inner = null);
  22327. this.set = null
  22328. },
  22329. rev_at: function (a) {
  22330. for (var b = this.prev; 0 != a--;) b = b.prev;
  22331. return b
  22332. },
  22333. at: function (a) {
  22334. for (var b = this.next; 0 != a--;) b = b.next;
  22335. return b
  22336. },
  22337. cyclePrev: function (a) {
  22338. return null == a.prev ? this.prev :
  22339. a.prev
  22340. },
  22341. cycleNext: function (a) {
  22342. return null == a.next ? this.next : a.next
  22343. },
  22344. rotateR: function () {
  22345. this.push_rev(this.pop_rev())
  22346. },
  22347. rotateL: function () {
  22348. this.push(this.pop())
  22349. },
  22350. splice: function (a) {
  22351. var b = a.next;
  22352. null == a.prev ? (this.next = a.next, null != this.next ? this.next.prev = null : this.prev = null) : (a.prev.next = a.next, null != a.next ? a.next.prev = a.prev : this.prev = a.prev);
  22353. this.length--;
  22354. return b
  22355. },
  22356. clear: function () {
  22357. for (; !this.empty();) this.pop()
  22358. },
  22359. empty: function () {
  22360. return null == this.next
  22361. },
  22362. pop_rev: function () {
  22363. var a = this.prev;
  22364. this.prev =
  22365. a.prev;
  22366. null == this.prev ? this.next = null : this.prev.next = null;
  22367. this.length--;
  22368. return a
  22369. },
  22370. pop: function () {
  22371. var a = this.next;
  22372. this.next = a.next;
  22373. null == this.next ? this.prev = null : this.next.prev = null;
  22374. this.length--;
  22375. return a
  22376. },
  22377. push_rev: function (a) {
  22378. null != this.next ? this.next.prev = a : this.prev = a;
  22379. a.next = this.next;
  22380. a.prev = null;
  22381. this.next = a;
  22382. this.length++
  22383. },
  22384. push: function (a) {
  22385. null != this.prev ? this.prev.next = a : this.next = a;
  22386. a.prev = this.prev;
  22387. a.next = null;
  22388. this.prev = a;
  22389. this.length++
  22390. },
  22391. wrapper_int: function () {
  22392. null == this.outer_int && (c.callbacks.ZPP_Callback.internal = !0, this.outer_int = new h.callbacks.InteractionCallback, c.callbacks.ZPP_Callback.internal = !1, this.outer_int.zpp_inner = this);
  22393. null == this.wrap_arbiters ? this.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.set.arbiters, !0) : this.wrap_arbiters.zpp_inner.inner = this.set.arbiters;
  22394. this.wrap_arbiters.zpp_inner.zip_length = !0;
  22395. this.wrap_arbiters.zpp_inner.at_ite = null;
  22396. return this.outer_int
  22397. },
  22398. wrapper_con: function () {
  22399. null == this.outer_con && (c.callbacks.ZPP_Callback.internal = !0, this.outer_con = new h.callbacks.ConstraintCallback,
  22400. c.callbacks.ZPP_Callback.internal = !1, this.outer_con.zpp_inner = this);
  22401. return this.outer_con
  22402. },
  22403. wrapper_body: function () {
  22404. null == this.outer_body && (c.callbacks.ZPP_Callback.internal = !0, this.outer_body = new h.callbacks.BodyCallback, c.callbacks.ZPP_Callback.internal = !1, this.outer_body.zpp_inner = this);
  22405. return this.outer_body
  22406. },
  22407. __class__: c.callbacks.ZPP_Callback
  22408. };
  22409. c.callbacks.ZPP_CbSet = function () {
  22410. this.interactors = this.wrap_interactors = this.constraints = this.wrap_constraints = null;
  22411. this.zip_conlisteners = !1;
  22412. this.conlisteners =
  22413. null;
  22414. this.zip_bodylisteners = !1;
  22415. this.bodylisteners = null;
  22416. this.zip_listeners = !1;
  22417. this.manager = this.cbpairs = this.listeners = null;
  22418. this.id = 0;
  22419. this.next = null;
  22420. this.count = 0;
  22421. this.cbTypes = null;
  22422. this.cbTypes = new c.util.ZNPList_ZPP_CbType;
  22423. this.listeners = new c.util.ZNPList_ZPP_InteractionListener;
  22424. this.zip_listeners = !0;
  22425. this.bodylisteners = new c.util.ZNPList_ZPP_BodyListener;
  22426. this.zip_bodylisteners = !0;
  22427. this.conlisteners = new c.util.ZNPList_ZPP_ConstraintListener;
  22428. this.zip_conlisteners = !0;
  22429. this.constraints = new c.util.ZNPList_ZPP_Constraint;
  22430. this.interactors = new c.util.ZNPList_ZPP_Interactor;
  22431. this.id = c.ZPP_ID.CbSet();
  22432. this.cbpairs = new c.util.ZNPList_ZPP_CbSetPair
  22433. };
  22434. s["zpp_nape.callbacks.ZPP_CbSet"] = c.callbacks.ZPP_CbSet;
  22435. c.callbacks.ZPP_CbSet.__name__ = ["zpp_nape", "callbacks", "ZPP_CbSet"];
  22436. c.callbacks.ZPP_CbSet.setlt = function (a, b) {
  22437. for (var d = a.cbTypes.head, c = b.cbTypes.head; null != d && null != c;) {
  22438. var e = d.elt,
  22439. f = c.elt;
  22440. if (e.id < f.id) return !0;
  22441. if (f.id < e.id) return !1;
  22442. d = d.next;
  22443. c = c.next
  22444. }
  22445. return null != c && null == d
  22446. };
  22447. c.callbacks.ZPP_CbSet.get = function (a) {
  22448. var b;
  22449. null == c.callbacks.ZPP_CbSet.zpp_pool ? b = new c.callbacks.ZPP_CbSet : (b = c.callbacks.ZPP_CbSet.zpp_pool, c.callbacks.ZPP_CbSet.zpp_pool = b.next, b.next = null);
  22450. null;
  22451. var d = null;
  22452. for (a = a.head; null != a;) {
  22453. var g = a.elt,
  22454. d = b.cbTypes.insert(d, g);
  22455. g.cbsets.add(b);
  22456. a = a.next
  22457. }
  22458. return b
  22459. };
  22460. c.callbacks.ZPP_CbSet.compatible = function (a, b, d) {
  22461. return a.options1.compatible(b.cbTypes) && a.options2.compatible(d.cbTypes) || a.options2.compatible(b.cbTypes) && a.options1.compatible(d.cbTypes)
  22462. };
  22463. c.callbacks.ZPP_CbSet.empty_intersection = function (a,
  22464. b) {
  22465. return null == a.manager.pair(a, b).listeners.head
  22466. };
  22467. c.callbacks.ZPP_CbSet.single_intersection = function (a, b, d) {
  22468. return a.manager.pair(a, b).single_intersection(d)
  22469. };
  22470. c.callbacks.ZPP_CbSet.find_all = function (a, b, d, c) {
  22471. a.manager.pair(a, b).forall(d, c)
  22472. };
  22473. c.callbacks.ZPP_CbSet.prototype = {
  22474. alloc: function () {},
  22475. free: function () {
  22476. this.listeners.clear();
  22477. this.zip_listeners = !0;
  22478. this.bodylisteners.clear();
  22479. this.zip_bodylisteners = !0;
  22480. this.conlisteners.clear();
  22481. for (this.zip_conlisteners = !0; null != this.cbTypes.head;) this.cbTypes.pop_unsafe().cbsets.remove(this)
  22482. },
  22483. remInteractor: function (a) {
  22484. this.interactors.remove(a)
  22485. },
  22486. remConstraint: function (a) {
  22487. this.constraints.remove(a)
  22488. },
  22489. addInteractor: function (a) {
  22490. this.interactors.add(a)
  22491. },
  22492. addConstraint: function (a) {
  22493. this.constraints.add(a)
  22494. },
  22495. validate: function () {
  22496. this.zip_listeners && (this.zip_listeners = !1, this.realvalidate_listeners());
  22497. this.zip_bodylisteners && (this.zip_bodylisteners = !1, this.realvalidate_bodylisteners());
  22498. this.zip_conlisteners && (this.zip_conlisteners = !1, this.realvalidate_conlisteners())
  22499. },
  22500. realvalidate_conlisteners: function () {
  22501. this.conlisteners.clear();
  22502. for (var a = this.cbTypes.head; null != a;) {
  22503. for (var b = null, d = this.conlisteners.head, g = a.elt.conlisteners.head; null != g;) {
  22504. var e = g.elt;
  22505. null != d && d.elt == e ? (g = g.next, b = d, d = d.next) : null == d || c.callbacks.ZPP_Listener.setlt(e, d.elt) ? (e.options.excluded(this.cbTypes) || e.space != this.manager.space || (b = this.conlisteners.inlined_insert(b, e)), g = g.next) : (b = d, d = d.next)
  22506. }
  22507. a = a.next
  22508. }
  22509. },
  22510. validate_conlisteners: function () {
  22511. this.zip_conlisteners && (this.zip_conlisteners = !1, this.realvalidate_conlisteners())
  22512. },
  22513. invalidate_conlisteners: function () {
  22514. this.zip_conlisteners = !0
  22515. },
  22516. realvalidate_bodylisteners: function () {
  22517. this.bodylisteners.clear();
  22518. for (var a = this.cbTypes.head; null != a;) {
  22519. for (var b = null, d = this.bodylisteners.head, g = a.elt.bodylisteners.head; null != g;) {
  22520. var e = g.elt;
  22521. null != d && d.elt == e ? (g = g.next, b = d, d = d.next) : null == d || c.callbacks.ZPP_Listener.setlt(e, d.elt) ? (e.options.excluded(this.cbTypes) || e.space != this.manager.space || (b = this.bodylisteners.inlined_insert(b, e)), g = g.next) : (b = d, d = d.next)
  22522. }
  22523. a = a.next
  22524. }
  22525. },
  22526. validate_bodylisteners: function () {
  22527. this.zip_bodylisteners && (this.zip_bodylisteners = !1, this.realvalidate_bodylisteners())
  22528. },
  22529. invalidate_bodylisteners: function () {
  22530. this.zip_bodylisteners = !0
  22531. },
  22532. realvalidate_listeners: function () {
  22533. this.listeners.clear();
  22534. for (var a = this.cbTypes.head; null != a;) {
  22535. for (var b = null, d = this.listeners.head, g = a.elt.listeners.head; null != g;) {
  22536. var e = g.elt;
  22537. null != d && d.elt == e ? (g = g.next, b = d, d = d.next) : null == d || c.callbacks.ZPP_Listener.setlt(e, d.elt) ? (e.space == this.manager.space && (b = this.listeners.inlined_insert(b, e)), g = g.next) : (b = d, d = d.next)
  22538. }
  22539. a = a.next
  22540. }
  22541. },
  22542. validate_listeners: function () {
  22543. this.zip_listeners &&
  22544. (this.zip_listeners = !1, this.realvalidate_listeners())
  22545. },
  22546. invalidate_listeners: function () {
  22547. this.zip_listeners = !0;
  22548. this.invalidate_pairs()
  22549. },
  22550. invalidate_pairs: function () {
  22551. for (var a = this.cbpairs.head; null != a;) a.elt.zip_listeners = !0, a = a.next
  22552. },
  22553. decrement: function () {
  22554. return 0 == --this.count
  22555. },
  22556. increment: function () {
  22557. this.count++
  22558. },
  22559. __class__: c.callbacks.ZPP_CbSet
  22560. };
  22561. c.callbacks.ZPP_CbSetPair = function () {
  22562. this.listeners = null;
  22563. this.zip_listeners = !1;
  22564. this.a = this.b = this.next = null;
  22565. this.listeners = new c.util.ZNPList_ZPP_InteractionListener
  22566. };
  22567. s["zpp_nape.callbacks.ZPP_CbSetPair"] = c.callbacks.ZPP_CbSetPair;
  22568. c.callbacks.ZPP_CbSetPair.__name__ = ["zpp_nape", "callbacks", "ZPP_CbSetPair"];
  22569. c.callbacks.ZPP_CbSetPair.get = function (a, b) {
  22570. var d;
  22571. null == c.callbacks.ZPP_CbSetPair.zpp_pool ? d = new c.callbacks.ZPP_CbSetPair : (d = c.callbacks.ZPP_CbSetPair.zpp_pool, c.callbacks.ZPP_CbSetPair.zpp_pool = d.next, d.next = null);
  22572. d.zip_listeners = !0;
  22573. c.callbacks.ZPP_CbSet.setlt(a, b) ? (d.a = a, d.b = b) : (d.a = b, d.b = a);
  22574. return d
  22575. };
  22576. c.callbacks.ZPP_CbSetPair.setlt = function (a, b) {
  22577. return c.callbacks.ZPP_CbSet.setlt(a.a,
  22578. b.a) || a.a == b.a && c.callbacks.ZPP_CbSet.setlt(a.b, b.b)
  22579. };
  22580. c.callbacks.ZPP_CbSetPair.prototype = {
  22581. forall: function (a, b) {
  22582. for (var d = this.listeners.head; null != d;) {
  22583. var c = d.elt;
  22584. c.event == a && b(c);
  22585. d = d.next
  22586. }
  22587. },
  22588. single_intersection: function (a) {
  22589. var b = this.listeners.head;
  22590. return null != b && b.elt == a && null == b.next
  22591. },
  22592. empty_intersection: function () {
  22593. return null == this.listeners.head
  22594. },
  22595. __validate: function () {
  22596. this.listeners.clear();
  22597. for (var a = this.a.listeners.head, b = this.b.listeners.head; null != a && null != b;) {
  22598. var d = a.elt,
  22599. c = b.elt;
  22600. d == c ? ((d.options1.compatible(this.a.cbTypes) &&
  22601. d.options2.compatible(this.b.cbTypes) || d.options2.compatible(this.a.cbTypes) && d.options1.compatible(this.b.cbTypes)) && this.listeners.add(d), a = a.next, b = b.next) : d.precedence > c.precedence || d.precedence == c.precedence && d.id > c.id ? a = a.next : b = b.next
  22602. }
  22603. },
  22604. validate: function () {
  22605. this.zip_listeners && (this.zip_listeners = !1, this.__validate())
  22606. },
  22607. invalidate: function () {
  22608. this.zip_listeners = !0
  22609. },
  22610. compatible: function (a) {
  22611. return a.options1.compatible(this.a.cbTypes) && a.options2.compatible(this.b.cbTypes) || a.options2.compatible(this.a.cbTypes) &&
  22612. a.options1.compatible(this.b.cbTypes)
  22613. },
  22614. alloc: function () {
  22615. this.zip_listeners = !0
  22616. },
  22617. free: function () {
  22618. this.a = this.b = null;
  22619. this.listeners.clear()
  22620. },
  22621. __class__: c.callbacks.ZPP_CbSetPair
  22622. };
  22623. c.util = {};
  22624. c.util.ZNPList_ZPP_InteractionListener = function () {
  22625. this.length = 0;
  22626. this.modified = this.pushmod = !1;
  22627. this.head = null
  22628. };
  22629. s["zpp_nape.util.ZNPList_ZPP_InteractionListener"] = c.util.ZNPList_ZPP_InteractionListener;
  22630. c.util.ZNPList_ZPP_InteractionListener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_InteractionListener"];
  22631. c.util.ZNPList_ZPP_InteractionListener.prototype = {
  22632. at: function (a) {
  22633. a = this.iterator_at(a);
  22634. return null != a ? a.elt : null
  22635. },
  22636. iterator_at: function (a) {
  22637. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  22638. return b
  22639. },
  22640. back: function () {
  22641. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  22642. return a.elt
  22643. },
  22644. front: function () {
  22645. return this.head.elt
  22646. },
  22647. inlined_has: function (a) {
  22648. var b;
  22649. b = !1;
  22650. for (var d = this.head; null != d;) {
  22651. if (d.elt == a) {
  22652. b = !0;
  22653. break
  22654. }
  22655. d = d.next
  22656. }
  22657. return b
  22658. },
  22659. has: function (a) {
  22660. return this.inlined_has(a)
  22661. },
  22662. size: function () {
  22663. return this.length
  22664. },
  22665. empty: function () {
  22666. return null == this.head
  22667. },
  22668. reverse: function () {
  22669. for (var a =
  22670. this.head, b = null; null != a;) {
  22671. var d = a.next;
  22672. a.next = b;
  22673. b = this.head = a;
  22674. a = d
  22675. }
  22676. this.pushmod = this.modified = !0
  22677. },
  22678. inlined_clear: function () {
  22679. for (; null != this.head;) this.inlined_pop();
  22680. this.pushmod = !0
  22681. },
  22682. clear: function () {
  22683. for (; null != this.head;) this.inlined_pop();
  22684. this.pushmod = !0
  22685. },
  22686. splice: function (a, b) {
  22687. for (; 0 < b-- && null != a.next;) this.erase(a);
  22688. return a.next
  22689. },
  22690. inlined_erase: function (a) {
  22691. var b, d;
  22692. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  22693. a = b;
  22694. a.elt = null;
  22695. a.next = c.util.ZNPNode_ZPP_InteractionListener.zpp_pool;
  22696. c.util.ZNPNode_ZPP_InteractionListener.zpp_pool = a;
  22697. this.modified = !0;
  22698. this.length--;
  22699. this.pushmod = !0;
  22700. return d
  22701. },
  22702. erase: function (a) {
  22703. return this.inlined_erase(a)
  22704. },
  22705. inlined_try_remove: function (a) {
  22706. for (var b = null, d = this.head, c = !1; null != d;) {
  22707. if (d.elt == a) {
  22708. this.inlined_erase(b);
  22709. c = !0;
  22710. break
  22711. }
  22712. b = d;
  22713. d = d.next
  22714. }
  22715. return c
  22716. },
  22717. inlined_remove: function (a) {
  22718. this.inlined_try_remove(a)
  22719. },
  22720. try_remove: function (a) {
  22721. for (var b = null, d = this.head, c = !1; null != d;) {
  22722. if (d.elt == a) {
  22723. this.erase(b);
  22724. c = !0;
  22725. break
  22726. }
  22727. b = d;
  22728. d = d.next
  22729. }
  22730. return c
  22731. },
  22732. remove: function (a) {
  22733. this.inlined_try_remove(a)
  22734. },
  22735. inlined_pop_unsafe: function () {
  22736. var a = this.head.elt;
  22737. this.pop();
  22738. return a
  22739. },
  22740. pop_unsafe: function () {
  22741. return this.inlined_pop_unsafe()
  22742. },
  22743. inlined_pop: function () {
  22744. var a = this.head;
  22745. this.head = a.next;
  22746. a.elt = null;
  22747. a.next = c.util.ZNPNode_ZPP_InteractionListener.zpp_pool;
  22748. c.util.ZNPNode_ZPP_InteractionListener.zpp_pool = a;
  22749. null == this.head && (this.pushmod = !0);
  22750. this.modified = !0;
  22751. this.length--
  22752. },
  22753. pop: function () {
  22754. this.inlined_pop()
  22755. },
  22756. inlined_insert: function (a,
  22757. b) {
  22758. var d;
  22759. null == c.util.ZNPNode_ZPP_InteractionListener.zpp_pool ? d = new c.util.ZNPNode_ZPP_InteractionListener : (d = c.util.ZNPNode_ZPP_InteractionListener.zpp_pool, c.util.ZNPNode_ZPP_InteractionListener.zpp_pool = d.next, d.next = null);
  22760. null;
  22761. d.elt = b;
  22762. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  22763. this.pushmod = this.modified = !0;
  22764. this.length++;
  22765. return d
  22766. },
  22767. insert: function (a, b) {
  22768. return this.inlined_insert(a, b)
  22769. },
  22770. addAll: function (a) {
  22771. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  22772. },
  22773. inlined_add: function (a) {
  22774. var b;
  22775. null == c.util.ZNPNode_ZPP_InteractionListener.zpp_pool ? b = new c.util.ZNPNode_ZPP_InteractionListener : (b = c.util.ZNPNode_ZPP_InteractionListener.zpp_pool, c.util.ZNPNode_ZPP_InteractionListener.zpp_pool = b.next, b.next = null);
  22776. null;
  22777. b.elt = a;
  22778. b.next = this.head;
  22779. this.head = b;
  22780. this.modified = !0;
  22781. this.length++;
  22782. return a
  22783. },
  22784. add: function (a) {
  22785. return this.inlined_add(a)
  22786. },
  22787. setbegin: function (a) {
  22788. this.head = a;
  22789. this.pushmod = this.modified = !0
  22790. },
  22791. begin: function () {
  22792. return this.head
  22793. },
  22794. __class__: c.util.ZNPList_ZPP_InteractionListener
  22795. };
  22796. c.util.ZNPList_ZPP_BodyListener =
  22797. function () {
  22798. this.length = 0;
  22799. this.modified = this.pushmod = !1;
  22800. this.head = null
  22801. };
  22802. s["zpp_nape.util.ZNPList_ZPP_BodyListener"] = c.util.ZNPList_ZPP_BodyListener;
  22803. c.util.ZNPList_ZPP_BodyListener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_BodyListener"];
  22804. c.util.ZNPList_ZPP_BodyListener.prototype = {
  22805. at: function (a) {
  22806. a = this.iterator_at(a);
  22807. return null != a ? a.elt : null
  22808. },
  22809. iterator_at: function (a) {
  22810. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  22811. return b
  22812. },
  22813. back: function () {
  22814. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  22815. return a.elt
  22816. },
  22817. front: function () {
  22818. return this.head.elt
  22819. },
  22820. inlined_has: function (a) {
  22821. var b;
  22822. b = !1;
  22823. for (var d = this.head; null != d;) {
  22824. if (d.elt == a) {
  22825. b = !0;
  22826. break
  22827. }
  22828. d = d.next
  22829. }
  22830. return b
  22831. },
  22832. has: function (a) {
  22833. return this.inlined_has(a)
  22834. },
  22835. size: function () {
  22836. return this.length
  22837. },
  22838. empty: function () {
  22839. return null == this.head
  22840. },
  22841. reverse: function () {
  22842. for (var a = this.head, b = null; null != a;) {
  22843. var d = a.next;
  22844. a.next = b;
  22845. b = this.head = a;
  22846. a = d
  22847. }
  22848. this.pushmod = this.modified = !0
  22849. },
  22850. inlined_clear: function () {
  22851. for (; null != this.head;) this.inlined_pop();
  22852. this.pushmod = !0
  22853. },
  22854. clear: function () {
  22855. for (; null != this.head;) this.inlined_pop();
  22856. this.pushmod = !0
  22857. },
  22858. splice: function (a, b) {
  22859. for (; 0 < b-- && null != a.next;) this.erase(a);
  22860. return a.next
  22861. },
  22862. inlined_erase: function (a) {
  22863. var b, d;
  22864. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  22865. a = b;
  22866. a.elt = null;
  22867. a.next = c.util.ZNPNode_ZPP_BodyListener.zpp_pool;
  22868. c.util.ZNPNode_ZPP_BodyListener.zpp_pool = a;
  22869. this.modified = !0;
  22870. this.length--;
  22871. this.pushmod = !0;
  22872. return d
  22873. },
  22874. erase: function (a) {
  22875. return this.inlined_erase(a)
  22876. },
  22877. inlined_try_remove: function (a) {
  22878. for (var b = null,
  22879. d = this.head, c = !1; null != d;) {
  22880. if (d.elt == a) {
  22881. this.inlined_erase(b);
  22882. c = !0;
  22883. break
  22884. }
  22885. b = d;
  22886. d = d.next
  22887. }
  22888. return c
  22889. },
  22890. inlined_remove: function (a) {
  22891. this.inlined_try_remove(a)
  22892. },
  22893. try_remove: function (a) {
  22894. for (var b = null, d = this.head, c = !1; null != d;) {
  22895. if (d.elt == a) {
  22896. this.erase(b);
  22897. c = !0;
  22898. break
  22899. }
  22900. b = d;
  22901. d = d.next
  22902. }
  22903. return c
  22904. },
  22905. remove: function (a) {
  22906. this.inlined_try_remove(a)
  22907. },
  22908. inlined_pop_unsafe: function () {
  22909. var a = this.head.elt;
  22910. this.pop();
  22911. return a
  22912. },
  22913. pop_unsafe: function () {
  22914. return this.inlined_pop_unsafe()
  22915. },
  22916. inlined_pop: function () {
  22917. var a = this.head;
  22918. this.head = a.next;
  22919. a.elt = null;
  22920. a.next = c.util.ZNPNode_ZPP_BodyListener.zpp_pool;
  22921. c.util.ZNPNode_ZPP_BodyListener.zpp_pool = a;
  22922. null == this.head && (this.pushmod = !0);
  22923. this.modified = !0;
  22924. this.length--
  22925. },
  22926. pop: function () {
  22927. this.inlined_pop()
  22928. },
  22929. inlined_insert: function (a, b) {
  22930. var d;
  22931. null == c.util.ZNPNode_ZPP_BodyListener.zpp_pool ? d = new c.util.ZNPNode_ZPP_BodyListener : (d = c.util.ZNPNode_ZPP_BodyListener.zpp_pool, c.util.ZNPNode_ZPP_BodyListener.zpp_pool = d.next, d.next = null);
  22932. null;
  22933. d.elt = b;
  22934. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next =
  22935. d);
  22936. this.pushmod = this.modified = !0;
  22937. this.length++;
  22938. return d
  22939. },
  22940. insert: function (a, b) {
  22941. return this.inlined_insert(a, b)
  22942. },
  22943. addAll: function (a) {
  22944. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  22945. },
  22946. inlined_add: function (a) {
  22947. var b;
  22948. null == c.util.ZNPNode_ZPP_BodyListener.zpp_pool ? b = new c.util.ZNPNode_ZPP_BodyListener : (b = c.util.ZNPNode_ZPP_BodyListener.zpp_pool, c.util.ZNPNode_ZPP_BodyListener.zpp_pool = b.next, b.next = null);
  22949. null;
  22950. b.elt = a;
  22951. b.next = this.head;
  22952. this.head = b;
  22953. this.modified = !0;
  22954. this.length++;
  22955. return a
  22956. },
  22957. add: function (a) {
  22958. return this.inlined_add(a)
  22959. },
  22960. setbegin: function (a) {
  22961. this.head = a;
  22962. this.pushmod = this.modified = !0
  22963. },
  22964. begin: function () {
  22965. return this.head
  22966. },
  22967. __class__: c.util.ZNPList_ZPP_BodyListener
  22968. };
  22969. c.util.ZNPList_ZPP_ConstraintListener = function () {
  22970. this.length = 0;
  22971. this.modified = this.pushmod = !1;
  22972. this.head = null
  22973. };
  22974. s["zpp_nape.util.ZNPList_ZPP_ConstraintListener"] = c.util.ZNPList_ZPP_ConstraintListener;
  22975. c.util.ZNPList_ZPP_ConstraintListener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_ConstraintListener"];
  22976. c.util.ZNPList_ZPP_ConstraintListener.prototype = {
  22977. at: function (a) {
  22978. a =
  22979. this.iterator_at(a);
  22980. return null != a ? a.elt : null
  22981. },
  22982. iterator_at: function (a) {
  22983. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  22984. return b
  22985. },
  22986. back: function () {
  22987. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  22988. return a.elt
  22989. },
  22990. front: function () {
  22991. return this.head.elt
  22992. },
  22993. inlined_has: function (a) {
  22994. var b;
  22995. b = !1;
  22996. for (var d = this.head; null != d;) {
  22997. if (d.elt == a) {
  22998. b = !0;
  22999. break
  23000. }
  23001. d = d.next
  23002. }
  23003. return b
  23004. },
  23005. has: function (a) {
  23006. return this.inlined_has(a)
  23007. },
  23008. size: function () {
  23009. return this.length
  23010. },
  23011. empty: function () {
  23012. return null == this.head
  23013. },
  23014. reverse: function () {
  23015. for (var a = this.head,
  23016. b = null; null != a;) {
  23017. var d = a.next;
  23018. a.next = b;
  23019. b = this.head = a;
  23020. a = d
  23021. }
  23022. this.pushmod = this.modified = !0
  23023. },
  23024. inlined_clear: function () {
  23025. for (; null != this.head;) this.inlined_pop();
  23026. this.pushmod = !0
  23027. },
  23028. clear: function () {
  23029. for (; null != this.head;) this.inlined_pop();
  23030. this.pushmod = !0
  23031. },
  23032. splice: function (a, b) {
  23033. for (; 0 < b-- && null != a.next;) this.erase(a);
  23034. return a.next
  23035. },
  23036. inlined_erase: function (a) {
  23037. var b, d;
  23038. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  23039. a = b;
  23040. a.elt = null;
  23041. a.next = c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool;
  23042. c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool = a;
  23043. this.modified = !0;
  23044. this.length--;
  23045. this.pushmod = !0;
  23046. return d
  23047. },
  23048. erase: function (a) {
  23049. return this.inlined_erase(a)
  23050. },
  23051. inlined_try_remove: function (a) {
  23052. for (var b = null, d = this.head, c = !1; null != d;) {
  23053. if (d.elt == a) {
  23054. this.inlined_erase(b);
  23055. c = !0;
  23056. break
  23057. }
  23058. b = d;
  23059. d = d.next
  23060. }
  23061. return c
  23062. },
  23063. inlined_remove: function (a) {
  23064. this.inlined_try_remove(a)
  23065. },
  23066. try_remove: function (a) {
  23067. for (var b = null, d = this.head, c = !1; null != d;) {
  23068. if (d.elt == a) {
  23069. this.erase(b);
  23070. c = !0;
  23071. break
  23072. }
  23073. b = d;
  23074. d = d.next
  23075. }
  23076. return c
  23077. },
  23078. remove: function (a) {
  23079. this.inlined_try_remove(a)
  23080. },
  23081. inlined_pop_unsafe: function () {
  23082. var a = this.head.elt;
  23083. this.pop();
  23084. return a
  23085. },
  23086. pop_unsafe: function () {
  23087. return this.inlined_pop_unsafe()
  23088. },
  23089. inlined_pop: function () {
  23090. var a = this.head;
  23091. this.head = a.next;
  23092. a.elt = null;
  23093. a.next = c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool;
  23094. c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool = a;
  23095. null == this.head && (this.pushmod = !0);
  23096. this.modified = !0;
  23097. this.length--
  23098. },
  23099. pop: function () {
  23100. this.inlined_pop()
  23101. },
  23102. inlined_insert: function (a,
  23103. b) {
  23104. var d;
  23105. null == c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool ? d = new c.util.ZNPNode_ZPP_ConstraintListener : (d = c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool, c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool = d.next, d.next = null);
  23106. null;
  23107. d.elt = b;
  23108. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  23109. this.pushmod = this.modified = !0;
  23110. this.length++;
  23111. return d
  23112. },
  23113. insert: function (a, b) {
  23114. return this.inlined_insert(a, b)
  23115. },
  23116. addAll: function (a) {
  23117. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  23118. },
  23119. inlined_add: function (a) {
  23120. var b;
  23121. null == c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool ? b = new c.util.ZNPNode_ZPP_ConstraintListener : (b = c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool, c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool = b.next, b.next = null);
  23122. null;
  23123. b.elt = a;
  23124. b.next = this.head;
  23125. this.head = b;
  23126. this.modified = !0;
  23127. this.length++;
  23128. return a
  23129. },
  23130. add: function (a) {
  23131. return this.inlined_add(a)
  23132. },
  23133. setbegin: function (a) {
  23134. this.head = a;
  23135. this.pushmod = this.modified = !0
  23136. },
  23137. begin: function () {
  23138. return this.head
  23139. },
  23140. __class__: c.util.ZNPList_ZPP_ConstraintListener
  23141. };
  23142. c.util.ZNPList_ZPP_Constraint =
  23143. function () {
  23144. this.length = 0;
  23145. this.modified = this.pushmod = !1;
  23146. this.head = null
  23147. };
  23148. s["zpp_nape.util.ZNPList_ZPP_Constraint"] = c.util.ZNPList_ZPP_Constraint;
  23149. c.util.ZNPList_ZPP_Constraint.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Constraint"];
  23150. c.util.ZNPList_ZPP_Constraint.prototype = {
  23151. at: function (a) {
  23152. a = this.iterator_at(a);
  23153. return null != a ? a.elt : null
  23154. },
  23155. iterator_at: function (a) {
  23156. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  23157. return b
  23158. },
  23159. back: function () {
  23160. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  23161. return a.elt
  23162. },
  23163. front: function () {
  23164. return this.head.elt
  23165. },
  23166. inlined_has: function (a) {
  23167. var b;
  23168. b = !1;
  23169. for (var d = this.head; null != d;) {
  23170. if (d.elt == a) {
  23171. b = !0;
  23172. break
  23173. }
  23174. d = d.next
  23175. }
  23176. return b
  23177. },
  23178. has: function (a) {
  23179. return this.inlined_has(a)
  23180. },
  23181. size: function () {
  23182. return this.length
  23183. },
  23184. empty: function () {
  23185. return null == this.head
  23186. },
  23187. reverse: function () {
  23188. for (var a = this.head, b = null; null != a;) {
  23189. var d = a.next;
  23190. a.next = b;
  23191. b = this.head = a;
  23192. a = d
  23193. }
  23194. this.pushmod = this.modified = !0
  23195. },
  23196. inlined_clear: function () {
  23197. for (; null != this.head;) this.inlined_pop();
  23198. this.pushmod = !0
  23199. },
  23200. clear: function () {
  23201. for (; null != this.head;) this.inlined_pop();
  23202. this.pushmod = !0
  23203. },
  23204. splice: function (a, b) {
  23205. for (; 0 < b-- && null != a.next;) this.erase(a);
  23206. return a.next
  23207. },
  23208. inlined_erase: function (a) {
  23209. var b, d;
  23210. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  23211. a = b;
  23212. a.elt = null;
  23213. a.next = c.util.ZNPNode_ZPP_Constraint.zpp_pool;
  23214. c.util.ZNPNode_ZPP_Constraint.zpp_pool = a;
  23215. this.modified = !0;
  23216. this.length--;
  23217. this.pushmod = !0;
  23218. return d
  23219. },
  23220. erase: function (a) {
  23221. return this.inlined_erase(a)
  23222. },
  23223. inlined_try_remove: function (a) {
  23224. for (var b = null, d =
  23225. this.head, c = !1; null != d;) {
  23226. if (d.elt == a) {
  23227. this.inlined_erase(b);
  23228. c = !0;
  23229. break
  23230. }
  23231. b = d;
  23232. d = d.next
  23233. }
  23234. return c
  23235. },
  23236. inlined_remove: function (a) {
  23237. this.inlined_try_remove(a)
  23238. },
  23239. try_remove: function (a) {
  23240. for (var b = null, d = this.head, c = !1; null != d;) {
  23241. if (d.elt == a) {
  23242. this.erase(b);
  23243. c = !0;
  23244. break
  23245. }
  23246. b = d;
  23247. d = d.next
  23248. }
  23249. return c
  23250. },
  23251. remove: function (a) {
  23252. this.inlined_try_remove(a)
  23253. },
  23254. inlined_pop_unsafe: function () {
  23255. var a = this.head.elt;
  23256. this.pop();
  23257. return a
  23258. },
  23259. pop_unsafe: function () {
  23260. return this.inlined_pop_unsafe()
  23261. },
  23262. inlined_pop: function () {
  23263. var a = this.head;
  23264. this.head = a.next;
  23265. a.elt = null;
  23266. a.next = c.util.ZNPNode_ZPP_Constraint.zpp_pool;
  23267. c.util.ZNPNode_ZPP_Constraint.zpp_pool = a;
  23268. null == this.head && (this.pushmod = !0);
  23269. this.modified = !0;
  23270. this.length--
  23271. },
  23272. pop: function () {
  23273. this.inlined_pop()
  23274. },
  23275. inlined_insert: function (a, b) {
  23276. var d;
  23277. null == c.util.ZNPNode_ZPP_Constraint.zpp_pool ? d = new c.util.ZNPNode_ZPP_Constraint : (d = c.util.ZNPNode_ZPP_Constraint.zpp_pool, c.util.ZNPNode_ZPP_Constraint.zpp_pool = d.next, d.next = null);
  23278. null;
  23279. d.elt = b;
  23280. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  23281. this.pushmod =
  23282. this.modified = !0;
  23283. this.length++;
  23284. return d
  23285. },
  23286. insert: function (a, b) {
  23287. return this.inlined_insert(a, b)
  23288. },
  23289. addAll: function (a) {
  23290. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  23291. },
  23292. inlined_add: function (a) {
  23293. var b;
  23294. null == c.util.ZNPNode_ZPP_Constraint.zpp_pool ? b = new c.util.ZNPNode_ZPP_Constraint : (b = c.util.ZNPNode_ZPP_Constraint.zpp_pool, c.util.ZNPNode_ZPP_Constraint.zpp_pool = b.next, b.next = null);
  23295. null;
  23296. b.elt = a;
  23297. b.next = this.head;
  23298. this.head = b;
  23299. this.modified = !0;
  23300. this.length++;
  23301. return a
  23302. },
  23303. add: function (a) {
  23304. return this.inlined_add(a)
  23305. },
  23306. setbegin: function (a) {
  23307. this.head = a;
  23308. this.pushmod = this.modified = !0
  23309. },
  23310. begin: function () {
  23311. return this.head
  23312. },
  23313. __class__: c.util.ZNPList_ZPP_Constraint
  23314. };
  23315. c.util.ZNPList_ZPP_Interactor = function () {
  23316. this.length = 0;
  23317. this.modified = this.pushmod = !1;
  23318. this.head = null
  23319. };
  23320. s["zpp_nape.util.ZNPList_ZPP_Interactor"] = c.util.ZNPList_ZPP_Interactor;
  23321. c.util.ZNPList_ZPP_Interactor.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Interactor"];
  23322. c.util.ZNPList_ZPP_Interactor.prototype = {
  23323. at: function (a) {
  23324. a = this.iterator_at(a);
  23325. return null != a ? a.elt : null
  23326. },
  23327. iterator_at: function (a) {
  23328. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  23329. return b
  23330. },
  23331. back: function () {
  23332. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  23333. return a.elt
  23334. },
  23335. front: function () {
  23336. return this.head.elt
  23337. },
  23338. inlined_has: function (a) {
  23339. var b;
  23340. b = !1;
  23341. for (var d = this.head; null != d;) {
  23342. if (d.elt == a) {
  23343. b = !0;
  23344. break
  23345. }
  23346. d = d.next
  23347. }
  23348. return b
  23349. },
  23350. has: function (a) {
  23351. return this.inlined_has(a)
  23352. },
  23353. size: function () {
  23354. return this.length
  23355. },
  23356. empty: function () {
  23357. return null == this.head
  23358. },
  23359. reverse: function () {
  23360. for (var a = this.head, b = null; null != a;) {
  23361. var d = a.next;
  23362. a.next = b;
  23363. b = this.head = a;
  23364. a = d
  23365. }
  23366. this.pushmod = this.modified = !0
  23367. },
  23368. inlined_clear: function () {
  23369. for (; null != this.head;) this.inlined_pop();
  23370. this.pushmod = !0
  23371. },
  23372. clear: function () {
  23373. for (; null != this.head;) this.inlined_pop();
  23374. this.pushmod = !0
  23375. },
  23376. splice: function (a, b) {
  23377. for (; 0 < b-- && null != a.next;) this.erase(a);
  23378. return a.next
  23379. },
  23380. inlined_erase: function (a) {
  23381. var b, d;
  23382. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  23383. a = b;
  23384. a.elt = null;
  23385. a.next = c.util.ZNPNode_ZPP_Interactor.zpp_pool;
  23386. c.util.ZNPNode_ZPP_Interactor.zpp_pool = a;
  23387. this.modified = !0;
  23388. this.length--;
  23389. this.pushmod = !0;
  23390. return d
  23391. },
  23392. erase: function (a) {
  23393. return this.inlined_erase(a)
  23394. },
  23395. inlined_try_remove: function (a) {
  23396. for (var b = null, d = this.head, c = !1; null != d;) {
  23397. if (d.elt == a) {
  23398. this.inlined_erase(b);
  23399. c = !0;
  23400. break
  23401. }
  23402. b = d;
  23403. d = d.next
  23404. }
  23405. return c
  23406. },
  23407. inlined_remove: function (a) {
  23408. this.inlined_try_remove(a)
  23409. },
  23410. try_remove: function (a) {
  23411. for (var b = null, d = this.head, c = !1; null != d;) {
  23412. if (d.elt == a) {
  23413. this.erase(b);
  23414. c = !0;
  23415. break
  23416. }
  23417. b = d;
  23418. d = d.next
  23419. }
  23420. return c
  23421. },
  23422. remove: function (a) {
  23423. this.inlined_try_remove(a)
  23424. },
  23425. inlined_pop_unsafe: function () {
  23426. var a = this.head.elt;
  23427. this.pop();
  23428. return a
  23429. },
  23430. pop_unsafe: function () {
  23431. return this.inlined_pop_unsafe()
  23432. },
  23433. inlined_pop: function () {
  23434. var a = this.head;
  23435. this.head = a.next;
  23436. a.elt = null;
  23437. a.next = c.util.ZNPNode_ZPP_Interactor.zpp_pool;
  23438. c.util.ZNPNode_ZPP_Interactor.zpp_pool = a;
  23439. null == this.head && (this.pushmod = !0);
  23440. this.modified = !0;
  23441. this.length--
  23442. },
  23443. pop: function () {
  23444. this.inlined_pop()
  23445. },
  23446. inlined_insert: function (a, b) {
  23447. var d;
  23448. null == c.util.ZNPNode_ZPP_Interactor.zpp_pool ? d = new c.util.ZNPNode_ZPP_Interactor : (d =
  23449. c.util.ZNPNode_ZPP_Interactor.zpp_pool, c.util.ZNPNode_ZPP_Interactor.zpp_pool = d.next, d.next = null);
  23450. null;
  23451. d.elt = b;
  23452. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  23453. this.pushmod = this.modified = !0;
  23454. this.length++;
  23455. return d
  23456. },
  23457. insert: function (a, b) {
  23458. return this.inlined_insert(a, b)
  23459. },
  23460. addAll: function (a) {
  23461. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  23462. },
  23463. inlined_add: function (a) {
  23464. var b;
  23465. null == c.util.ZNPNode_ZPP_Interactor.zpp_pool ? b = new c.util.ZNPNode_ZPP_Interactor : (b = c.util.ZNPNode_ZPP_Interactor.zpp_pool,
  23466. c.util.ZNPNode_ZPP_Interactor.zpp_pool = b.next, b.next = null);
  23467. null;
  23468. b.elt = a;
  23469. b.next = this.head;
  23470. this.head = b;
  23471. this.modified = !0;
  23472. this.length++;
  23473. return a
  23474. },
  23475. add: function (a) {
  23476. return this.inlined_add(a)
  23477. },
  23478. setbegin: function (a) {
  23479. this.head = a;
  23480. this.pushmod = this.modified = !0
  23481. },
  23482. begin: function () {
  23483. return this.head
  23484. },
  23485. __class__: c.util.ZNPList_ZPP_Interactor
  23486. };
  23487. c.util.ZNPList_ZPP_CbSet = function () {
  23488. this.length = 0;
  23489. this.modified = this.pushmod = !1;
  23490. this.head = null
  23491. };
  23492. s["zpp_nape.util.ZNPList_ZPP_CbSet"] = c.util.ZNPList_ZPP_CbSet;
  23493. c.util.ZNPList_ZPP_CbSet.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CbSet"];
  23494. c.util.ZNPList_ZPP_CbSet.prototype = {
  23495. at: function (a) {
  23496. a = this.iterator_at(a);
  23497. return null != a ? a.elt : null
  23498. },
  23499. iterator_at: function (a) {
  23500. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  23501. return b
  23502. },
  23503. back: function () {
  23504. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  23505. return a.elt
  23506. },
  23507. front: function () {
  23508. return this.head.elt
  23509. },
  23510. inlined_has: function (a) {
  23511. var b;
  23512. b = !1;
  23513. for (var d = this.head; null != d;) {
  23514. if (d.elt == a) {
  23515. b = !0;
  23516. break
  23517. }
  23518. d = d.next
  23519. }
  23520. return b
  23521. },
  23522. has: function (a) {
  23523. return this.inlined_has(a)
  23524. },
  23525. size: function () {
  23526. return this.length
  23527. },
  23528. empty: function () {
  23529. return null == this.head
  23530. },
  23531. reverse: function () {
  23532. for (var a = this.head, b = null; null != a;) {
  23533. var d = a.next;
  23534. a.next = b;
  23535. b = this.head = a;
  23536. a = d
  23537. }
  23538. this.pushmod = this.modified = !0
  23539. },
  23540. inlined_clear: function () {
  23541. for (; null != this.head;) this.inlined_pop();
  23542. this.pushmod = !0
  23543. },
  23544. clear: function () {
  23545. for (; null != this.head;) this.inlined_pop();
  23546. this.pushmod = !0
  23547. },
  23548. splice: function (a, b) {
  23549. for (; 0 < b-- && null != a.next;) this.erase(a);
  23550. return a.next
  23551. },
  23552. inlined_erase: function (a) {
  23553. var b, d;
  23554. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  23555. a = b;
  23556. a.elt = null;
  23557. a.next = c.util.ZNPNode_ZPP_CbSet.zpp_pool;
  23558. c.util.ZNPNode_ZPP_CbSet.zpp_pool = a;
  23559. this.modified = !0;
  23560. this.length--;
  23561. this.pushmod = !0;
  23562. return d
  23563. },
  23564. erase: function (a) {
  23565. return this.inlined_erase(a)
  23566. },
  23567. inlined_try_remove: function (a) {
  23568. for (var b = null, d = this.head, c = !1; null != d;) {
  23569. if (d.elt == a) {
  23570. this.inlined_erase(b);
  23571. c = !0;
  23572. break
  23573. }
  23574. b = d;
  23575. d = d.next
  23576. }
  23577. return c
  23578. },
  23579. inlined_remove: function (a) {
  23580. this.inlined_try_remove(a)
  23581. },
  23582. try_remove: function (a) {
  23583. for (var b = null, d = this.head,
  23584. c = !1; null != d;) {
  23585. if (d.elt == a) {
  23586. this.erase(b);
  23587. c = !0;
  23588. break
  23589. }
  23590. b = d;
  23591. d = d.next
  23592. }
  23593. return c
  23594. },
  23595. remove: function (a) {
  23596. this.inlined_try_remove(a)
  23597. },
  23598. inlined_pop_unsafe: function () {
  23599. var a = this.head.elt;
  23600. this.pop();
  23601. return a
  23602. },
  23603. pop_unsafe: function () {
  23604. return this.inlined_pop_unsafe()
  23605. },
  23606. inlined_pop: function () {
  23607. var a = this.head;
  23608. this.head = a.next;
  23609. a.elt = null;
  23610. a.next = c.util.ZNPNode_ZPP_CbSet.zpp_pool;
  23611. c.util.ZNPNode_ZPP_CbSet.zpp_pool = a;
  23612. null == this.head && (this.pushmod = !0);
  23613. this.modified = !0;
  23614. this.length--
  23615. },
  23616. pop: function () {
  23617. this.inlined_pop()
  23618. },
  23619. inlined_insert: function (a,
  23620. b) {
  23621. var d;
  23622. null == c.util.ZNPNode_ZPP_CbSet.zpp_pool ? d = new c.util.ZNPNode_ZPP_CbSet : (d = c.util.ZNPNode_ZPP_CbSet.zpp_pool, c.util.ZNPNode_ZPP_CbSet.zpp_pool = d.next, d.next = null);
  23623. null;
  23624. d.elt = b;
  23625. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  23626. this.pushmod = this.modified = !0;
  23627. this.length++;
  23628. return d
  23629. },
  23630. insert: function (a, b) {
  23631. return this.inlined_insert(a, b)
  23632. },
  23633. addAll: function (a) {
  23634. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  23635. },
  23636. inlined_add: function (a) {
  23637. var b;
  23638. null == c.util.ZNPNode_ZPP_CbSet.zpp_pool ? b = new c.util.ZNPNode_ZPP_CbSet :
  23639. (b = c.util.ZNPNode_ZPP_CbSet.zpp_pool, c.util.ZNPNode_ZPP_CbSet.zpp_pool = b.next, b.next = null);
  23640. null;
  23641. b.elt = a;
  23642. b.next = this.head;
  23643. this.head = b;
  23644. this.modified = !0;
  23645. this.length++;
  23646. return a
  23647. },
  23648. add: function (a) {
  23649. return this.inlined_add(a)
  23650. },
  23651. setbegin: function (a) {
  23652. this.head = a;
  23653. this.pushmod = this.modified = !0
  23654. },
  23655. begin: function () {
  23656. return this.head
  23657. },
  23658. __class__: c.util.ZNPList_ZPP_CbSet
  23659. };
  23660. c.callbacks.ZPP_CbType = function () {
  23661. this.cbsets = this.listeners = this.bodylisteners = this.conlisteners = null;
  23662. this.id = 0;
  23663. this.outer = this.userData = null;
  23664. this.id =
  23665. c.ZPP_ID.CbType();
  23666. this.listeners = new c.util.ZNPList_ZPP_InteractionListener;
  23667. this.bodylisteners = new c.util.ZNPList_ZPP_BodyListener;
  23668. this.conlisteners = new c.util.ZNPList_ZPP_ConstraintListener;
  23669. this.constraints = new c.util.ZNPList_ZPP_Constraint;
  23670. this.interactors = new c.util.ZNPList_ZPP_Interactor;
  23671. this.cbsets = new c.util.ZNPList_ZPP_CbSet
  23672. };
  23673. s["zpp_nape.callbacks.ZPP_CbType"] = c.callbacks.ZPP_CbType;
  23674. c.callbacks.ZPP_CbType.__name__ = ["zpp_nape", "callbacks", "ZPP_CbType"];
  23675. c.callbacks.ZPP_CbType.setlt = function (a,
  23676. b) {
  23677. return a.id < b.id
  23678. };
  23679. c.callbacks.ZPP_CbType.prototype = {
  23680. invalidateconstraint: function () {
  23681. for (var a = this.cbsets.head; null != a;) a.elt.zip_conlisteners = !0, a = a.next
  23682. },
  23683. removeconstraint: function (a) {
  23684. this.conlisteners.remove(a);
  23685. this.invalidateconstraint()
  23686. },
  23687. addconstraint: function (a) {
  23688. for (var b = null, d = this.conlisteners.head; null != d;) {
  23689. var c = d.elt;
  23690. if (a.precedence > c.precedence || a.precedence == c.precedence && a.id > c.id) break;
  23691. b = d;
  23692. d = d.next
  23693. }
  23694. this.conlisteners.inlined_insert(b, a);
  23695. this.invalidateconstraint()
  23696. },
  23697. invalidatebody: function () {
  23698. for (var a =
  23699. this.cbsets.head; null != a;) a.elt.zip_bodylisteners = !0, a = a.next
  23700. },
  23701. removebody: function (a) {
  23702. this.bodylisteners.remove(a);
  23703. this.invalidatebody()
  23704. },
  23705. addbody: function (a) {
  23706. for (var b = null, d = this.bodylisteners.head; null != d;) {
  23707. var c = d.elt;
  23708. if (a.precedence > c.precedence || a.precedence == c.precedence && a.id > c.id) break;
  23709. b = d;
  23710. d = d.next
  23711. }
  23712. this.bodylisteners.inlined_insert(b, a);
  23713. this.invalidatebody()
  23714. },
  23715. invalidateint: function () {
  23716. for (var a = this.cbsets.head; null != a;) {
  23717. var b = a.elt;
  23718. b.zip_listeners = !0;
  23719. b.invalidate_pairs();
  23720. a = a.next
  23721. }
  23722. },
  23723. removeint: function (a) {
  23724. this.listeners.remove(a);
  23725. this.invalidateint()
  23726. },
  23727. addint: function (a) {
  23728. for (var b = null, d = this.listeners.head; null != d;) {
  23729. var c = d.elt;
  23730. if (a.precedence > c.precedence || a.precedence == c.precedence && a.id > c.id) break;
  23731. b = d;
  23732. d = d.next
  23733. }
  23734. this.listeners.inlined_insert(b, a);
  23735. this.invalidateint()
  23736. },
  23737. remInteractor: function (a) {
  23738. this.interactors.remove(a)
  23739. },
  23740. remConstraint: function (a) {
  23741. this.constraints.remove(a)
  23742. },
  23743. addInteractor: function (a) {
  23744. this.interactors.add(a)
  23745. },
  23746. addConstraint: function (a) {
  23747. this.constraints.add(a)
  23748. },
  23749. __class__: c.callbacks.ZPP_CbType
  23750. };
  23751. c.util.ZPP_Flags =
  23752. function () {};
  23753. s["zpp_nape.util.ZPP_Flags"] = c.util.ZPP_Flags;
  23754. c.util.ZPP_Flags.__name__ = ["zpp_nape", "util", "ZPP_Flags"];
  23755. c.callbacks.ZPP_Listener = function () {
  23756. this.body = this.constraint = this.interaction = this.space = null;
  23757. this.id = this.type = this.event = this.precedence = 0;
  23758. this.outer = null;
  23759. this.id = c.ZPP_ID.Listener()
  23760. };
  23761. s["zpp_nape.callbacks.ZPP_Listener"] = c.callbacks.ZPP_Listener;
  23762. c.callbacks.ZPP_Listener.__name__ = ["zpp_nape", "callbacks", "ZPP_Listener"];
  23763. c.callbacks.ZPP_Listener.setlt = function (a, b) {
  23764. return a.precedence >
  23765. b.precedence || a.precedence == b.precedence && a.id > b.id
  23766. };
  23767. c.callbacks.ZPP_Listener.prototype = {
  23768. removedFromSpace: function () {},
  23769. addedToSpace: function () {},
  23770. invalidate_precedence: function () {},
  23771. swapEvent: function (a) {},
  23772. __class__: c.callbacks.ZPP_Listener
  23773. };
  23774. c.callbacks.ZPP_BodyListener = function (a, b, d) {
  23775. this.outer_zn = this.options = this.handler = null;
  23776. c.callbacks.ZPP_Listener.call(this);
  23777. this.event = b;
  23778. this.handler = d;
  23779. this.body = this;
  23780. this.type = c.util.ZPP_Flags.id_ListenerType_BODY;
  23781. this.options = a.zpp_inner
  23782. };
  23783. s["zpp_nape.callbacks.ZPP_BodyListener"] =
  23784. c.callbacks.ZPP_BodyListener;
  23785. c.callbacks.ZPP_BodyListener.__name__ = ["zpp_nape", "callbacks", "ZPP_BodyListener"];
  23786. c.callbacks.ZPP_BodyListener.__super__ = c.callbacks.ZPP_Listener;
  23787. c.callbacks.ZPP_BodyListener.prototype = I(c.callbacks.ZPP_Listener.prototype, {
  23788. swapEvent: function (a) {
  23789. if (a != c.util.ZPP_Flags.id_CbEvent_WAKE && a != c.util.ZPP_Flags.id_CbEvent_SLEEP) throw "Error: BodyListener event must be either WAKE or SLEEP only";
  23790. this.removedFromSpace();
  23791. this.event = a;
  23792. this.addedToSpace()
  23793. },
  23794. invalidate_precedence: function () {
  23795. null !=
  23796. this.space && (this.removedFromSpace(), this.addedToSpace())
  23797. },
  23798. cbtype_change: function (a, b, d) {
  23799. this.removedFromSpace();
  23800. this.options.effect_change(a, b, d);
  23801. this.addedToSpace()
  23802. },
  23803. removedFromSpace: function () {
  23804. for (var a = this.options.includes.head; null != a;) {
  23805. var b = a.elt;
  23806. b.bodylisteners.remove(this);
  23807. b.invalidatebody();
  23808. a = a.next
  23809. }
  23810. this.options.handler = null
  23811. },
  23812. addedToSpace: function () {
  23813. this.options.handler = A(this, this.cbtype_change);
  23814. for (var a = this.options.includes.head; null != a;) a.elt.addbody(this), a = a.next
  23815. },
  23816. immutable_options: function () {
  23817. if (null !=
  23818. this.space && this.space.midstep) throw "Error: Cannot change listener type options during space.step()";
  23819. },
  23820. __class__: c.callbacks.ZPP_BodyListener
  23821. });
  23822. c.callbacks.ZPP_ConstraintListener = function (a, b, d) {
  23823. this.outer_zn = this.options = this.handler = null;
  23824. c.callbacks.ZPP_Listener.call(this);
  23825. this.event = b;
  23826. this.handler = d;
  23827. this.constraint = this;
  23828. this.type = c.util.ZPP_Flags.id_ListenerType_CONSTRAINT;
  23829. this.options = a.zpp_inner
  23830. };
  23831. s["zpp_nape.callbacks.ZPP_ConstraintListener"] = c.callbacks.ZPP_ConstraintListener;
  23832. c.callbacks.ZPP_ConstraintListener.__name__ = ["zpp_nape", "callbacks", "ZPP_ConstraintListener"];
  23833. c.callbacks.ZPP_ConstraintListener.__super__ = c.callbacks.ZPP_Listener;
  23834. c.callbacks.ZPP_ConstraintListener.prototype = I(c.callbacks.ZPP_Listener.prototype, {
  23835. swapEvent: function (a) {
  23836. if (a != c.util.ZPP_Flags.id_CbEvent_WAKE && a != c.util.ZPP_Flags.id_CbEvent_SLEEP && a != c.util.ZPP_Flags.id_CbEvent_BREAK) throw "Error: ConstraintListener event must be either WAKE or SLEEP only";
  23837. this.removedFromSpace();
  23838. this.event = a;
  23839. this.addedToSpace()
  23840. },
  23841. invalidate_precedence: function () {
  23842. null !=
  23843. this.space && (this.removedFromSpace(), this.addedToSpace())
  23844. },
  23845. cbtype_change: function (a, b, d) {
  23846. this.removedFromSpace();
  23847. this.options.effect_change(a, b, d);
  23848. this.addedToSpace()
  23849. },
  23850. removedFromSpace: function () {
  23851. for (var a = this.options.includes.head; null != a;) {
  23852. var b = a.elt;
  23853. b.conlisteners.remove(this);
  23854. b.invalidateconstraint();
  23855. a = a.next
  23856. }
  23857. this.options.handler = null
  23858. },
  23859. addedToSpace: function () {
  23860. this.options.handler = A(this, this.cbtype_change);
  23861. for (var a = this.options.includes.head; null != a;) a.elt.addconstraint(this), a = a.next
  23862. },
  23863. immutable_options: function () {
  23864. if (null !=
  23865. this.space && this.space.midstep) throw "Error: Cannot change listener type options during space.step()";
  23866. },
  23867. __class__: c.callbacks.ZPP_ConstraintListener
  23868. });
  23869. c.util.ZNPList_ZPP_CbType = function () {
  23870. this.length = 0;
  23871. this.modified = this.pushmod = !1;
  23872. this.head = null
  23873. };
  23874. s["zpp_nape.util.ZNPList_ZPP_CbType"] = c.util.ZNPList_ZPP_CbType;
  23875. c.util.ZNPList_ZPP_CbType.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CbType"];
  23876. c.util.ZNPList_ZPP_CbType.prototype = {
  23877. at: function (a) {
  23878. a = this.iterator_at(a);
  23879. return null != a ? a.elt : null
  23880. },
  23881. iterator_at: function (a) {
  23882. for (var b =
  23883. this.head; 0 < a-- && null != b;) b = b.next;
  23884. return b
  23885. },
  23886. back: function () {
  23887. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  23888. return a.elt
  23889. },
  23890. front: function () {
  23891. return this.head.elt
  23892. },
  23893. inlined_has: function (a) {
  23894. var b;
  23895. b = !1;
  23896. for (var d = this.head; null != d;) {
  23897. if (d.elt == a) {
  23898. b = !0;
  23899. break
  23900. }
  23901. d = d.next
  23902. }
  23903. return b
  23904. },
  23905. has: function (a) {
  23906. return this.inlined_has(a)
  23907. },
  23908. size: function () {
  23909. return this.length
  23910. },
  23911. empty: function () {
  23912. return null == this.head
  23913. },
  23914. reverse: function () {
  23915. for (var a = this.head, b = null; null != a;) {
  23916. var d = a.next;
  23917. a.next = b;
  23918. b = this.head = a;
  23919. a = d
  23920. }
  23921. this.pushmod = this.modified = !0
  23922. },
  23923. inlined_clear: function () {
  23924. for (; null != this.head;) this.inlined_pop();
  23925. this.pushmod = !0
  23926. },
  23927. clear: function () {
  23928. for (; null != this.head;) this.inlined_pop();
  23929. this.pushmod = !0
  23930. },
  23931. splice: function (a, b) {
  23932. for (; 0 < b-- && null != a.next;) this.erase(a);
  23933. return a.next
  23934. },
  23935. inlined_erase: function (a) {
  23936. var b, d;
  23937. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  23938. a = b;
  23939. a.elt = null;
  23940. a.next = c.util.ZNPNode_ZPP_CbType.zpp_pool;
  23941. c.util.ZNPNode_ZPP_CbType.zpp_pool = a;
  23942. this.modified = !0;
  23943. this.length--;
  23944. this.pushmod = !0;
  23945. return d
  23946. },
  23947. erase: function (a) {
  23948. return this.inlined_erase(a)
  23949. },
  23950. inlined_try_remove: function (a) {
  23951. for (var b = null, d = this.head, c = !1; null != d;) {
  23952. if (d.elt == a) {
  23953. this.inlined_erase(b);
  23954. c = !0;
  23955. break
  23956. }
  23957. b = d;
  23958. d = d.next
  23959. }
  23960. return c
  23961. },
  23962. inlined_remove: function (a) {
  23963. this.inlined_try_remove(a)
  23964. },
  23965. try_remove: function (a) {
  23966. for (var b = null, d = this.head, c = !1; null != d;) {
  23967. if (d.elt == a) {
  23968. this.erase(b);
  23969. c = !0;
  23970. break
  23971. }
  23972. b = d;
  23973. d = d.next
  23974. }
  23975. return c
  23976. },
  23977. remove: function (a) {
  23978. this.inlined_try_remove(a)
  23979. },
  23980. inlined_pop_unsafe: function () {
  23981. var a = this.head.elt;
  23982. this.pop();
  23983. return a
  23984. },
  23985. pop_unsafe: function () {
  23986. return this.inlined_pop_unsafe()
  23987. },
  23988. inlined_pop: function () {
  23989. var a = this.head;
  23990. this.head = a.next;
  23991. a.elt = null;
  23992. a.next = c.util.ZNPNode_ZPP_CbType.zpp_pool;
  23993. c.util.ZNPNode_ZPP_CbType.zpp_pool = a;
  23994. null == this.head && (this.pushmod = !0);
  23995. this.modified = !0;
  23996. this.length--
  23997. },
  23998. pop: function () {
  23999. this.inlined_pop()
  24000. },
  24001. inlined_insert: function (a, b) {
  24002. var d;
  24003. null == c.util.ZNPNode_ZPP_CbType.zpp_pool ? d = new c.util.ZNPNode_ZPP_CbType : (d = c.util.ZNPNode_ZPP_CbType.zpp_pool, c.util.ZNPNode_ZPP_CbType.zpp_pool =
  24004. d.next, d.next = null);
  24005. null;
  24006. d.elt = b;
  24007. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  24008. this.pushmod = this.modified = !0;
  24009. this.length++;
  24010. return d
  24011. },
  24012. insert: function (a, b) {
  24013. return this.inlined_insert(a, b)
  24014. },
  24015. addAll: function (a) {
  24016. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  24017. },
  24018. inlined_add: function (a) {
  24019. var b;
  24020. null == c.util.ZNPNode_ZPP_CbType.zpp_pool ? b = new c.util.ZNPNode_ZPP_CbType : (b = c.util.ZNPNode_ZPP_CbType.zpp_pool, c.util.ZNPNode_ZPP_CbType.zpp_pool = b.next, b.next = null);
  24021. null;
  24022. b.elt = a;
  24023. b.next = this.head;
  24024. this.head =
  24025. b;
  24026. this.modified = !0;
  24027. this.length++;
  24028. return a
  24029. },
  24030. add: function (a) {
  24031. return this.inlined_add(a)
  24032. },
  24033. setbegin: function (a) {
  24034. this.head = a;
  24035. this.pushmod = this.modified = !0
  24036. },
  24037. begin: function () {
  24038. return this.head
  24039. },
  24040. __class__: c.util.ZNPList_ZPP_CbType
  24041. };
  24042. c.callbacks.ZPP_InteractionListener = function (a, b, d, g) {
  24043. this.handlerp = null;
  24044. this.allowSleepingCallbacks = this.pure = !1;
  24045. this.options1 = this.options2 = this.handleri = null;
  24046. this.itype = 0;
  24047. this.outer_zni = this.outer_znp = null;
  24048. c.callbacks.ZPP_Listener.call(this);
  24049. this.type = g;
  24050. this.interaction = this;
  24051. this.event = d;
  24052. this.options1 = a.zpp_inner;
  24053. this.options2 = b.zpp_inner;
  24054. this.allowSleepingCallbacks = !1
  24055. };
  24056. s["zpp_nape.callbacks.ZPP_InteractionListener"] = c.callbacks.ZPP_InteractionListener;
  24057. c.callbacks.ZPP_InteractionListener.__name__ = ["zpp_nape", "callbacks", "ZPP_InteractionListener"];
  24058. c.callbacks.ZPP_InteractionListener.__super__ = c.callbacks.ZPP_Listener;
  24059. c.callbacks.ZPP_InteractionListener.prototype = I(c.callbacks.ZPP_Listener.prototype, {
  24060. swapEvent: function (a) {
  24061. if (this.type == c.util.ZPP_Flags.id_ListenerType_PRE) throw "Error: PreListener event can only be PRE";
  24062. if (a != c.util.ZPP_Flags.id_CbEvent_BEGIN && a != c.util.ZPP_Flags.id_CbEvent_END && a != c.util.ZPP_Flags.id_CbEvent_ONGOING) throw "Error: InteractionListener event must be either BEGIN, END, ONGOING";
  24063. this.removedFromSpace();
  24064. this.event = a;
  24065. this.addedToSpace()
  24066. },
  24067. cbtype_change: function (a, b, d, c) {
  24068. this.removedFromSpace();
  24069. a.effect_change(b, d, c);
  24070. this.addedToSpace();
  24071. null
  24072. },
  24073. cbtype_change2: function (a, b, d) {
  24074. this.cbtype_change(this.options2, a, b, d)
  24075. },
  24076. cbtype_change1: function (a, b, d) {
  24077. this.cbtype_change(this.options1, a, b, d)
  24078. },
  24079. invalidate_precedence: function () {
  24080. var a =
  24081. this;
  24082. if (null != this.space) {
  24083. var b = this.type == c.util.ZPP_Flags.id_ListenerType_PRE;
  24084. this.with_union(function (d) {
  24085. d.listeners.remove(a);
  24086. d.invalidateint();
  24087. d.addint(a);
  24088. if (b)
  24089. for (d = d.interactors.head; null != d;) d.elt.wake(), d = d.next
  24090. })
  24091. }
  24092. },
  24093. removedFromSpace: function () {
  24094. var a = this;
  24095. this.with_uniquesets(!1);
  24096. var b = this.type == c.util.ZPP_Flags.id_ListenerType_PRE;
  24097. this.with_union(function (d) {
  24098. d.listeners.remove(a);
  24099. d.invalidateint();
  24100. if (b)
  24101. for (d = d.interactors.head; null != d;) d.elt.wake(), d = d.next
  24102. });
  24103. this.options1.handler = null;
  24104. this.options2.handler = null
  24105. },
  24106. addedToSpace: function () {
  24107. var a = this,
  24108. b = this.type == c.util.ZPP_Flags.id_ListenerType_PRE;
  24109. this.with_union(function (d) {
  24110. d.addint(a);
  24111. if (b)
  24112. for (d = d.interactors.head; null != d;) d.elt.wake(), d = d.next
  24113. });
  24114. this.options1.handler = A(this, this.cbtype_change1);
  24115. this.options2.handler = A(this, this.cbtype_change2);
  24116. this.with_uniquesets(!0)
  24117. },
  24118. with_union: function (a) {
  24119. for (var b = this.options1.includes.head, d = this.options2.includes.head; null != b && null != d;) {
  24120. var c = b.elt,
  24121. e = d.elt;
  24122. c == e ? (a(c), b = b.next, d = d.next) :
  24123. c.id < e.id ? (a(c), b = b.next) : (a(e), d = d.next)
  24124. }
  24125. for (; null != b;) a(b.elt), b = b.next;
  24126. for (; null != d;) a(d.elt), d = d.next
  24127. },
  24128. with_uniquesets: function (a) {
  24129. var b = this,
  24130. d;
  24131. null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? d = new c.util.ZPP_Set_ZPP_CbSetPair : (d = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = d.next, d.next = null);
  24132. null;
  24133. d.lt = c.callbacks.ZPP_CbSetPair.setlt;
  24134. this.CbTypeset(this.options1.includes, this.options2.includes, function (a, g) {
  24135. b.CbSetset(a.cbsets, g.cbsets, function (a, e) {
  24136. a.validate();
  24137. e.validate();
  24138. c.callbacks.ZPP_CbSet.single_intersection(a, e, b) && d.try_insert(c.callbacks.ZPP_CbSetPair.get(a, e))
  24139. })
  24140. });
  24141. d.clear_with(function (d) {
  24142. a ? b.space.freshListenerType(d.a, d.b) : b.space.nullListenerType(d.a, d.b);
  24143. d.a = d.b = null;
  24144. d.listeners.clear();
  24145. d.next = c.callbacks.ZPP_CbSetPair.zpp_pool;
  24146. c.callbacks.ZPP_CbSetPair.zpp_pool = d
  24147. });
  24148. var g = d;
  24149. g.data = null;
  24150. g.lt = null;
  24151. g.swapped = null;
  24152. g.next = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool;
  24153. c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = g
  24154. },
  24155. CbTypeset: function (a, b, d) {
  24156. var g = c.callbacks.ZPP_InteractionListener.UCbType,
  24157. e = c.callbacks.ZPP_InteractionListener.VCbType,
  24158. f = c.callbacks.ZPP_InteractionListener.WCbType;
  24159. a = a.head;
  24160. for (var l = b.head; null != a && null != l;) {
  24161. var m = a.elt,
  24162. h = l.elt;
  24163. m == h ? (f.inlined_add(m), a = a.next, l = l.next) : m.id < h.id ? (g.inlined_add(m), a = a.next) : (e.inlined_add(h), l = l.next)
  24164. }
  24165. for (; null != a;) g.inlined_add(a.elt), a = a.next;
  24166. for (; null != l;) e.inlined_add(l.elt), l = l.next;
  24167. for (; null != g.head;)
  24168. for (a = g.pop_unsafe(), l = b.head; null != l;) m = l.elt, d(a, m), l = l.next;
  24169. for (; null != e.head;)
  24170. for (a = e.pop_unsafe(), l = f.head; null != l;) m = l.elt,
  24171. d(a, m), l = l.next;
  24172. for (; null != f.head;)
  24173. for (a = f.pop_unsafe(), d(a, a), l = f.head; null != l;) m = l.elt, d(a, m), l = l.next
  24174. },
  24175. CbSetset: function (a, b, d) {
  24176. var g = c.callbacks.ZPP_InteractionListener.UCbSet,
  24177. e = c.callbacks.ZPP_InteractionListener.VCbSet,
  24178. f = c.callbacks.ZPP_InteractionListener.WCbSet;
  24179. a = a.head;
  24180. for (var l = b.head; null != a && null != l;) {
  24181. var m = a.elt,
  24182. h = l.elt;
  24183. m == h ? (f.inlined_add(m), a = a.next, l = l.next) : c.callbacks.ZPP_CbSet.setlt(m, h) ? (g.inlined_add(m), a = a.next) : (e.inlined_add(h), l = l.next)
  24184. }
  24185. for (; null != a;) g.inlined_add(a.elt),
  24186. a = a.next;
  24187. for (; null != l;) e.inlined_add(l.elt), l = l.next;
  24188. for (; null != g.head;)
  24189. for (a = g.pop_unsafe(), l = b.head; null != l;) m = l.elt, d(a, m), l = l.next;
  24190. for (; null != e.head;)
  24191. for (a = e.pop_unsafe(), l = f.head; null != l;) m = l.elt, d(a, m), l = l.next;
  24192. for (; null != f.head;)
  24193. for (a = f.pop_unsafe(), d(a, a), l = f.head; null != l;) m = l.elt, d(a, m), l = l.next
  24194. },
  24195. wake: function () {
  24196. this.with_union(function (a) {
  24197. for (a = a.interactors.head; null != a;) a.elt.wake(), a = a.next
  24198. })
  24199. },
  24200. setInteractionType: function (a) {
  24201. this.itype = a
  24202. },
  24203. __class__: c.callbacks.ZPP_InteractionListener
  24204. });
  24205. c.callbacks.ZPP_OptionType = function () {
  24206. this.outer = this.handler = this.includes = this.excludes = this.wrap_includes = this.wrap_excludes = null;
  24207. this.includes = new c.util.ZNPList_ZPP_CbType;
  24208. this.excludes = new c.util.ZNPList_ZPP_CbType
  24209. };
  24210. s["zpp_nape.callbacks.ZPP_OptionType"] = c.callbacks.ZPP_OptionType;
  24211. c.callbacks.ZPP_OptionType.__name__ = ["zpp_nape", "callbacks", "ZPP_OptionType"];
  24212. c.callbacks.ZPP_OptionType.argument = function (a) {
  24213. return null == a ? new h.callbacks.OptionType : F.Boot.__instanceof(a, h.callbacks.OptionType) ?
  24214. a : (new h.callbacks.OptionType).including(a)
  24215. };
  24216. c.callbacks.ZPP_OptionType.prototype = {
  24217. append: function (a, b) {
  24218. if (null == b) throw "Error: Cannot append null, only CbType and CbType list values";
  24219. if (F.Boot.__instanceof(b, h.callbacks.CbType)) {
  24220. var d;
  24221. this.append_type(a, b.zpp_inner)
  24222. } else if (F.Boot.__instanceof(b, h.callbacks.CbTypeList)) {
  24223. var c = b;
  24224. c.zpp_inner.valmod();
  24225. for (c = h.callbacks.CbTypeIterator.get(c); c.hasNext();) d = c.next(), this.append_type(a, d.zpp_inner)
  24226. } else if (F.Boot.__instanceof(b, Array))
  24227. for (var c = b, e = 0; e <
  24228. c.length;) {
  24229. d = c[e];
  24230. ++e;
  24231. if (!F.Boot.__instanceof(d, h.callbacks.CbType)) throw "Error: Cannot append non-CbType or CbType list value";
  24232. this.append_type(a, d.zpp_inner)
  24233. } else throw "Error: Cannot append non-CbType or CbType list value";
  24234. },
  24235. set: function (a) {
  24236. if (a != this) {
  24237. for (; null != this.includes.head;) this.append_type(this.excludes, this.includes.head.elt);
  24238. for (; null != this.excludes.head;) this.append_type(this.includes, this.excludes.head.elt);
  24239. for (var b = a.excludes.head; null != b;) {
  24240. var d = b.elt;
  24241. this.append_type(this.excludes,
  24242. d);
  24243. b = b.next
  24244. }
  24245. for (b = a.includes.head; null != b;) d = b.elt, this.append_type(this.includes, d), b = b.next
  24246. }
  24247. return this
  24248. },
  24249. append_type: function (a, b) {
  24250. a == this.includes ? this.includes.has(b) || (this.excludes.has(b) ? null != this.handler ? this.handler(b, !1, !1) : this.effect_change(b, !1, !1) : null != this.handler ? this.handler(b, !0, !0) : this.effect_change(b, !0, !0)) : this.excludes.has(b) || (this.includes.has(b) ? null != this.handler ? this.handler(b, !0, !1) : this.effect_change(b, !0, !1) : null != this.handler ? this.handler(b, !1, !0) : this.effect_change(b, !1, !0))
  24251. },
  24252. effect_change: function (a, b, d) {
  24253. if (b)
  24254. if (d) {
  24255. b = null;
  24256. for (d = this.includes.head; null != d;) {
  24257. var c = d.elt;
  24258. if (a.id < c.id) break;
  24259. b = d;
  24260. d = d.next
  24261. }
  24262. this.includes.inlined_insert(b, a)
  24263. } else this.includes.remove(a);
  24264. else if (d) {
  24265. b = null;
  24266. for (d = this.excludes.head; null != d;) {
  24267. c = d.elt;
  24268. if (a.id < c.id) break;
  24269. b = d;
  24270. d = d.next
  24271. }
  24272. this.excludes.inlined_insert(b, a)
  24273. } else this.excludes.remove(a)
  24274. },
  24275. nonemptyintersection: function (a, b) {
  24276. for (var d = !1, c = a.head, e = b.head; null != e && null != c;) {
  24277. var f = e.elt,
  24278. l = c.elt;
  24279. if (f == l) {
  24280. d = !0;
  24281. break
  24282. } else f.id < l.id ? e = e.next :
  24283. c = c.next
  24284. }
  24285. return d
  24286. },
  24287. compatible: function (a) {
  24288. return this.nonemptyintersection(a, this.includes) && !this.nonemptyintersection(a, this.excludes)
  24289. },
  24290. included: function (a) {
  24291. return this.nonemptyintersection(a, this.includes)
  24292. },
  24293. excluded: function (a) {
  24294. return this.nonemptyintersection(a, this.excludes)
  24295. },
  24296. setup_excludes: function () {
  24297. this.wrap_excludes = c.util.ZPP_CbTypeList.get(this.excludes, !0)
  24298. },
  24299. setup_includes: function () {
  24300. this.wrap_includes = c.util.ZPP_CbTypeList.get(this.includes, !0)
  24301. },
  24302. __class__: c.callbacks.ZPP_OptionType
  24303. };
  24304. c.constraint = {};
  24305. c.constraint.ZPP_Constraint = function () {
  24306. this.pre_dt = 0;
  24307. this.cbTypes = this.cbSet = this.wrap_cbTypes = null;
  24308. this.ignore = this.__velocity = !1;
  24309. this.component = null;
  24310. this.breakUnderForce = this.breakUnderError = this.removeOnBreak = !1;
  24311. this.frequency = this.damping = this.maxForce = this.maxError = 0;
  24312. this.active = this.stiff = !1;
  24313. this.userData = this.compound = this.space = null;
  24314. this.id = 0;
  24315. this.outer = null;
  24316. this.__velocity = !1;
  24317. this.id = c.ZPP_ID.Constraint();
  24318. this.active = this.stiff = !0;
  24319. this.ignore = !1;
  24320. this.frequency = 10;
  24321. this.damping = 1;
  24322. this.maxError =
  24323. this.maxForce = Math.POSITIVE_INFINITY;
  24324. this.breakUnderForce = !1;
  24325. this.removeOnBreak = !0;
  24326. this.pre_dt = -1;
  24327. this.cbTypes = new c.util.ZNPList_ZPP_CbType
  24328. };
  24329. s["zpp_nape.constraint.ZPP_Constraint"] = c.constraint.ZPP_Constraint;
  24330. c.constraint.ZPP_Constraint.__name__ = ["zpp_nape", "constraint", "ZPP_Constraint"];
  24331. c.constraint.ZPP_Constraint.prototype = {
  24332. copyto: function (a) {
  24333. var b = this.outer;
  24334. null == b.zpp_inner.wrap_cbTypes && b.zpp_inner.setupcbTypes();
  24335. for (var d = b.zpp_inner.wrap_cbTypes.iterator(); d.hasNext();) {
  24336. var c = d.next();
  24337. null ==
  24338. a.zpp_inner.wrap_cbTypes && a.zpp_inner.setupcbTypes();
  24339. a.zpp_inner.wrap_cbTypes.add(c)
  24340. }
  24341. a.zpp_inner.removeOnBreak = b.zpp_inner.removeOnBreak;
  24342. a.zpp_inner.removeOnBreak;
  24343. a.set_breakUnderError(b.zpp_inner.breakUnderError);
  24344. a.set_breakUnderForce(b.zpp_inner.breakUnderForce);
  24345. a.set_maxError(b.zpp_inner.maxError);
  24346. a.set_maxForce(b.zpp_inner.maxForce);
  24347. a.set_damping(b.zpp_inner.damping);
  24348. a.set_frequency(b.zpp_inner.frequency);
  24349. a.set_stiff(b.zpp_inner.stiff);
  24350. a.set_ignore(b.zpp_inner.ignore);
  24351. a.set_active(b.zpp_inner.active)
  24352. },
  24353. copy: function (a, b) {
  24354. return null
  24355. },
  24356. draw: function (a) {},
  24357. wake: function () {
  24358. null != this.space && this.space.wake_constraint(this)
  24359. },
  24360. applyImpulsePos: function () {
  24361. return !1
  24362. },
  24363. applyImpulseVel: function () {
  24364. return !1
  24365. },
  24366. preStep: function (a) {
  24367. return !1
  24368. },
  24369. warmStart: function () {},
  24370. broken: function () {},
  24371. pair_exists: function (a, b) {
  24372. return !1
  24373. },
  24374. forest: function () {},
  24375. wake_connected: function () {},
  24376. validate: function () {},
  24377. clearcache: function () {},
  24378. inactiveBodies: function () {},
  24379. activeBodies: function () {},
  24380. inactiveOrOutSpace: function () {
  24381. this.dealloc_cbSet();
  24382. var a = this.component;
  24383. a.body = null;
  24384. a.constraint = null;
  24385. null;
  24386. a.next = c.space.ZPP_Component.zpp_pool;
  24387. c.space.ZPP_Component.zpp_pool = a;
  24388. this.component = null
  24389. },
  24390. activeInSpace: function () {
  24391. this.alloc_cbSet();
  24392. null == c.space.ZPP_Component.zpp_pool ? this.component = new c.space.ZPP_Component : (this.component = c.space.ZPP_Component.zpp_pool, c.space.ZPP_Component.zpp_pool = this.component.next, this.component.next = null);
  24393. null;
  24394. this.component.isBody = !1;
  24395. this.component.constraint = this
  24396. },
  24397. removedFromSpace: function () {
  24398. this.active && this.inactiveOrOutSpace();
  24399. this.inactiveBodies();
  24400. for (var a = this.cbTypes.head; null != a;) a.elt.constraints.remove(this), a = a.next
  24401. },
  24402. addedToSpace: function () {
  24403. this.active && this.activeInSpace();
  24404. this.activeBodies();
  24405. for (var a = this.cbTypes.head; null != a;) a.elt.constraints.add(this), a = a.next
  24406. },
  24407. deactivate: function () {
  24408. null != this.space && this.inactiveOrOutSpace()
  24409. },
  24410. activate: function () {
  24411. null != this.space && this.activeInSpace()
  24412. },
  24413. dealloc_cbSet: function () {
  24414. if (null != this.cbSet) {
  24415. this.cbSet.constraints.remove(this);
  24416. if (0 == --this.cbSet.count) {
  24417. this.space.cbsets.remove(this.cbSet);
  24418. var a = this.cbSet;
  24419. a.free();
  24420. a.next = c.callbacks.ZPP_CbSet.zpp_pool;
  24421. c.callbacks.ZPP_CbSet.zpp_pool = a
  24422. }
  24423. this.cbSet = null
  24424. }
  24425. },
  24426. alloc_cbSet: function () {
  24427. null != (this.cbSet = this.space.cbsets.get(this.cbTypes)) && (this.cbSet.count++, this.cbSet.constraints.add(this))
  24428. },
  24429. insert_cbtype: function (a) {
  24430. if (!this.cbTypes.has(a)) {
  24431. null != this.space && (this.dealloc_cbSet(), a.constraints.add(this));
  24432. for (var b = null, d = this.cbTypes.head; null != d && !(a.id < d.elt.id);) b = d, d = d.next;
  24433. this.cbTypes.inlined_insert(b, a);
  24434. null != this.space && (this.alloc_cbSet(),
  24435. this.wake())
  24436. }
  24437. },
  24438. wrap_cbTypes_adder: function (a) {
  24439. this.insert_cbtype(a.zpp_inner);
  24440. return !1
  24441. },
  24442. wrap_cbTypes_subber: function (a) {
  24443. a = a.zpp_inner;
  24444. this.cbTypes.has(a) && (null != this.space && (this.dealloc_cbSet(), a.constraints.remove(this)), this.cbTypes.remove(a), null != this.space && (this.alloc_cbSet(), this.wake()))
  24445. },
  24446. immutable_cbTypes: function () {
  24447. this.immutable_midstep("Constraint::cbTypes")
  24448. },
  24449. setupcbTypes: function () {
  24450. this.wrap_cbTypes = c.util.ZPP_CbTypeList.get(this.cbTypes);
  24451. this.wrap_cbTypes.zpp_inner.adder = A(this, this.wrap_cbTypes_adder);
  24452. this.wrap_cbTypes.zpp_inner.subber = A(this, this.wrap_cbTypes_subber);
  24453. this.wrap_cbTypes.zpp_inner.dontremove = !0;
  24454. this.wrap_cbTypes.zpp_inner._modifiable = A(this, this.immutable_cbTypes)
  24455. },
  24456. immutable_midstep: function (a) {
  24457. if (null != this.space && this.space.midstep) throw "Error: Constraint::" + a + " cannot be set during space step()";
  24458. },
  24459. clear: function () {},
  24460. __class__: c.constraint.ZPP_Constraint
  24461. };
  24462. c.constraint.ZPP_AngleJoint = function () {
  24463. this.stepped = !1;
  24464. this.kMass = this.jAcc = this.jMax = this.gamma = this.bias = 0;
  24465. this.b1 = this.b2 =
  24466. null;
  24467. this.scale = 0;
  24468. this.slack = this.equal = !1;
  24469. this.ratio = this.jointMin = this.jointMax = 0;
  24470. this.outer_zn = null;
  24471. c.constraint.ZPP_Constraint.call(this);
  24472. this.ratio = 1;
  24473. this.jAcc = 0;
  24474. this.slack = !1;
  24475. this.jMax = Math.POSITIVE_INFINITY;
  24476. this.stepped = !1
  24477. };
  24478. s["zpp_nape.constraint.ZPP_AngleJoint"] = c.constraint.ZPP_AngleJoint;
  24479. c.constraint.ZPP_AngleJoint.__name__ = ["zpp_nape", "constraint", "ZPP_AngleJoint"];
  24480. c.constraint.ZPP_AngleJoint.__super__ = c.constraint.ZPP_Constraint;
  24481. c.constraint.ZPP_AngleJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  24482. draw: function (a) {
  24483. var b = this.outer_zn,
  24484. d = 5 / Math.PI / 2;
  24485. if ((null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer) != (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_space().zpp_inner.__static) {
  24486. var g = b.zpp_inner_zn.ratio * (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - this.jointMin,
  24487. e = b.zpp_inner_zn.ratio * (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - this.jointMax;
  24488. if (g > e) var f = g,
  24489. g = e,
  24490. e = f;
  24491. (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot >
  24492. g ? (f = function (a) {
  24493. a = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot;
  24494. var d = e;
  24495. return a < d ? a : d
  24496. }(this), c.constraint.ZPP_AngleDraw.drawSpiral(a, (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_position(), g, f, 10 + (g - g) * d, 10 + (f - g) * d, 16776960)) : !this.stiff && (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot < g && c.constraint.ZPP_AngleDraw.drawSpiralSpring(a, (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_position(), (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot,
  24497. g, 10 + ((null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot - g) * d, 10 + (g - g) * d, 16776960);
  24498. (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot < e ? (f = function (a) {
  24499. a = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot;
  24500. var d = g;
  24501. return a > d ? a : d
  24502. }(this), c.constraint.ZPP_AngleDraw.drawSpiral(a, (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_position(), f, e, 10 + (f - g) * d, 10 + (e - g) * d, 65535)) : !this.stiff && (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot >
  24503. e && c.constraint.ZPP_AngleDraw.drawSpiralSpring(a, (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_position(), (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot, e, 10 + ((null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot - g) * d, 10 + (e - g) * d, 65535);
  24504. c.constraint.ZPP_AngleDraw.indicator(a, (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_position(), (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot, 10 + ((null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot -
  24505. g) * d, 255)
  24506. }(null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer) != (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_space().zpp_inner.__static && (g = (this.jointMin + (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot) / b.zpp_inner_zn.ratio, e = (this.jointMax + (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot) / b.zpp_inner_zn.ratio, g > e && (f = g, g = e, e = f), (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot > g ? (f = function (a) {
  24507. a = (null == b.zpp_inner_zn.b2 ?
  24508. null : b.zpp_inner_zn.b2.outer).zpp_inner.rot;
  24509. var d = e;
  24510. return a < d ? a : d
  24511. }(this), c.constraint.ZPP_AngleDraw.drawSpiral(a, (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_position(), g, f, 10 + (g - g) * d, 10 + (f - g) * d, 16776960)) : !this.stiff && (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot < g && c.constraint.ZPP_AngleDraw.drawSpiralSpring(a, (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_position(), (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot, g, 10 + ((null ==
  24512. b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - g) * d, 10 + (g - g) * d, 16776960), (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot < e ? (f = function (a) {
  24513. a = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot;
  24514. var d = g;
  24515. return a > d ? a : d
  24516. }(this), c.constraint.ZPP_AngleDraw.drawSpiral(a, (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_position(), f, e, 10 + (f - g) * d, 10 + (e - g) * d, 65535)) : !this.stiff && (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot >
  24517. e && c.constraint.ZPP_AngleDraw.drawSpiralSpring(a, (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_position(), (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot, e, 10 + ((null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - g) * d, 10 + (e - g) * d, 65535), c.constraint.ZPP_AngleDraw.indicator(a, (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_position(), (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot, 10 + ((null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot -
  24518. g) * d, 16711680))
  24519. },
  24520. applyImpulsePos: function () {
  24521. var a, b;
  24522. a = this.ratio * this.b2.rot - this.b1.rot;
  24523. this.equal ? (a -= this.jointMax, b = !1, this.scale = 1) : a < this.jointMin ? (a = this.jointMin - a, this.scale = -1, b = !1) : a > this.jointMax ? (a -= this.jointMax, this.scale = 1, b = !1) : (a = this.scale = 0, b = !0);
  24524. if (!b) {
  24525. if (this.breakUnderError && a * a > this.maxError * this.maxError) return !0;
  24526. b = -(0.5 * a) * this.kMass;
  24527. if (this.equal || 0 > b) this.b1.delta_rot(-this.scale * b * this.b1.iinertia), this.b2.delta_rot(this.ratio * this.scale * b * this.b2.iinertia)
  24528. }
  24529. return !1
  24530. },
  24531. applyImpulseVel: function () {
  24532. if (this.slack) return !1;
  24533. var a = this.kMass * (this.bias - this.scale * (this.ratio * (this.b2.angvel + this.b2.kinangvel) - this.b1.angvel - this.b1.kinangvel)) - this.jAcc * this.gamma,
  24534. b = this.jAcc;
  24535. this.jAcc += a;
  24536. !this.equal && 0 < this.jAcc && (this.jAcc = 0);
  24537. if (this.breakUnderForce && (this.jAcc > this.jMax || this.jAcc < -this.jMax)) return !0;
  24538. this.stiff || (this.jAcc > this.jMax ? this.jAcc = this.jMax : this.jAcc < -this.jMax && (this.jAcc = -this.jMax));
  24539. a = this.jAcc - b;
  24540. this.b1.angvel -= this.scale * this.b1.iinertia * a;
  24541. this.b2.angvel +=
  24542. this.ratio * this.scale * this.b2.iinertia * a;
  24543. return !1
  24544. },
  24545. warmStart: function () {
  24546. this.slack || (this.b1.angvel -= this.scale * this.b1.iinertia * this.jAcc, this.b2.angvel += this.ratio * this.scale * this.b2.iinertia * this.jAcc)
  24547. },
  24548. preStep: function (a) {
  24549. -1 == this.pre_dt && (this.pre_dt = a);
  24550. var b = a / this.pre_dt;
  24551. this.pre_dt = a;
  24552. this.stepped = !0;
  24553. this.equal = this.jointMin == this.jointMax;
  24554. var d = function (a) {
  24555. var b = a.ratio * a.b2.rot - a.b1.rot;
  24556. a.equal ? (b -= a.jointMax, a.slack = !1, a.scale = 1) : b < a.jointMin ? (b = a.jointMin - b, a.scale = -1, a.slack = !1) : b > a.jointMax ?
  24557. (b -= a.jointMax, a.scale = 1, a.slack = !1) : (b = a.scale = 0, a.slack = !0);
  24558. return b
  24559. }(this);
  24560. if (!this.slack) {
  24561. this.kMass = this.b1.sinertia + this.ratio * this.ratio * this.b2.sinertia;
  24562. 0 != this.kMass ? this.kMass = 1 / this.kMass : this.jAcc = 0;
  24563. if (this.stiff) this.gamma = this.bias = 0;
  24564. else {
  24565. if (this.breakUnderError && d * d > this.maxError * this.maxError) return !0;
  24566. var c;
  24567. this.kMass *= function (b) {
  24568. var d = 2 * Math.PI * b.frequency;
  24569. b.gamma = 1 / (a * d * (2 * b.damping + d * a));
  24570. var l = 1 / (1 + b.gamma);
  24571. c = a * d * d * b.gamma;
  24572. b.gamma *= l;
  24573. return l
  24574. }(this);
  24575. this.bias = -d * c;
  24576. this.bias < -this.maxError ?
  24577. this.bias = -this.maxError : this.bias > this.maxError && (this.bias = this.maxError)
  24578. }
  24579. this.jAcc *= b;
  24580. this.jMax = this.maxForce * a
  24581. }
  24582. return !1
  24583. },
  24584. clearcache: function () {
  24585. this.jAcc = 0;
  24586. this.pre_dt = -1;
  24587. this.slack = !1
  24588. },
  24589. pair_exists: function (a, b) {
  24590. return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
  24591. },
  24592. forest: function () {
  24593. if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  24594. var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
  24595. a = a.b1.component;
  24596. for (var b = null; a != a.parent;) {
  24597. var c = a.parent;
  24598. a.parent =
  24599. b;
  24600. b = a;
  24601. a = c
  24602. }
  24603. for (; null != b;) c = b.parent, b.parent = a, b = c;
  24604. return a
  24605. }(this),
  24606. b = this.component == this.component.parent ? this.component : function (a) {
  24607. a = a.component;
  24608. for (var b = null; a != a.parent;) {
  24609. var c = a.parent;
  24610. a.parent = b;
  24611. b = a;
  24612. a = c
  24613. }
  24614. for (; null != b;) c = b.parent, b.parent = a, b = c;
  24615. return a
  24616. }(this);
  24617. a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
  24618. }
  24619. this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
  24620. a = a.b2.component;
  24621. for (var b =
  24622. null; a != a.parent;) {
  24623. var c = a.parent;
  24624. a.parent = b;
  24625. b = a;
  24626. a = c
  24627. }
  24628. for (; null != b;) c = b.parent, b.parent = a, b = c;
  24629. return a
  24630. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  24631. a = a.component;
  24632. for (var b = null; a != a.parent;) {
  24633. var c = a.parent;
  24634. a.parent = b;
  24635. b = a;
  24636. a = c
  24637. }
  24638. for (; null != b;) c = b.parent, b.parent = a, b = c;
  24639. return a
  24640. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
  24641. },
  24642. wake_connected: function () {
  24643. null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
  24644. null !=
  24645. this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
  24646. },
  24647. validate: function () {
  24648. if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
  24649. if (this.b1 == this.b2) throw "Error: AngleJoint cannot be simulated with body1 == body2";
  24650. if (this.b1.space != this.space || this.b2.space != this.space) throw "Error: Constraints must have each body within the same space to which the constraint has been assigned";
  24651. if (this.jointMin > this.jointMax) throw "Error: AngleJoint must have jointMin <= jointMax";
  24652. if (this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Constraints cannot have both bodies non-dynamic";
  24653. },
  24654. copy: function (a, b) {
  24655. var d = new h.constraint.AngleJoint(null, null, this.jointMin, this.jointMax, this.ratio);
  24656. this.copyto(d);
  24657. if (null != a && null != this.b1) {
  24658. for (var g = null, e = 0; e < a.length;) {
  24659. var f = a[e];
  24660. ++e;
  24661. if (f.id == this.b1.id) {
  24662. g = f.bc;
  24663. break
  24664. }
  24665. }
  24666. null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
  24667. d.zpp_inner_zn.b1 =
  24668. a.zpp_inner
  24669. }))
  24670. }
  24671. if (null != a && null != this.b2) {
  24672. g = null;
  24673. for (e = 0; e < a.length;)
  24674. if (f = a[e], ++e, f.id == this.b2.id) {
  24675. g = f.bc;
  24676. break
  24677. }
  24678. null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
  24679. d.zpp_inner_zn.b2 = a.zpp_inner
  24680. }))
  24681. }
  24682. return d
  24683. },
  24684. inactiveBodies: function () {
  24685. null != this.b1 && this.b1.constraints.remove(this);
  24686. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
  24687. },
  24688. activeBodies: function () {
  24689. null != this.b1 && this.b1.constraints.add(this);
  24690. this.b2 != this.b1 && null != this.b2 &&
  24691. this.b2.constraints.add(this)
  24692. },
  24693. bodyImpulse: function (a) {
  24694. return this.stepped ? a == this.b1 ? h.geom.Vec3.get(0, 0, -this.scale * this.jAcc) : h.geom.Vec3.get(0, 0, this.ratio * this.scale * this.jAcc) : h.geom.Vec3.get(0, 0, 0)
  24695. },
  24696. is_slack: function () {
  24697. var a, b = this.ratio * this.b2.rot - this.b1.rot;
  24698. this.equal ? (b -= this.jointMax, a = !1, this.scale = 1) : b < this.jointMin ? (b = this.jointMin - b, this.scale = -1, a = !1) : b > this.jointMax ? (b -= this.jointMax, this.scale = 1, a = !1) : (b = this.scale = 0, a = !0);
  24699. b;
  24700. return a
  24701. },
  24702. __class__: c.constraint.ZPP_AngleJoint
  24703. });
  24704. c.constraint.ZPP_AngleDraw =
  24705. function () {};
  24706. s["zpp_nape.constraint.ZPP_AngleDraw"] = c.constraint.ZPP_AngleDraw;
  24707. c.constraint.ZPP_AngleDraw.__name__ = ["zpp_nape", "constraint", "ZPP_AngleDraw"];
  24708. c.constraint.ZPP_AngleDraw.indicator = function (a, b, d, c, e) {
  24709. d = h.geom.Vec2.get(Math.cos(d), Math.sin(d), null);
  24710. a.drawFilledCircle(b.add(d.mul(c, !0), !0), 2, e);
  24711. d.dispose()
  24712. };
  24713. c.constraint.ZPP_AngleDraw.drawSpiralSpring = function (a, b, d, g, e, f, l, m) {
  24714. null == m && (m = 4);
  24715. if (d > g) {
  24716. var u = d;
  24717. d = g;
  24718. g = u;
  24719. u = e;
  24720. e = f;
  24721. f = u
  24722. }
  24723. if (d != g) {
  24724. var p = f - e,
  24725. k = g - d;
  24726. g = function (a) {
  24727. a = 2 * Math.PI * p / k;
  24728. return 0 >
  24729. a ? -a : a
  24730. }(this);
  24731. f = function (a) {
  24732. a = Math.ceil(3 * (k / c.constraint.ZPP_AngleDraw.maxarc));
  24733. var b = 4 * m;
  24734. return a > b ? a : b
  24735. }(this);
  24736. for (var r = k / f, n = 1 / f, w = Math.cos(d), t = Math.sin(d), q = e + 0 * p + 0.75 * g * Math.sin(0 * m * Math.PI), s = h.geom.Vec2.get(function (a) {
  24737. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24738. b.zpp_inner.validate();
  24739. return b.zpp_inner.x
  24740. }(this) + q * w, function (a) {
  24741. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24742. b.zpp_inner.validate();
  24743. return b.zpp_inner.y
  24744. }(this) +
  24745. q * t, null), y = p + 1.5 * m * g * Math.PI * Math.cos(0 * m * Math.PI), z = y * w - q * k * t, w = y * t + q * k * w, q = h.geom.Vec2.get(null, null, null), y = h.geom.Vec2.get(null, null, null), x = 0; x < f;) {
  24746. var B = x++;
  24747. d += r;
  24748. var v = Math.cos(d),
  24749. t = Math.sin(d),
  24750. H = e + p * (B + 1) * n + 0.75 * g * Math.sin(2 * m * Math.PI * (B + 1) * n);
  24751. q.setxy(function (a) {
  24752. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24753. b.zpp_inner.validate();
  24754. return b.zpp_inner.x
  24755. }(this) + H * v, function (a) {
  24756. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24757. b.zpp_inner.validate();
  24758. return b.zpp_inner.y
  24759. }(this) + H * t);
  24760. u = p + 1.5 * m * g * Math.PI * Math.cos(2 * m * Math.PI * (B + 1) * n);
  24761. B = u * v - H * k * t;
  24762. H = u * t + H * k * v;
  24763. u = z * H - w * B;
  24764. if (u * u < h.Config.epsilon || 0 >= z * B + w * H || 0.999 < z * B + w * H) a.drawLine(s, q, l);
  24765. else {
  24766. var A;
  24767. if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24768. q.zpp_inner.validate();
  24769. A = q.zpp_inner.x;
  24770. if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24771. s.zpp_inner.validate();
  24772. A = (A - s.zpp_inner.x) * H;
  24773. if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24774. s.zpp_inner.validate();
  24775. var D = s.zpp_inner.y;
  24776. if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24777. q.zpp_inner.validate();
  24778. u = (A + (D - q.zpp_inner.y) * B) / u;
  24779. 0 >= u ? a.drawLine(s, q, l) : (y.set_x(function (a) {
  24780. if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24781. s.zpp_inner.validate();
  24782. return s.zpp_inner.x
  24783. }(this) + z * u), y.set_y(function (a) {
  24784. if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24785. s.zpp_inner.validate();
  24786. return s.zpp_inner.y
  24787. }(this) +
  24788. w * u), a.drawCurve(s, y, q, l))
  24789. }
  24790. w = v;
  24791. z = B;
  24792. w = H;
  24793. s.set(q)
  24794. }
  24795. s.dispose();
  24796. q.dispose();
  24797. y.dispose()
  24798. }
  24799. };
  24800. c.constraint.ZPP_AngleDraw.drawSpiral = function (a, b, d, g, e, f, l) {
  24801. if (d > g) {
  24802. var m = d;
  24803. d = g;
  24804. g = m;
  24805. m = e;
  24806. e = f;
  24807. f = m
  24808. }
  24809. if (d != g) {
  24810. f -= e;
  24811. g -= d;
  24812. for (var u = Math.ceil(g / c.constraint.ZPP_AngleDraw.maxarc), p = f / u, k = g / u, r = Math.cos(d), n = Math.sin(d), w = h.geom.Vec2.get(function (a) {
  24813. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24814. b.zpp_inner.validate();
  24815. return b.zpp_inner.x
  24816. }(this) + e * r, function (a) {
  24817. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24818. b.zpp_inner.validate();
  24819. return b.zpp_inner.y
  24820. }(this) + e * n, null), t = f * r - e * g * n, r = f * n + e * g * r, q = h.geom.Vec2.get(null, null, null), s = h.geom.Vec2.get(null, null, null), y = 0; y < u;) {
  24821. y++;
  24822. e += p;
  24823. d += k;
  24824. var z = Math.cos(d),
  24825. n = Math.sin(d);
  24826. q.setxy(function (a) {
  24827. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24828. b.zpp_inner.validate();
  24829. return b.zpp_inner.x
  24830. }(this) + e * z, function (a) {
  24831. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24832. b.zpp_inner.validate();
  24833. return b.zpp_inner.y
  24834. }(this) +
  24835. e * n);
  24836. var x = f * z - e * g * n,
  24837. B = f * n + e * g * z,
  24838. m = t * B - r * x;
  24839. if (m * m < h.Config.epsilon) a.drawLine(w, q, l);
  24840. else {
  24841. if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24842. q.zpp_inner.validate();
  24843. var v = q.zpp_inner.x;
  24844. if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24845. w.zpp_inner.validate();
  24846. var v = (v - w.zpp_inner.x) * B,
  24847. H;
  24848. if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24849. w.zpp_inner.validate();
  24850. H = w.zpp_inner.y;
  24851. if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24852. q.zpp_inner.validate();
  24853. m = (v + (H - q.zpp_inner.y) * x) / m;
  24854. 0 >= m ? a.drawLine(w, q, l) : (s.set_x(function (a) {
  24855. if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24856. w.zpp_inner.validate();
  24857. return w.zpp_inner.x
  24858. }(this) + t * m), s.set_y(function (a) {
  24859. if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24860. w.zpp_inner.validate();
  24861. return w.zpp_inner.y
  24862. }(this) + r * m), a.drawCurve(w, s, q, l))
  24863. }
  24864. r = z;
  24865. t = x;
  24866. r = B;
  24867. w.set(q)
  24868. }
  24869. w.dispose();
  24870. q.dispose();
  24871. s.dispose()
  24872. }
  24873. };
  24874. c.constraint.ZPP_CopyHelper = function () {
  24875. this.bc =
  24876. this.cb = null;
  24877. this.id = 0
  24878. };
  24879. s["zpp_nape.constraint.ZPP_CopyHelper"] = c.constraint.ZPP_CopyHelper;
  24880. c.constraint.ZPP_CopyHelper.__name__ = ["zpp_nape", "constraint", "ZPP_CopyHelper"];
  24881. c.constraint.ZPP_CopyHelper.dict = function (a, b) {
  24882. var d = new c.constraint.ZPP_CopyHelper;
  24883. d.id = a;
  24884. d.bc = b;
  24885. return d
  24886. };
  24887. c.constraint.ZPP_CopyHelper.todo = function (a, b) {
  24888. var d = new c.constraint.ZPP_CopyHelper;
  24889. d.id = a;
  24890. d.cb = b;
  24891. return d
  24892. };
  24893. c.constraint.ZPP_CopyHelper.prototype = {
  24894. __class__: c.constraint.ZPP_CopyHelper
  24895. };
  24896. c.constraint.ZPP_DistanceJoint = function () {
  24897. this.stepped = !1;
  24898. this.kMass = this.jAcc = this.jMax = this.gamma = this.bias = 0;
  24899. this.wrap_a2 = null;
  24900. this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
  24901. this.wrap_a1 = this.b2 = null;
  24902. this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
  24903. this.b1 = null;
  24904. this.nx = this.ny = this.cx1 = this.cx2 = 0;
  24905. this.slack = this.equal = !1;
  24906. this.jointMin = this.jointMax = 0;
  24907. this.outer_zn = null;
  24908. c.constraint.ZPP_Constraint.call(this);
  24909. this.jAcc = this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx = 0;
  24910. this.jMax = Math.POSITIVE_INFINITY;
  24911. this.stepped = !1;
  24912. this.cx1 = this.cx2 = 0
  24913. };
  24914. s["zpp_nape.constraint.ZPP_DistanceJoint"] = c.constraint.ZPP_DistanceJoint;
  24915. c.constraint.ZPP_DistanceJoint.__name__ = ["zpp_nape", "constraint", "ZPP_DistanceJoint"];
  24916. c.constraint.ZPP_DistanceJoint.__super__ = c.constraint.ZPP_Constraint;
  24917. c.constraint.ZPP_DistanceJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  24918. draw: function (a) {
  24919. var b = this.outer_zn,
  24920. d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
  24921. null == b.zpp_inner_zn.wrap_a1 &&
  24922. b.zpp_inner_zn.setup_a1();
  24923. return b.zpp_inner_zn.wrap_a1
  24924. }(this)),
  24925. c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
  24926. null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
  24927. return b.zpp_inner_zn.wrap_a2
  24928. }(this)),
  24929. e = c.sub(d),
  24930. f = function (a) {
  24931. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24932. return Math.sqrt(function (a) {
  24933. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24934. e.zpp_inner.validate();
  24935. return e.zpp_inner.x
  24936. }(a) *
  24937. function (a) {
  24938. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24939. e.zpp_inner.validate();
  24940. return e.zpp_inner.x
  24941. }(a) + function (a) {
  24942. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24943. e.zpp_inner.validate();
  24944. return e.zpp_inner.y
  24945. }(a) * function (a) {
  24946. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  24947. e.zpp_inner.validate();
  24948. return e.zpp_inner.y
  24949. }(a))
  24950. }(this);
  24951. if (0 != f) {
  24952. e.muleq(1 / f);
  24953. var l = d.add(c).muleq(0.5),
  24954. m = l.sub(e.mul(0.5 * this.jointMin, !0)),
  24955. h = l.add(e.mul(0.5 * this.jointMin, !0)),
  24956. p = l.sub(e.mul(0.5 * this.jointMax, !0)),
  24957. k = l.add(e.mul(0.5 * this.jointMax, !0));
  24958. a.drawLine(m, h, 16776960);
  24959. a.drawLine(p, m, 65535);
  24960. a.drawLine(k, h, 65535);
  24961. this.stiff || (f > this.jointMax ? (a.drawSpring(p, d, 65535), a.drawSpring(k, c, 65535)) : f < this.jointMin && (a.drawSpring(m, d, 16776960), a.drawSpring(h, c, 16776960)));
  24962. l.dispose();
  24963. m.dispose();
  24964. h.dispose();
  24965. p.dispose();
  24966. k.dispose()
  24967. }
  24968. a.drawFilledCircle(d, 2, 255);
  24969. a.drawFilledCircle(c, 2, 16711680);
  24970. d.dispose();
  24971. c.dispose();
  24972. e.dispose()
  24973. },
  24974. applyImpulsePos: function () {
  24975. var a,
  24976. b, d = 0,
  24977. c = 0,
  24978. d = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
  24979. c = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
  24980. e = 0,
  24981. f = 0,
  24982. e = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
  24983. f = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
  24984. l, m = 0,
  24985. u = 0;
  24986. a = function (a) {
  24987. m = a.b2.posx + e - (a.b1.posx + d);
  24988. u = a.b2.posy + f - (a.b1.posy + c);
  24989. var b = m * m + u * u;
  24990. if (b < h.Config.epsilon) b = u = m = 0, l = !0;
  24991. else {
  24992. var b = Math.sqrt(b),
  24993. p = 1 / b;
  24994. m *= p;
  24995. u *= p;
  24996. a.equal ? (b -= a.jointMax, l = !1) : b < a.jointMin ? (b = a.jointMin - b, m = -m, u = -u, l = !1) : b > a.jointMax ?
  24997. (b -= a.jointMax, l = !1) : (b = u = m = 0, l = !0)
  24998. }
  24999. return b
  25000. }(this);
  25001. if (!l) {
  25002. if (this.breakUnderError && a * a > this.maxError * this.maxError) return !0;
  25003. if (a * a < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
  25004. a *= 0.5;
  25005. 6 < a * a && (b = this.b1.smass + this.b2.smass, b > h.Config.epsilon && (b = -a * (0.75 / b), this.equal || 0 > b)) && (a = b * this.b1.imass, this.b1.posx -= m * a, this.b1.posy -= u * a, a = b * this.b2.imass, this.b2.posx += m * a, this.b2.posy += u * a, a = function (a) {
  25006. m = a.b2.posx + e - (a.b1.posx + d);
  25007. u = a.b2.posy + f - (a.b1.posy + c);
  25008. var b = m * m + u * u;
  25009. if (b < h.Config.epsilon) b =
  25010. u = m = 0, l = !0;
  25011. else {
  25012. var b = Math.sqrt(b),
  25013. p = 1 / b;
  25014. m *= p;
  25015. u *= p;
  25016. a.equal ? (b -= a.jointMax, l = !1) : b < a.jointMin ? (b = a.jointMin - b, m = -m, u = -u, l = !1) : b > a.jointMax ? (b -= a.jointMax, l = !1) : (b = u = m = 0, l = !0)
  25017. }
  25018. return b
  25019. }(this), a *= 0.5);
  25020. var p, k;
  25021. p = u * d - m * c;
  25022. k = u * e - m * f;
  25023. b = this.b1.smass + this.b2.smass + p * p * this.b1.sinertia + k * k * this.b2.sinertia;
  25024. 0 != b && (b = 1 / b);
  25025. b *= -a;
  25026. if (this.equal || 0 > b) a = this.b1.imass * b, this.b1.posx -= m * a, this.b1.posy -= u * a, a = this.b2.imass * b, this.b2.posx += m * a, this.b2.posy += u * a, this.b1.delta_rot(-p * this.b1.iinertia * b), this.b2.delta_rot(k *
  25027. this.b2.iinertia * b)
  25028. }
  25029. return !1
  25030. },
  25031. applyImpulseVel: function () {
  25032. if (this.slack) return !1;
  25033. var a = this.kMass * (this.bias - (this.nx * (this.b2.velx + this.b2.kinvelx - this.b1.velx - this.b1.kinvelx) + this.ny * (this.b2.vely + this.b2.kinvely - this.b1.vely - this.b1.kinvely) + (this.b2.angvel + this.b2.kinangvel) * this.cx2 - (this.b1.angvel + this.b1.kinangvel) * this.cx1)) - this.jAcc * this.gamma,
  25034. b = this.jAcc;
  25035. this.jAcc += a;
  25036. !this.equal && 0 < this.jAcc && (this.jAcc = 0);
  25037. if (this.breakUnderForce && this.jAcc < -this.jMax) return !0;
  25038. !this.stiff && this.jAcc < -this.jMax &&
  25039. (this.jAcc = -this.jMax);
  25040. a = this.jAcc - b;
  25041. b = this.b1.imass * a;
  25042. this.b1.velx -= this.nx * b;
  25043. this.b1.vely -= this.ny * b;
  25044. b = this.b2.imass * a;
  25045. this.b2.velx += this.nx * b;
  25046. this.b2.vely += this.ny * b;
  25047. this.b1.angvel -= this.cx1 * this.b1.iinertia * a;
  25048. this.b2.angvel += this.cx2 * this.b2.iinertia * a;
  25049. return !1
  25050. },
  25051. warmStart: function () {
  25052. if (!this.slack) {
  25053. var a = this.b1.imass * this.jAcc;
  25054. this.b1.velx -= this.nx * a;
  25055. this.b1.vely -= this.ny * a;
  25056. a = this.b2.imass * this.jAcc;
  25057. this.b2.velx += this.nx * a;
  25058. this.b2.vely += this.ny * a;
  25059. this.b1.angvel -= this.cx1 * this.b1.iinertia * this.jAcc;
  25060. this.b2.angvel += this.cx2 * this.b2.iinertia * this.jAcc
  25061. }
  25062. },
  25063. preStep: function (a) {
  25064. -1 == this.pre_dt && (this.pre_dt = a);
  25065. var b = a / this.pre_dt;
  25066. this.pre_dt = a;
  25067. this.stepped = !0;
  25068. this.equal = this.jointMin == this.jointMax;
  25069. this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
  25070. this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
  25071. this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
  25072. this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
  25073. var d = function (a) {
  25074. a.nx = a.b2.posx +
  25075. a.a2relx - (a.b1.posx + a.a1relx);
  25076. a.ny = a.b2.posy + a.a2rely - (a.b1.posy + a.a1rely);
  25077. var b = a.nx * a.nx + a.ny * a.ny;
  25078. if (b < h.Config.epsilon) a.nx = 0, b = a.ny = 0, a.slack = !0;
  25079. else {
  25080. var b = Math.sqrt(b),
  25081. d = 1 / b;
  25082. a.nx *= d;
  25083. a.ny *= d;
  25084. a.equal ? (b -= a.jointMax, a.slack = !1) : b < a.jointMin ? (b = a.jointMin - b, a.nx = -a.nx, a.ny = -a.ny, a.slack = !1) : b > a.jointMax ? (b -= a.jointMax, a.slack = !1) : (a.nx = 0, b = a.ny = 0, a.slack = !0)
  25085. }
  25086. return b
  25087. }(this);
  25088. if (!this.slack) {
  25089. this.cx1 = this.ny * this.a1relx - this.nx * this.a1rely;
  25090. this.cx2 = this.ny * this.a2relx - this.nx * this.a2rely;
  25091. this.kMass =
  25092. this.b1.smass + this.b2.smass + this.cx1 * this.cx1 * this.b1.sinertia + this.cx2 * this.cx2 * this.b2.sinertia;
  25093. 0 != this.kMass ? this.kMass = 1 / this.kMass : this.jAcc = 0;
  25094. if (this.stiff) this.gamma = this.bias = 0;
  25095. else {
  25096. if (this.breakUnderError && d * d > this.maxError * this.maxError) return !0;
  25097. var c;
  25098. this.kMass *= function (b) {
  25099. var d = 2 * Math.PI * b.frequency;
  25100. b.gamma = 1 / (a * d * (2 * b.damping + d * a));
  25101. var l = 1 / (1 + b.gamma);
  25102. c = a * d * d * b.gamma;
  25103. b.gamma *= l;
  25104. return l
  25105. }(this);
  25106. this.bias = -d * c;
  25107. this.bias < -this.maxError ? this.bias = -this.maxError : this.bias > this.maxError &&
  25108. (this.bias = this.maxError)
  25109. }
  25110. this.jAcc *= b;
  25111. this.jMax = this.maxForce * a
  25112. }
  25113. return !1
  25114. },
  25115. clearcache: function () {
  25116. this.jAcc = 0;
  25117. this.pre_dt = -1
  25118. },
  25119. pair_exists: function (a, b) {
  25120. return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
  25121. },
  25122. forest: function () {
  25123. if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  25124. var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
  25125. a = a.b1.component;
  25126. for (var b = null; a != a.parent;) {
  25127. var c = a.parent;
  25128. a.parent = b;
  25129. b = a;
  25130. a = c
  25131. }
  25132. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25133. return a
  25134. }(this),
  25135. b = this.component == this.component.parent ? this.component : function (a) {
  25136. a = a.component;
  25137. for (var b = null; a != a.parent;) {
  25138. var c = a.parent;
  25139. a.parent = b;
  25140. b = a;
  25141. a = c
  25142. }
  25143. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25144. return a
  25145. }(this);
  25146. a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
  25147. }
  25148. this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
  25149. a = a.b2.component;
  25150. for (var b = null; a != a.parent;) {
  25151. var c = a.parent;
  25152. a.parent = b;
  25153. b = a;
  25154. a = c
  25155. }
  25156. for (; null != b;) c =
  25157. b.parent, b.parent = a, b = c;
  25158. return a
  25159. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  25160. a = a.component;
  25161. for (var b = null; a != a.parent;) {
  25162. var c = a.parent;
  25163. a.parent = b;
  25164. b = a;
  25165. a = c
  25166. }
  25167. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25168. return a
  25169. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
  25170. },
  25171. wake_connected: function () {
  25172. null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
  25173. null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
  25174. },
  25175. validate: function () {
  25176. if (null == this.b1 || null == this.b2) throw "Error: DistanceJoint cannot be simulated null bodies";
  25177. if (this.b1 == this.b2) throw "Error: DistanceJoint cannot be simulated with body1 == body2";
  25178. if (this.b1.space != this.space || this.b2.space != this.space) throw "Error: Constraints must have each body within the same space to which the constraint has been assigned";
  25179. if (this.jointMin > this.jointMax) throw "Error: DistanceJoint must have jointMin <= jointMax";
  25180. if (this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC &&
  25181. this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Constraints cannot have both bodies non-dynamic";
  25182. },
  25183. copy: function (a, b) {
  25184. var d = new h.constraint.DistanceJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2(), this.jointMin, this.jointMax);
  25185. this.copyto(d);
  25186. if (null != a && null != this.b1) {
  25187. for (var g = null, e = 0; e < a.length;) {
  25188. var f = a[e];
  25189. ++e;
  25190. if (f.id == this.b1.id) {
  25191. g = f.bc;
  25192. break
  25193. }
  25194. }
  25195. null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
  25196. d.zpp_inner_zn.b1 =
  25197. a.zpp_inner
  25198. }))
  25199. }
  25200. if (null != a && null != this.b2) {
  25201. g = null;
  25202. for (e = 0; e < a.length;)
  25203. if (f = a[e], ++e, f.id == this.b2.id) {
  25204. g = f.bc;
  25205. break
  25206. }
  25207. null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
  25208. d.zpp_inner_zn.b2 = a.zpp_inner
  25209. }))
  25210. }
  25211. return d
  25212. },
  25213. setup_a2: function () {
  25214. this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
  25215. this.wrap_a2.zpp_inner._inuse = !0;
  25216. this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
  25217. this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
  25218. },
  25219. invalidate_a2: function (a) {
  25220. this.immutable_midstep("Constraint::a2");
  25221. this.a2localx = a.x;
  25222. this.a2localy = a.y;
  25223. this.wake()
  25224. },
  25225. validate_a2: function () {
  25226. this.wrap_a2.zpp_inner.x = this.a2localx;
  25227. this.wrap_a2.zpp_inner.y = this.a2localy
  25228. },
  25229. setup_a1: function () {
  25230. this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
  25231. this.wrap_a1.zpp_inner._inuse = !0;
  25232. this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
  25233. this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
  25234. },
  25235. invalidate_a1: function (a) {
  25236. this.immutable_midstep("Constraint::a1");
  25237. this.a1localx = a.x;
  25238. this.a1localy = a.y;
  25239. this.wake()
  25240. },
  25241. validate_a1: function () {
  25242. this.wrap_a1.zpp_inner.x = this.a1localx;
  25243. this.wrap_a1.zpp_inner.y = this.a1localy
  25244. },
  25245. inactiveBodies: function () {
  25246. null != this.b1 && this.b1.constraints.remove(this);
  25247. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
  25248. },
  25249. activeBodies: function () {
  25250. null != this.b1 && this.b1.constraints.add(this);
  25251. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
  25252. },
  25253. bodyImpulse: function (a) {
  25254. return this.stepped ? a == this.b1 ? h.geom.Vec3.get(-this.jAcc * this.nx, -this.jAcc * this.ny, -this.cx1 * this.jAcc) :
  25255. h.geom.Vec3.get(this.jAcc * this.nx, this.jAcc * this.ny, this.cx2 * this.jAcc) : h.geom.Vec3.get(0, 0, 0)
  25256. },
  25257. is_slack: function () {
  25258. var a;
  25259. this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
  25260. this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
  25261. this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
  25262. this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
  25263. var b = a = 0;
  25264. a = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx);
  25265. b = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
  25266. b = a * a + b * b;
  25267. b < h.Config.epsilon ? (b = 0, a = !0) : (b = Math.sqrt(b), this.equal ? (b -= this.jointMax, a = !1) : b < this.jointMin ? (b = this.jointMin - b, a = !1) : b > this.jointMax ? (b -= this.jointMax, a = !1) : (b = 0, a = !0));
  25268. b;
  25269. return a
  25270. },
  25271. __class__: c.constraint.ZPP_DistanceJoint
  25272. });
  25273. c.constraint.ZPP_LineJoint = function () {
  25274. this.kMassa = this.kMassb = this.kMassc = this.jAccx = this.jAccy = this.biasx = this.biasy = 0;
  25275. this.wrap_n = null;
  25276. this.nlocalx = this.nlocaly = this.nrelx = this.nrely = 0;
  25277. this.wrap_a2 = null;
  25278. this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
  25279. this.wrap_a1 =
  25280. null;
  25281. this.dot1 = this.dot2 = this.cx1 = this.cx2 = this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
  25282. this.equal = !1;
  25283. this.scale = this.jointMin = this.jointMax = 0;
  25284. this.outer_zn = null;
  25285. c.constraint.ZPP_Constraint.call(this);
  25286. this.jAccy = this.jAccx = this.nrely = this.nrelx = this.nlocaly = this.nlocalx = this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx = 0;
  25287. this.jMax = Math.POSITIVE_INFINITY;
  25288. this.jointMin = Math.NEGATIVE_INFINITY;
  25289. this.jointMax = Math.POSITIVE_INFINITY;
  25290. this.stepped = !1
  25291. };
  25292. s["zpp_nape.constraint.ZPP_LineJoint"] = c.constraint.ZPP_LineJoint;
  25293. c.constraint.ZPP_LineJoint.__name__ = ["zpp_nape", "constraint", "ZPP_LineJoint"];
  25294. c.constraint.ZPP_LineJoint.__super__ = c.constraint.ZPP_Constraint;
  25295. c.constraint.ZPP_LineJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  25296. draw: function (a) {
  25297. var b = this.outer_zn,
  25298. d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
  25299. null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
  25300. return b.zpp_inner_zn.wrap_a1
  25301. }(this)),
  25302. c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
  25303. null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
  25304. return b.zpp_inner_zn.wrap_a2
  25305. }(this)),
  25306. e = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localVectorToWorld(function (a) {
  25307. null == b.zpp_inner_zn.wrap_n && b.zpp_inner_zn.setup_n();
  25308. return b.zpp_inner_zn.wrap_n
  25309. }(this));
  25310. e.muleq(1 / function (a) {
  25311. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25312. return Math.sqrt(function (a) {
  25313. if (null != e &&
  25314. e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25315. e.zpp_inner.validate();
  25316. return e.zpp_inner.x
  25317. }(a) * function (a) {
  25318. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25319. e.zpp_inner.validate();
  25320. return e.zpp_inner.x
  25321. }(a) + function (a) {
  25322. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25323. e.zpp_inner.validate();
  25324. return e.zpp_inner.y
  25325. }(a) * function (a) {
  25326. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25327. e.zpp_inner.validate();
  25328. return e.zpp_inner.y
  25329. }(a))
  25330. }(this));
  25331. var f = b.zpp_inner_zn.jointMin,
  25332. l = b.zpp_inner_zn.jointMax;
  25333. f <= Math.NEGATIVE_INFINITY && (f = -1E3);
  25334. l >= Math.POSITIVE_INFINITY && (l = 1E3);
  25335. var m = c.sub(d),
  25336. u = m.dot(e);
  25337. m.dispose();
  25338. var p = d.add(e.mul(f, !0)),
  25339. k = d.add(e.mul(l, !0));
  25340. u > f && a.drawLine(p, d.add(e.mul(function (a) {
  25341. a = l;
  25342. return u < a ? u : a
  25343. }(this), !0), !0), 16776960);
  25344. u < l && a.drawLine(d.add(e.mul(function (a) {
  25345. a = f;
  25346. return u > a ? u : a
  25347. }(this), !0), !0), k, 65535);
  25348. this.stiff || (m = u < this.jointMin ? function (a) {
  25349. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25350. return h.geom.Vec2.get(function (a) {
  25351. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25352. p.zpp_inner.validate();
  25353. return p.zpp_inner.x
  25354. }(a), function (a) {
  25355. if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25356. p.zpp_inner.validate();
  25357. return p.zpp_inner.y
  25358. }(a), !1)
  25359. }(this) : u > this.jointMax ? function (a) {
  25360. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25361. return h.geom.Vec2.get(function (a) {
  25362. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25363. k.zpp_inner.validate();
  25364. return k.zpp_inner.x
  25365. }(a), function (a) {
  25366. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25367. k.zpp_inner.validate();
  25368. return k.zpp_inner.y
  25369. }(a), !1)
  25370. }(this) : d.add(e.mul(u, !0)), a.drawSpring(m, c, 16711935), m.dispose());
  25371. a.drawFilledCircle(d, 2, 255);
  25372. a.drawFilledCircle(c, 2, 16711680);
  25373. d.dispose();
  25374. c.dispose();
  25375. p.dispose();
  25376. k.dispose()
  25377. },
  25378. applyImpulsePos: function () {
  25379. var a = 0,
  25380. b = 0,
  25381. a = this.b1.axisy * this.nlocalx - this.b1.axisx * this.nlocaly,
  25382. b = this.nlocalx * this.b1.axisx + this.nlocaly *
  25383. this.b1.axisy,
  25384. d = 0,
  25385. c = 0,
  25386. d = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
  25387. c = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
  25388. e = 0,
  25389. f = 0,
  25390. e = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
  25391. f = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
  25392. l = 0,
  25393. m = 0,
  25394. u, p = 0,
  25395. k = 0,
  25396. l = this.b2.posx + e - this.b1.posx - d,
  25397. m = this.b2.posy + f - this.b1.posy - c,
  25398. p = m * a - l * b,
  25399. k = a * l + b * m;
  25400. this.equal ? (k -= this.jointMin, u = 1) : k > this.jointMax ? (k -= this.jointMax, u = 1) : k < this.jointMin ? (k = this.jointMin - k, u = -1) : u = k = 0;
  25401. if (this.breakUnderError &&
  25402. p * p + k * k > this.maxError * this.maxError) return !0;
  25403. if (p * p + k * k < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
  25404. var r = 0,
  25405. n = 0,
  25406. w = 0.5,
  25407. p = p * w,
  25408. k = k * w;
  25409. 6 < p * p + k * k && (w = this.b1.smass + this.b2.smass, w > h.Config.epsilon && (w = 0.8 / w, k = w * (b * p - u * a * k), u = w * (a * p * u - b * p), w = this.b1.imass, this.b1.posx -= k * w, this.b1.posy -= u * w, w = this.b2.imass, this.b2.posx += k * w, this.b2.posy += u * w, l = this.b2.posx + e - this.b1.posx - d, m = this.b2.posy + f - this.b1.posy - c, k = a * l + b * m, this.equal ? (k -= this.jointMin, u = 1) : k > this.jointMax ? (k -= this.jointMax,
  25410. u = 1) : k < this.jointMin ? (k = this.jointMin - k, u = -1) : u = k = 0, w = 0.5, p = (m * a - l * b) * w, k *= w));
  25411. var t = 0,
  25412. q = 0,
  25413. r = w = w = 0,
  25414. w = l + d,
  25415. r = m + c,
  25416. d = a * w + b * r,
  25417. l = r * a - w * b,
  25418. c = a * e + b * f,
  25419. e = f * a - e * b,
  25420. t = this.b1.smass + this.b2.smass + d * d * this.b1.sinertia + c * c * this.b2.sinertia,
  25421. q = -u * (d * l * this.b1.sinertia + c * e * this.b2.sinertia),
  25422. w = u * u * (this.b1.smass + this.b2.smass + l * l * this.b1.sinertia + e * e * this.b2.sinertia),
  25423. r = -p,
  25424. n = -k,
  25425. f = t * w - q * q;
  25426. f != f ? r = n = 0 : 0 == f ? (r = 0 != t ? r / t : 0, n = 0 != w ? n / w : 0) : (f = 1 / f, w = f * (w * r - q * n), n = f * (t * n - q * r), r = w);
  25427. 0 < n && (n = 0);
  25428. f = u * a * n - b * r;
  25429. a = a * r + u * b * n;
  25430. w = this.b1.imass;
  25431. this.b1.posx -= f * w;
  25432. this.b1.posy -= a * w;
  25433. w = this.b2.imass;
  25434. this.b2.posx += f * w;
  25435. this.b2.posy += a * w;
  25436. this.b1.delta_rot((u * l * n - d * r) * this.b1.iinertia);
  25437. this.b2.delta_rot((c * r - u * e * n) * this.b2.iinertia);
  25438. return !1
  25439. },
  25440. applyImpulseVel: function () {
  25441. var a = 0,
  25442. b = 0,
  25443. d = 0,
  25444. c = 0,
  25445. d = this.b2.velx - this.b1.velx,
  25446. c = this.b2.vely - this.b1.vely,
  25447. d = d + (this.b2.kinvelx - this.b1.kinvelx),
  25448. c = c + (this.b2.kinvely - this.b1.kinvely),
  25449. a = c * this.nrelx - d * this.nrely + (this.b2.angvel + this.b2.kinangvel) * this.dot2 - (this.b1.angvel + this.b1.kinangvel) * this.dot1,
  25450. b = this.scale *
  25451. (this.nrelx * d + this.nrely * c - (this.b2.angvel + this.b2.kinangvel) * this.cx2 + (this.b1.angvel + this.b1.kinangvel) * this.cx1),
  25452. c = d = 0,
  25453. d = this.biasx - a,
  25454. c = this.biasy - b,
  25455. a = this.kMassa * d + this.kMassb * c,
  25456. c = this.kMassb * d + this.kMassc * c,
  25457. d = a,
  25458. a = this.gamma,
  25459. d = d - this.jAccx * a,
  25460. c = c - this.jAccy * a,
  25461. e = b = 0,
  25462. b = this.jAccx,
  25463. e = this.jAccy,
  25464. a = 1;
  25465. this.jAccx += d * a;
  25466. this.jAccy += c * a;
  25467. 0 < this.jAccy && (this.jAccy = 0);
  25468. if (this.breakUnderForce) {
  25469. if (this.jAccx * this.jAccx + this.jAccy * this.jAccy > this.jMax * this.jMax) return !0
  25470. } else this.stiff || (a = this.jMax, d = this.jAccx *
  25471. this.jAccx + this.jAccy * this.jAccy, d > a * a && (d = a * (1 / Math.sqrt(d)), this.jAccx *= d, this.jAccy *= d));
  25472. d = this.jAccx - b;
  25473. c = this.jAccy - e;
  25474. b = this.scale * this.nrelx * c - this.nrely * d;
  25475. e = this.nrelx * d + this.scale * this.nrely * c;
  25476. a = this.b1.imass;
  25477. this.b1.velx -= b * a;
  25478. this.b1.vely -= e * a;
  25479. a = this.b2.imass;
  25480. this.b2.velx += b * a;
  25481. this.b2.vely += e * a;
  25482. this.b1.angvel += (this.scale * this.cx1 * c - this.dot1 * d) * this.b1.iinertia;
  25483. this.b2.angvel += (this.dot2 * d - this.scale * this.cx2 * c) * this.b2.iinertia;
  25484. return !1
  25485. },
  25486. warmStart: function () {
  25487. var a = this.scale * this.nrelx *
  25488. this.jAccy - this.nrely * this.jAccx,
  25489. b = this.nrelx * this.jAccx + this.scale * this.nrely * this.jAccy,
  25490. d = this.b1.imass;
  25491. this.b1.velx -= a * d;
  25492. this.b1.vely -= b * d;
  25493. d = this.b2.imass;
  25494. this.b2.velx += a * d;
  25495. this.b2.vely += b * d;
  25496. this.b1.angvel += (this.scale * this.cx1 * this.jAccy - this.dot1 * this.jAccx) * this.b1.iinertia;
  25497. this.b2.angvel += (this.dot2 * this.jAccx - this.scale * this.cx2 * this.jAccy) * this.b2.iinertia
  25498. },
  25499. preStep: function (a) {
  25500. -1 == this.pre_dt && (this.pre_dt = a);
  25501. var b = a / this.pre_dt;
  25502. this.pre_dt = a;
  25503. this.equal = this.jointMin == this.jointMax;
  25504. this.stepped = !0;
  25505. this.validate_norm();
  25506. this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
  25507. this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
  25508. this.nrelx = this.b1.axisy * this.nlocalx - this.b1.axisx * this.nlocaly;
  25509. this.nrely = this.nlocalx * this.b1.axisx + this.nlocaly * this.b1.axisy;
  25510. this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
  25511. this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
  25512. var d = 0,
  25513. c = 0,
  25514. e = 0,
  25515. f = 0,
  25516. d = this.b2.posx + this.a2relx - this.b1.posx - this.a1relx,
  25517. c = this.b2.posy +
  25518. this.a2rely - this.b1.posy - this.a1rely,
  25519. e = c * this.nrelx - d * this.nrely,
  25520. f = this.nrelx * d + this.nrely * c;
  25521. this.equal ? (f -= this.jointMin, this.scale = 1) : f > this.jointMax ? (f -= this.jointMax, this.scale = 1) : f < this.jointMin ? (f = this.jointMin - f, this.scale = -1) : this.scale = f = 0;
  25522. var l = 0,
  25523. m = 0,
  25524. l = d + this.a1relx,
  25525. m = c + this.a1rely;
  25526. this.dot1 = this.nrelx * l + this.nrely * m;
  25527. this.cx1 = m * this.nrelx - l * this.nrely;
  25528. this.dot2 = this.nrelx * this.a2relx + this.nrely * this.a2rely;
  25529. this.cx2 = this.a2rely * this.nrelx - this.a2relx * this.nrely;
  25530. this.kMassa = this.b1.smass +
  25531. this.b2.smass + this.dot1 * this.dot1 * this.b1.sinertia + this.dot2 * this.dot2 * this.b2.sinertia;
  25532. this.kMassb = -this.scale * (this.dot1 * this.cx1 * this.b1.sinertia + this.dot2 * this.cx2 * this.b2.sinertia);
  25533. this.kMassc = this.scale * this.scale * (this.b1.smass + this.b2.smass + this.cx1 * this.cx1 * this.b1.sinertia + this.cx2 * this.cx2 * this.b2.sinertia);
  25534. d = function (a) {
  25535. var b = a.kMassa * a.kMassc - a.kMassb * a.kMassb;
  25536. b != b ? (a.kMassa = a.kMassb = a.kMassc = 0, a = 3) : a = 0 == b ? function (a) {
  25537. var b = 0;
  25538. 0 != a.kMassa ? a.kMassa = 1 / a.kMassa : (a.kMassa = 0, b |= 1);
  25539. 0 != a.kMassc ?
  25540. a.kMassc = 1 / a.kMassc : (a.kMassc = 0, b |= 2);
  25541. a.kMassb = 0;
  25542. return b
  25543. }(a) : function (a) {
  25544. b = 1 / b;
  25545. var d = a.kMassc * b;
  25546. a.kMassc = a.kMassa * b;
  25547. a.kMassa = d;
  25548. a.kMassb *= -b;
  25549. return 0
  25550. }(a);
  25551. return a
  25552. }(this);
  25553. 0 != (d & 1) && (this.jAccx = 0);
  25554. 0 != (d & 2) && (this.jAccy = 0);
  25555. if (this.stiff) this.biasy = this.biasx = this.gamma = 0;
  25556. else {
  25557. if (this.breakUnderError && e * e + f * f > this.maxError * this.maxError) return !0;
  25558. var h, d = function (b) {
  25559. var d = 2 * Math.PI * b.frequency;
  25560. b.gamma = 1 / (a * d * (2 * b.damping + d * a));
  25561. var c = 1 / (1 + b.gamma);
  25562. h = a * d * d * b.gamma;
  25563. b.gamma *= c;
  25564. return c
  25565. }(this);
  25566. this.kMassa *=
  25567. d;
  25568. this.kMassb *= d;
  25569. this.kMassc *= d;
  25570. this.biasx = e;
  25571. this.biasy = f;
  25572. e = -h;
  25573. this.biasx *= e;
  25574. this.biasy *= e;
  25575. e = this.maxError;
  25576. f = this.biasx * this.biasx + this.biasy * this.biasy;
  25577. f > e * e && (e *= 1 / Math.sqrt(f), this.biasx *= e, this.biasy *= e)
  25578. }
  25579. e = b;
  25580. this.jAccx *= e;
  25581. this.jAccy *= e;
  25582. this.jMax = this.maxForce * a;
  25583. return !1
  25584. },
  25585. clearcache: function () {
  25586. this.jAccy = this.jAccx = 0;
  25587. this.pre_dt = -1
  25588. },
  25589. pair_exists: function (a, b) {
  25590. return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
  25591. },
  25592. forest: function () {
  25593. if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  25594. var a =
  25595. this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
  25596. a = a.b1.component;
  25597. for (var b = null; a != a.parent;) {
  25598. var c = a.parent;
  25599. a.parent = b;
  25600. b = a;
  25601. a = c
  25602. }
  25603. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25604. return a
  25605. }(this),
  25606. b = this.component == this.component.parent ? this.component : function (a) {
  25607. a = a.component;
  25608. for (var b = null; a != a.parent;) {
  25609. var c = a.parent;
  25610. a.parent = b;
  25611. b = a;
  25612. a = c
  25613. }
  25614. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25615. return a
  25616. }(this);
  25617. a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
  25618. }
  25619. this.b2.type ==
  25620. c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
  25621. a = a.b2.component;
  25622. for (var b = null; a != a.parent;) {
  25623. var c = a.parent;
  25624. a.parent = b;
  25625. b = a;
  25626. a = c
  25627. }
  25628. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25629. return a
  25630. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  25631. a = a.component;
  25632. for (var b = null; a != a.parent;) {
  25633. var c = a.parent;
  25634. a.parent = b;
  25635. b = a;
  25636. a = c
  25637. }
  25638. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25639. return a
  25640. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent =
  25641. a : (b.parent = a, a.rank++)))
  25642. },
  25643. wake_connected: function () {
  25644. null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
  25645. null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
  25646. },
  25647. validate: function () {
  25648. if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
  25649. if (this.b1 == this.b2) throw "Error: DistanceJoint cannot be simulated with body1 == body2";
  25650. if (this.b1.space != this.space || this.b2.space != this.space) throw "Error: Constraints must have each body within the same space to which the constraint has been assigned";
  25651. if (this.jointMin > this.jointMax) throw "Error: DistanceJoint must have jointMin <= jointMax";
  25652. if (this.nlocalx * this.nlocalx + this.nlocaly * this.nlocaly < h.Config.epsilon) throw "Error: DistanceJoint direction must be non-degenerate";
  25653. if (this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Constraints cannot have both bodies non-dynamic";
  25654. },
  25655. copy: function (a, b) {
  25656. var d = new h.constraint.LineJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2(),
  25657. this.outer_zn.get_direction(), this.jointMin, this.jointMax);
  25658. this.copyto(d);
  25659. if (null != a && null != this.b1) {
  25660. for (var g = null, e = 0; e < a.length;) {
  25661. var f = a[e];
  25662. ++e;
  25663. if (f.id == this.b1.id) {
  25664. g = f.bc;
  25665. break
  25666. }
  25667. }
  25668. null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
  25669. d.zpp_inner_zn.b1 = a.zpp_inner
  25670. }))
  25671. }
  25672. if (null != a && null != this.b2) {
  25673. g = null;
  25674. for (e = 0; e < a.length;)
  25675. if (f = a[e], ++e, f.id == this.b2.id) {
  25676. g = f.bc;
  25677. break
  25678. }
  25679. null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id,
  25680. function (a) {
  25681. d.zpp_inner_zn.b2 = a.zpp_inner
  25682. }))
  25683. }
  25684. return d
  25685. },
  25686. validate_norm: function () {
  25687. if (this.zip_n) {
  25688. this.zip_n = !1;
  25689. var a = 1 / Math.sqrt(this.nlocalx * this.nlocalx + this.nlocaly * this.nlocaly);
  25690. this.nlocalx *= a;
  25691. this.nlocaly *= a
  25692. }
  25693. },
  25694. setup_n: function () {
  25695. this.wrap_n = h.geom.Vec2.get(this.nlocalx, this.nlocaly, null);
  25696. this.wrap_n.zpp_inner._inuse = !0;
  25697. this.wrap_n.zpp_inner._validate = A(this, this.validate_n);
  25698. this.wrap_n.zpp_inner._invalidate = A(this, this.invalidate_n)
  25699. },
  25700. invalidate_n: function (a) {
  25701. this.immutable_midstep("Constraint::n");
  25702. this.nlocalx = a.x;
  25703. this.nlocaly = a.y;
  25704. this.zip_n = !0;
  25705. this.wake()
  25706. },
  25707. validate_n: function () {
  25708. this.wrap_n.zpp_inner.x = this.nlocalx;
  25709. this.wrap_n.zpp_inner.y = this.nlocaly
  25710. },
  25711. setup_a2: function () {
  25712. this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
  25713. this.wrap_a2.zpp_inner._inuse = !0;
  25714. this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
  25715. this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
  25716. },
  25717. invalidate_a2: function (a) {
  25718. this.immutable_midstep("Constraint::a2");
  25719. this.a2localx = a.x;
  25720. this.a2localy = a.y;
  25721. this.wake()
  25722. },
  25723. validate_a2: function () {
  25724. this.wrap_a2.zpp_inner.x = this.a2localx;
  25725. this.wrap_a2.zpp_inner.y = this.a2localy
  25726. },
  25727. setup_a1: function () {
  25728. this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
  25729. this.wrap_a1.zpp_inner._inuse = !0;
  25730. this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
  25731. this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
  25732. },
  25733. invalidate_a1: function (a) {
  25734. this.immutable_midstep("Constraint::a1");
  25735. this.a1localx = a.x;
  25736. this.a1localy = a.y;
  25737. this.wake()
  25738. },
  25739. validate_a1: function () {
  25740. this.wrap_a1.zpp_inner.x =
  25741. this.a1localx;
  25742. this.wrap_a1.zpp_inner.y = this.a1localy
  25743. },
  25744. inactiveBodies: function () {
  25745. null != this.b1 && this.b1.constraints.remove(this);
  25746. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
  25747. },
  25748. activeBodies: function () {
  25749. null != this.b1 && this.b1.constraints.add(this);
  25750. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
  25751. },
  25752. bodyImpulse: function (a) {
  25753. if (this.stepped) {
  25754. var b = this.scale * this.nrelx * this.jAccy - this.nrely * this.jAccx,
  25755. d = this.nrelx * this.jAccx + this.scale * this.nrely * this.jAccy;
  25756. return a == this.b1 ?
  25757. h.geom.Vec3.get(-b, -d, this.scale * this.cx1 * d - this.dot1 * b) : h.geom.Vec3.get(b, d, this.scale * this.cx1 * d - this.dot1 * b)
  25758. }
  25759. return h.geom.Vec3.get(0, 0, 0)
  25760. },
  25761. __class__: c.constraint.ZPP_LineJoint
  25762. });
  25763. c.constraint.ZPP_MotorJoint = function () {
  25764. this.stepped = !1;
  25765. this.kMass = this.jAcc = this.jMax = 0;
  25766. this.b1 = this.b2 = null;
  25767. this.ratio = this.rate = 0;
  25768. this.outer_zn = null;
  25769. c.constraint.ZPP_Constraint.call(this);
  25770. this.jAcc = 0;
  25771. this.stepped = !1;
  25772. this.__velocity = !0
  25773. };
  25774. s["zpp_nape.constraint.ZPP_MotorJoint"] = c.constraint.ZPP_MotorJoint;
  25775. c.constraint.ZPP_MotorJoint.__name__ = ["zpp_nape", "constraint", "ZPP_MotorJoint"];
  25776. c.constraint.ZPP_MotorJoint.__super__ = c.constraint.ZPP_Constraint;
  25777. c.constraint.ZPP_MotorJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  25778. applyImpulsePos: function () {
  25779. return !1
  25780. },
  25781. applyImpulseVel: function () {
  25782. var a = -this.kMass * (this.ratio * (this.b2.angvel + this.b2.kinangvel) - this.b1.angvel - this.b1.kinangvel - this.rate),
  25783. b = this.jAcc;
  25784. this.jAcc += a;
  25785. if (this.breakUnderForce) {
  25786. if (this.jAcc > this.jMax || this.jAcc < -this.jMax) return !0
  25787. } else this.jAcc < -this.jMax ? this.jAcc = -this.jMax : this.jAcc > this.jMax && (this.jAcc = this.jMax);
  25788. a = this.jAcc - b;
  25789. this.b1.angvel -= this.b1.iinertia * a;
  25790. this.b2.angvel += this.ratio * this.b2.iinertia * a;
  25791. return !1
  25792. },
  25793. warmStart: function () {
  25794. this.b1.angvel -= this.b1.iinertia * this.jAcc;
  25795. this.b2.angvel += this.ratio * this.b2.iinertia * this.jAcc
  25796. },
  25797. preStep: function (a) {
  25798. -1 == this.pre_dt && (this.pre_dt = a);
  25799. var b = a / this.pre_dt;
  25800. this.pre_dt = a;
  25801. this.stepped = !0;
  25802. this.kMass = this.b1.sinertia + this.ratio * this.ratio * this.b2.sinertia;
  25803. this.kMass = 1 / this.kMass;
  25804. this.jAcc *= b;
  25805. this.jMax = this.maxForce *
  25806. a;
  25807. return !1
  25808. },
  25809. clearcache: function () {
  25810. this.jAcc = 0;
  25811. this.pre_dt = -1
  25812. },
  25813. pair_exists: function (a, b) {
  25814. return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
  25815. },
  25816. forest: function () {
  25817. if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  25818. var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
  25819. a = a.b1.component;
  25820. for (var b = null; a != a.parent;) {
  25821. var c = a.parent;
  25822. a.parent = b;
  25823. b = a;
  25824. a = c
  25825. }
  25826. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25827. return a
  25828. }(this),
  25829. b = this.component == this.component.parent ? this.component : function (a) {
  25830. a =
  25831. a.component;
  25832. for (var b = null; a != a.parent;) {
  25833. var c = a.parent;
  25834. a.parent = b;
  25835. b = a;
  25836. a = c
  25837. }
  25838. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25839. return a
  25840. }(this);
  25841. a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
  25842. }
  25843. this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
  25844. a = a.b2.component;
  25845. for (var b = null; a != a.parent;) {
  25846. var c = a.parent;
  25847. a.parent = b;
  25848. b = a;
  25849. a = c
  25850. }
  25851. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25852. return a
  25853. }(this), b = this.component == this.component.parent ?
  25854. this.component : function (a) {
  25855. a = a.component;
  25856. for (var b = null; a != a.parent;) {
  25857. var c = a.parent;
  25858. a.parent = b;
  25859. b = a;
  25860. a = c
  25861. }
  25862. for (; null != b;) c = b.parent, b.parent = a, b = c;
  25863. return a
  25864. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
  25865. },
  25866. wake_connected: function () {
  25867. null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
  25868. null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
  25869. },
  25870. validate: function () {
  25871. if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
  25872. if (this.b1 == this.b2) throw "Error: MotorJoint cannot be simulated with body1 == body2";
  25873. if (this.b1.space != this.space || this.b2.space != this.space) throw "Error: Constraints must have each body within the same space to which the constraint has been assigned";
  25874. if (this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Constraints cannot have both bodies non-dynamic";
  25875. },
  25876. copy: function (a, b) {
  25877. var d = new h.constraint.MotorJoint(null, null, this.rate, this.ratio);
  25878. this.copyto(d);
  25879. if (null != a && null != this.b1) {
  25880. for (var g = null, e = 0; e < a.length;) {
  25881. var f = a[e];
  25882. ++e;
  25883. if (f.id == this.b1.id) {
  25884. g = f.bc;
  25885. break
  25886. }
  25887. }
  25888. null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
  25889. d.zpp_inner_zn.b1 = a.zpp_inner
  25890. }))
  25891. }
  25892. if (null != a && null != this.b2) {
  25893. g = null;
  25894. for (e = 0; e < a.length;)
  25895. if (f = a[e], ++e, f.id == this.b2.id) {
  25896. g = f.bc;
  25897. break
  25898. }
  25899. null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
  25900. d.zpp_inner_zn.b2 = a.zpp_inner
  25901. }))
  25902. }
  25903. return d
  25904. },
  25905. inactiveBodies: function () {
  25906. null != this.b1 && this.b1.constraints.remove(this);
  25907. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
  25908. },
  25909. activeBodies: function () {
  25910. null != this.b1 && this.b1.constraints.add(this);
  25911. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
  25912. },
  25913. bodyImpulse: function (a) {
  25914. return this.stepped ? a == this.b1 ? h.geom.Vec3.get(0, 0, -this.jAcc) : h.geom.Vec3.get(0, 0, this.ratio * this.jAcc) : h.geom.Vec3.get(0, 0, 0)
  25915. },
  25916. __class__: c.constraint.ZPP_MotorJoint
  25917. });
  25918. c.constraint.ZPP_PivotJoint = function () {
  25919. this.stepped = !1;
  25920. this.kMassa = this.kMassb = this.kMassc = this.jAccx = this.jAccy = this.jMax = this.gamma = this.biasx = this.biasy = 0;
  25921. this.wrap_a2 = null;
  25922. this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
  25923. this.wrap_a1 = this.b2 = null;
  25924. this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
  25925. this.outer_zn = this.b1 = null;
  25926. c.constraint.ZPP_Constraint.call(this);
  25927. this.stepped = !1;
  25928. this.jAccy = this.jAccx = 0;
  25929. this.jMax = Math.POSITIVE_INFINITY;
  25930. this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx =
  25931. 0
  25932. };
  25933. s["zpp_nape.constraint.ZPP_PivotJoint"] = c.constraint.ZPP_PivotJoint;
  25934. c.constraint.ZPP_PivotJoint.__name__ = ["zpp_nape", "constraint", "ZPP_PivotJoint"];
  25935. c.constraint.ZPP_PivotJoint.__super__ = c.constraint.ZPP_Constraint;
  25936. c.constraint.ZPP_PivotJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  25937. draw: function (a) {
  25938. var b = this.outer_zn,
  25939. d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
  25940. null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
  25941. return b.zpp_inner_zn.wrap_a1
  25942. }(this)),
  25943. c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
  25944. null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
  25945. return b.zpp_inner_zn.wrap_a2
  25946. }(this));
  25947. if (!this.stiff) {
  25948. var e = c.sub(d);
  25949. 0 != function (a) {
  25950. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25951. return Math.sqrt(function (a) {
  25952. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25953. e.zpp_inner.validate();
  25954. return e.zpp_inner.x
  25955. }(a) * function (a) {
  25956. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25957. e.zpp_inner.validate();
  25958. return e.zpp_inner.x
  25959. }(a) + function (a) {
  25960. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25961. e.zpp_inner.validate();
  25962. return e.zpp_inner.y
  25963. }(a) * function (a) {
  25964. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  25965. e.zpp_inner.validate();
  25966. return e.zpp_inner.y
  25967. }(a))
  25968. }(this) && a.drawSpring(d, c, 16711935);
  25969. e.dispose()
  25970. }
  25971. a.drawFilledCircle(d, 2, 255);
  25972. a.drawFilledCircle(c, 2, 16711680);
  25973. d.dispose();
  25974. c.dispose()
  25975. },
  25976. applyImpulsePos: function () {
  25977. var a = 0,
  25978. b = 0,
  25979. a = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
  25980. b = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
  25981. d = 0,
  25982. c = 0,
  25983. d = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
  25984. c = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
  25985. e = 0,
  25986. f = 0,
  25987. e = this.b2.posx + d - (this.b1.posx + a),
  25988. f = this.b2.posy + c - (this.b1.posy + b);
  25989. if (this.breakUnderError && e * e + f * f > this.maxError * this.maxError) return !0;
  25990. if (e * e + f * f < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
  25991. var l = 0.5,
  25992. e = e * l,
  25993. f = f * l,
  25994. m = 0,
  25995. u = 0;
  25996. if (6 <
  25997. e * e + f * f) {
  25998. var p = this.b1.smass + this.b2.smass;
  25999. p > h.Config.epsilon && (p = 0.75 / p, m = -e * p, u = -f * p, l = 20, e = m * m + u * u, e > l * l && (e = l * (1 / Math.sqrt(e)), m *= e, u *= e), l = this.b1.imass, this.b1.posx -= m * l, this.b1.posy -= u * l, l = this.b2.imass, this.b2.posx += m * l, this.b2.posy += u * l, e = this.b2.posx + d - (this.b1.posx + a), f = this.b2.posy + c - (this.b1.posy + b), l = 0.5, e *= l, f *= l)
  26000. }
  26001. var k = p = 0,
  26002. r = 0,
  26003. p = r = this.b1.smass + this.b2.smass,
  26004. k = 0;
  26005. 0 != this.b1.sinertia && (m = a * this.b1.sinertia, u = b * this.b1.sinertia, p += u * b, k += -u * a, r += m * a);
  26006. 0 != this.b2.sinertia && (m = d * this.b2.sinertia,
  26007. u = c * this.b2.sinertia, p += u * c, k += -u * d, r += m * d);
  26008. m = -e;
  26009. u = -f;
  26010. l = 6;
  26011. e = m * m + u * u;
  26012. e > l * l && (e = l * (1 / Math.sqrt(e)), m *= e, u *= e);
  26013. e = p * r - k * k;
  26014. e != e ? m = u = 0 : 0 == e ? (m = 0 != p ? m / p : 0, u = 0 != r ? u / r : 0) : (e = 1 / e, l = e * (r * m - k * u), u = e * (p * u - k * m), m = l);
  26015. l = this.b1.imass;
  26016. this.b1.posx -= m * l;
  26017. this.b1.posy -= u * l;
  26018. l = this.b2.imass;
  26019. this.b2.posx += m * l;
  26020. this.b2.posy += u * l;
  26021. this.b1.delta_rot(-(u * a - m * b) * this.b1.iinertia);
  26022. this.b2.delta_rot((u * d - m * c) * this.b2.iinertia);
  26023. return !1
  26024. },
  26025. applyImpulseVel: function () {
  26026. var a = 0,
  26027. b = 0,
  26028. a = this.b2.velx + this.b2.kinvelx - this.a2rely * (this.b2.angvel +
  26029. this.b2.kinangvel) - (this.b1.velx + this.b1.kinvelx - this.a1rely * (this.b1.angvel + this.b1.kinangvel)),
  26030. b = this.b2.vely + this.b2.kinvely + this.a2relx * (this.b2.angvel + this.b2.kinangvel) - (this.b1.vely + this.b1.kinvely + this.a1relx * (this.b1.angvel + this.b1.kinangvel)),
  26031. d = 0,
  26032. c = 0,
  26033. d = this.biasx - a,
  26034. c = this.biasy - b,
  26035. e = this.kMassa * d + this.kMassb * c,
  26036. c = this.kMassb * d + this.kMassc * c,
  26037. d = e,
  26038. e = this.gamma,
  26039. d = d - this.jAccx * e,
  26040. c = c - this.jAccy * e,
  26041. b = a = 0,
  26042. a = this.jAccx,
  26043. b = this.jAccy,
  26044. e = 1;
  26045. this.jAccx += d * e;
  26046. this.jAccy += c * e;
  26047. if (this.breakUnderForce) {
  26048. if (this.jAccx *
  26049. this.jAccx + this.jAccy * this.jAccy > this.jMax * this.jMax) return !0
  26050. } else this.stiff || (e = this.jMax, d = this.jAccx * this.jAccx + this.jAccy * this.jAccy, d > e * e && (d = e * (1 / Math.sqrt(d)), this.jAccx *= d, this.jAccy *= d));
  26051. d = this.jAccx - a;
  26052. c = this.jAccy - b;
  26053. e = this.b1.imass;
  26054. this.b1.velx -= d * e;
  26055. this.b1.vely -= c * e;
  26056. e = this.b2.imass;
  26057. this.b2.velx += d * e;
  26058. this.b2.vely += c * e;
  26059. this.b1.angvel -= (c * this.a1relx - d * this.a1rely) * this.b1.iinertia;
  26060. this.b2.angvel += (c * this.a2relx - d * this.a2rely) * this.b2.iinertia;
  26061. return !1
  26062. },
  26063. warmStart: function () {
  26064. var a = this.b1.imass;
  26065. this.b1.velx -= this.jAccx * a;
  26066. this.b1.vely -= this.jAccy * a;
  26067. a = this.b2.imass;
  26068. this.b2.velx += this.jAccx * a;
  26069. this.b2.vely += this.jAccy * a;
  26070. this.b1.angvel -= (this.jAccy * this.a1relx - this.jAccx * this.a1rely) * this.b1.iinertia;
  26071. this.b2.angvel += (this.jAccy * this.a2relx - this.jAccx * this.a2rely) * this.b2.iinertia
  26072. },
  26073. preStep: function (a) {
  26074. -1 == this.pre_dt && (this.pre_dt = a);
  26075. var b = a / this.pre_dt;
  26076. this.pre_dt = a;
  26077. this.stepped = !0;
  26078. this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
  26079. this.a1rely = this.a1localx * this.b1.axisx + this.a1localy *
  26080. this.b1.axisy;
  26081. this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
  26082. this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
  26083. var d = this.b1.smass + this.b2.smass;
  26084. this.kMassa = d;
  26085. this.kMassb = 0;
  26086. this.kMassc = d;
  26087. if (0 != this.b1.sinertia) {
  26088. var d = this.a1relx * this.b1.sinertia,
  26089. c = this.a1rely * this.b1.sinertia;
  26090. this.kMassa += c * this.a1rely;
  26091. this.kMassb += -c * this.a1relx;
  26092. this.kMassc += d * this.a1relx
  26093. }
  26094. 0 != this.b2.sinertia && (d = this.a2relx * this.b2.sinertia, c = this.a2rely * this.b2.sinertia, this.kMassa += c * this.a2rely,
  26095. this.kMassb += -c * this.a2relx, this.kMassc += d * this.a2relx);
  26096. d = function (a) {
  26097. var b = a.kMassa * a.kMassc - a.kMassb * a.kMassb;
  26098. b != b ? (a.kMassa = a.kMassb = a.kMassc = 0, a = 3) : a = 0 == b ? function (a) {
  26099. var b = 0;
  26100. 0 != a.kMassa ? a.kMassa = 1 / a.kMassa : (a.kMassa = 0, b |= 1);
  26101. 0 != a.kMassc ? a.kMassc = 1 / a.kMassc : (a.kMassc = 0, b |= 2);
  26102. a.kMassb = 0;
  26103. return b
  26104. }(a) : function (a) {
  26105. b = 1 / b;
  26106. var d = a.kMassc * b;
  26107. a.kMassc = a.kMassa * b;
  26108. a.kMassa = d;
  26109. a.kMassb *= -b;
  26110. return 0
  26111. }(a);
  26112. return a
  26113. }(this);
  26114. 0 != (d & 1) && (this.jAccx = 0);
  26115. 0 != (d & 2) && (this.jAccy = 0);
  26116. if (this.stiff) this.gamma = this.biasy = this.biasx =
  26117. 0;
  26118. else {
  26119. var e, d = function (b) {
  26120. var d = 2 * Math.PI * b.frequency;
  26121. b.gamma = 1 / (a * d * (2 * b.damping + d * a));
  26122. var c = 1 / (1 + b.gamma);
  26123. e = a * d * d * b.gamma;
  26124. b.gamma *= c;
  26125. return c
  26126. }(this);
  26127. this.kMassa *= d;
  26128. this.kMassb *= d;
  26129. this.kMassc *= d;
  26130. this.biasx = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx);
  26131. this.biasy = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
  26132. if (this.breakUnderError && this.biasx * this.biasx + this.biasy * this.biasy > this.maxError * this.maxError) return !0;
  26133. d = -e;
  26134. this.biasx *= d;
  26135. this.biasy *= d;
  26136. d = this.maxError;
  26137. c = this.biasx * this.biasx +
  26138. this.biasy * this.biasy;
  26139. c > d * d && (d *= 1 / Math.sqrt(c), this.biasx *= d, this.biasy *= d)
  26140. }
  26141. d = b;
  26142. this.jAccx *= d;
  26143. this.jAccy *= d;
  26144. this.jMax = this.maxForce * a;
  26145. return !1
  26146. },
  26147. clearcache: function () {
  26148. this.jAccy = this.jAccx = 0;
  26149. this.pre_dt = -1
  26150. },
  26151. pair_exists: function (a, b) {
  26152. return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
  26153. },
  26154. forest: function () {
  26155. if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  26156. var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
  26157. a = a.b1.component;
  26158. for (var b = null; a != a.parent;) {
  26159. var c =
  26160. a.parent;
  26161. a.parent = b;
  26162. b = a;
  26163. a = c
  26164. }
  26165. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26166. return a
  26167. }(this),
  26168. b = this.component == this.component.parent ? this.component : function (a) {
  26169. a = a.component;
  26170. for (var b = null; a != a.parent;) {
  26171. var c = a.parent;
  26172. a.parent = b;
  26173. b = a;
  26174. a = c
  26175. }
  26176. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26177. return a
  26178. }(this);
  26179. a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
  26180. }
  26181. this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
  26182. a = a.b2.component;
  26183. for (var b = null; a != a.parent;) {
  26184. var c = a.parent;
  26185. a.parent = b;
  26186. b = a;
  26187. a = c
  26188. }
  26189. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26190. return a
  26191. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  26192. a = a.component;
  26193. for (var b = null; a != a.parent;) {
  26194. var c = a.parent;
  26195. a.parent = b;
  26196. b = a;
  26197. a = c
  26198. }
  26199. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26200. return a
  26201. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
  26202. },
  26203. wake_connected: function () {
  26204. null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
  26205. null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
  26206. },
  26207. validate: function () {
  26208. if (null == this.b1 || null == this.b2) throw "Error: PivotJoint cannot be simulated null bodies";
  26209. if (this.b1 == this.b2) throw "Error: PivotJoint cannot be simulated with body1 == body2 (body1=body2=" + this.b1.outer.toString() + ")";
  26210. if (this.b1.space != this.space || this.b2.space != this.space) throw "Error: Constraints must have each body within the same space to which the constraint has been assigned (body1=" + this.b1.outer.toString() +
  26211. ", body2=" + this.b2.outer.toString() + ")";
  26212. if (this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Constraints cannot have both bodies non-dynamic (body1=" + this.b1.outer.toString() + ", body2=" + this.b2.outer.toString() + ")";
  26213. },
  26214. copy: function (a, b) {
  26215. var d = new h.constraint.PivotJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2());
  26216. this.copyto(d);
  26217. if (null != a && null != this.b1) {
  26218. for (var g = null, e = 0; e < a.length;) {
  26219. var f = a[e];
  26220. ++e;
  26221. if (f.id ==
  26222. this.b1.id) {
  26223. g = f.bc;
  26224. break
  26225. }
  26226. }
  26227. null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
  26228. d.zpp_inner_zn.b1 = a.zpp_inner
  26229. }))
  26230. }
  26231. if (null != a && null != this.b2) {
  26232. g = null;
  26233. for (e = 0; e < a.length;)
  26234. if (f = a[e], ++e, f.id == this.b2.id) {
  26235. g = f.bc;
  26236. break
  26237. }
  26238. null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
  26239. d.zpp_inner_zn.b2 = a.zpp_inner
  26240. }))
  26241. }
  26242. return d
  26243. },
  26244. setup_a2: function () {
  26245. this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
  26246. this.wrap_a2.zpp_inner._inuse = !0;
  26247. this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
  26248. this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
  26249. },
  26250. invalidate_a2: function (a) {
  26251. this.immutable_midstep("Constraint::a2");
  26252. this.a2localx = a.x;
  26253. this.a2localy = a.y;
  26254. this.wake()
  26255. },
  26256. validate_a2: function () {
  26257. this.wrap_a2.zpp_inner.x = this.a2localx;
  26258. this.wrap_a2.zpp_inner.y = this.a2localy
  26259. },
  26260. setup_a1: function () {
  26261. this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
  26262. this.wrap_a1.zpp_inner._inuse = !0;
  26263. this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
  26264. this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
  26265. },
  26266. invalidate_a1: function (a) {
  26267. this.immutable_midstep("Constraint::a1");
  26268. this.a1localx = a.x;
  26269. this.a1localy = a.y;
  26270. this.wake()
  26271. },
  26272. validate_a1: function () {
  26273. this.wrap_a1.zpp_inner.x = this.a1localx;
  26274. this.wrap_a1.zpp_inner.y = this.a1localy
  26275. },
  26276. inactiveBodies: function () {
  26277. null != this.b1 && this.b1.constraints.remove(this);
  26278. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
  26279. },
  26280. activeBodies: function () {
  26281. null != this.b1 && this.b1.constraints.add(this);
  26282. this.b2 != this.b1 &&
  26283. null != this.b2 && this.b2.constraints.add(this)
  26284. },
  26285. bodyImpulse: function (a) {
  26286. return this.stepped ? a == this.b1 ? h.geom.Vec3.get(-this.jAccx, -this.jAccy, -(this.jAccy * this.a1relx - this.jAccx * this.a1rely)) : h.geom.Vec3.get(this.jAccx, this.jAccy, this.jAccy * this.a2relx - this.jAccx * this.a2rely) : h.geom.Vec3.get(0, 0, 0)
  26287. },
  26288. __class__: c.constraint.ZPP_PivotJoint
  26289. });
  26290. c.constraint.ZPP_PulleyJoint = function () {
  26291. this.stepped = !1;
  26292. this.kMass = this.jAcc = this.jMax = this.gamma = this.bias = 0;
  26293. this.wrap_a4 = null;
  26294. this.a4localx = this.a4localy = this.a4relx =
  26295. this.a4rely = 0;
  26296. this.wrap_a3 = this.b4 = null;
  26297. this.a3localx = this.a3localy = this.a3relx = this.a3rely = 0;
  26298. this.wrap_a2 = this.b3 = null;
  26299. this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
  26300. this.wrap_a1 = this.b2 = null;
  26301. this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
  26302. this.b1 = null;
  26303. this.n12x = this.n12y = this.n34x = this.n34y = this.cx1 = this.cx2 = this.cx3 = this.cx4 = 0;
  26304. this.slack = this.equal = !1;
  26305. this.jointMin = this.jointMax = 0;
  26306. this.ratio = 1;
  26307. this.outer_zn = null;
  26308. c.constraint.ZPP_Constraint.call(this);
  26309. this.a4rely = this.a4relx = this.a4localy =
  26310. this.a4localx = this.a3rely = this.a3relx = this.a3localy = this.a3localx = this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx = 0;
  26311. this.n12x = 1;
  26312. this.n12y = 0;
  26313. this.n34x = 1;
  26314. this.jAcc = this.n34y = 0;
  26315. this.jMax = Math.POSITIVE_INFINITY;
  26316. this.stepped = !1;
  26317. this.cx1 = this.cx2 = this.cx3 = this.cx4 = 0
  26318. };
  26319. s["zpp_nape.constraint.ZPP_PulleyJoint"] = c.constraint.ZPP_PulleyJoint;
  26320. c.constraint.ZPP_PulleyJoint.__name__ = ["zpp_nape", "constraint", "ZPP_PulleyJoint"];
  26321. c.constraint.ZPP_PulleyJoint.__super__ =
  26322. c.constraint.ZPP_Constraint;
  26323. c.constraint.ZPP_PulleyJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  26324. drawLink: function (a, b, d, c, e, f, l, m, h) {
  26325. if (0 != e) {
  26326. c.muleq(1 / e);
  26327. var p = b.add(d).muleq(0.5),
  26328. k = (this.jointMin - f) * l;
  26329. 0 > k && (k = 0);
  26330. f = (this.jointMax - f) * l;
  26331. 0 > f && (f = 0);
  26332. l = p.sub(c.mul(0.5 * k, !0));
  26333. var r = p.add(c.mul(0.5 * k, !0)),
  26334. n = p.sub(c.mul(0.5 * f, !0));
  26335. c = p.add(c.mul(0.5 * f, !0));
  26336. a.drawLine(l, r, m);
  26337. a.drawLine(n, l, h);
  26338. a.drawLine(c, r, h);
  26339. this.stiff || (e > f ? (a.drawSpring(n, b, h), a.drawSpring(c, d, h)) : e < k && (a.drawSpring(l, b, m),
  26340. a.drawSpring(r, d, m)));
  26341. p.dispose();
  26342. l.dispose();
  26343. r.dispose();
  26344. n.dispose();
  26345. c.dispose()
  26346. }
  26347. },
  26348. draw: function (a) {
  26349. var b = this.outer_zn,
  26350. d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
  26351. null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
  26352. return b.zpp_inner_zn.wrap_a1
  26353. }(this)),
  26354. c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
  26355. null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
  26356. return b.zpp_inner_zn.wrap_a2
  26357. }(this)),
  26358. e = (null == b.zpp_inner_zn.b3 ?
  26359. null : b.zpp_inner_zn.b3.outer).localPointToWorld(function (a) {
  26360. null == b.zpp_inner_zn.wrap_a3 && b.zpp_inner_zn.setup_a3();
  26361. return b.zpp_inner_zn.wrap_a3
  26362. }(this)),
  26363. f = (null == b.zpp_inner_zn.b4 ? null : b.zpp_inner_zn.b4.outer).localPointToWorld(function (a) {
  26364. null == b.zpp_inner_zn.wrap_a4 && b.zpp_inner_zn.setup_a4();
  26365. return b.zpp_inner_zn.wrap_a4
  26366. }(this)),
  26367. l = c.sub(d),
  26368. m = f.sub(e),
  26369. h = function (a) {
  26370. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26371. return Math.sqrt(function (a) {
  26372. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26373. l.zpp_inner.validate();
  26374. return l.zpp_inner.x
  26375. }(a) * function (a) {
  26376. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26377. l.zpp_inner.validate();
  26378. return l.zpp_inner.x
  26379. }(a) + function (a) {
  26380. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26381. l.zpp_inner.validate();
  26382. return l.zpp_inner.y
  26383. }(a) * function (a) {
  26384. if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26385. l.zpp_inner.validate();
  26386. return l.zpp_inner.y
  26387. }(a))
  26388. }(this),
  26389. p = function (a) {
  26390. if (null != m &&
  26391. m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26392. return Math.sqrt(function (a) {
  26393. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26394. m.zpp_inner.validate();
  26395. return m.zpp_inner.x
  26396. }(a) * function (a) {
  26397. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26398. m.zpp_inner.validate();
  26399. return m.zpp_inner.x
  26400. }(a) + function (a) {
  26401. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26402. m.zpp_inner.validate();
  26403. return m.zpp_inner.y
  26404. }(a) *
  26405. function (a) {
  26406. if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  26407. m.zpp_inner.validate();
  26408. return m.zpp_inner.y
  26409. }(a))
  26410. }(this);
  26411. this.drawLink(a, d, c, l, h, p * this.ratio, 1, 16776960, 65535);
  26412. this.drawLink(a, e, f, m, p, h, 1 / this.ratio, 65535, 16711935);
  26413. a.drawFilledCircle(d, 2, 255);
  26414. a.drawFilledCircle(c, 2, 16711680);
  26415. a.drawFilledCircle(e, 2, 65280);
  26416. a.drawFilledCircle(f, 2, 16711935);
  26417. d.dispose();
  26418. c.dispose();
  26419. e.dispose();
  26420. f.dispose();
  26421. l.dispose();
  26422. m.dispose()
  26423. },
  26424. applyImpulsePos: function () {
  26425. var a, b, d = 0,
  26426. c = 0,
  26427. d = this.b1.axisy *
  26428. this.a1localx - this.b1.axisx * this.a1localy,
  26429. c = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
  26430. e = 0,
  26431. f = 0,
  26432. e = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
  26433. f = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
  26434. l = 0,
  26435. m = 0,
  26436. l = this.b3.axisy * this.a3localx - this.b3.axisx * this.a3localy,
  26437. m = this.a3localx * this.b3.axisx + this.a3localy * this.b3.axisy,
  26438. u = 0,
  26439. p = 0,
  26440. u = this.b4.axisy * this.a4localx - this.b4.axisx * this.a4localy,
  26441. p = this.a4localx * this.b4.axisx + this.a4localy * this.b4.axisy,
  26442. k, r = 0,
  26443. n = 0,
  26444. w = 0,
  26445. t = 0,
  26446. r = this.n12x,
  26447. n = this.n12y,
  26448. w = this.n34x,
  26449. t = this.n34y;
  26450. a = function (a) {
  26451. var b = 0,
  26452. h = 0,
  26453. q = 0,
  26454. s = 0,
  26455. b = a.b2.posx + e - (a.b1.posx + d),
  26456. h = a.b2.posy + f - (a.b1.posy + c),
  26457. q = a.b4.posx + u - (a.b3.posx + l),
  26458. s = a.b4.posy + p - (a.b3.posy + m),
  26459. z = Math.sqrt(b * b + h * h),
  26460. V = Math.sqrt(q * q + s * s);
  26461. if (0 != z) {
  26462. var y = 1 / z;
  26463. r = b * y;
  26464. n = h * y
  26465. }
  26466. 0 != V ? (y = 1 / V, w = q * y, t = s * y, y = a.ratio) : y = a.ratio / Math.sqrt(w * w + t * t);
  26467. w *= y;
  26468. t *= y;
  26469. b = z + a.ratio * V;
  26470. a.equal ? (b -= a.jointMax, k = !1) : b < a.jointMin ? (b = a.jointMin - b, r = -r, n = -n, w = -w, t = -t, k = !1) : b > a.jointMax ? (b -= a.jointMax, k = !1) : (b = t = w = n = r = 0, k = !0);
  26471. return b
  26472. }(this);
  26473. if (!k) {
  26474. if (this.breakUnderError &&
  26475. a * a > this.maxError * this.maxError) return !0;
  26476. if (a * a < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
  26477. a *= 0.5;
  26478. 6 < a * a && (b = this.b1.smass + this.b2.smass, b > h.Config.epsilon && (b = -a * (0.75 / b), this.equal || 0 > b)) && (a = b * this.b1.imass, this.b1.posx -= r * a, this.b1.posy -= n * a, a = b * this.b2.imass, this.b2.posx += r * a, this.b2.posy += n * a, a = b * this.b3.imass, this.b3.posx -= w * a, this.b3.posy -= t * a, a = b * this.b4.imass, this.b4.posx += w * a, this.b4.posy += t * a, a = function (a) {
  26479. var b = 0,
  26480. h = 0,
  26481. q = 0,
  26482. s = 0,
  26483. b = a.b2.posx + e - (a.b1.posx + d),
  26484. h = a.b2.posy +
  26485. f - (a.b1.posy + c),
  26486. q = a.b4.posx + u - (a.b3.posx + l),
  26487. s = a.b4.posy + p - (a.b3.posy + m),
  26488. z = Math.sqrt(b * b + h * h),
  26489. V = Math.sqrt(q * q + s * s);
  26490. if (0 != z) {
  26491. var y = 1 / z;
  26492. r = b * y;
  26493. n = h * y
  26494. }
  26495. 0 != V ? (y = 1 / V, w = q * y, t = s * y, y = a.ratio) : y = a.ratio / Math.sqrt(w * w + t * t);
  26496. w *= y;
  26497. t *= y;
  26498. b = z + a.ratio * V;
  26499. a.equal ? (b -= a.jointMax, k = !1) : b < a.jointMin ? (b = a.jointMin - b, r = -r, n = -n, w = -w, t = -t, k = !1) : b > a.jointMax ? (b -= a.jointMax, k = !1) : (b = t = w = n = r = 0, k = !0);
  26500. return b
  26501. }(this), a *= 0.5);
  26502. var q, s, y, z;
  26503. b = function (a) {
  26504. q = n * d - r * c;
  26505. s = n * e - r * f;
  26506. y = t * l - w * m;
  26507. z = t * u - w * p;
  26508. var b = a.b1.smass + a.b2.smass + a.ratio * a.ratio *
  26509. (a.b3.smass + a.b4.smass) + a.b1.sinertia * q * q + a.b2.sinertia * s * s + a.b3.sinertia * y * y + a.b4.sinertia * z * z;
  26510. a.b1 == a.b4 && (b -= 2 * ((r * w + n * t) * a.b1.smass + q * z * a.b1.sinertia));
  26511. a.b1 == a.b3 && (b += 2 * ((r * w + n * t) * a.b1.smass + q * y * a.b1.sinertia));
  26512. a.b2 == a.b3 && (b -= 2 * ((r * w + n * t) * a.b2.smass + s * y * a.b2.sinertia));
  26513. a.b2 == a.b4 && (b += 2 * ((r * w + n * t) * a.b2.smass + s * z * a.b2.sinertia));
  26514. return b
  26515. }(this);
  26516. 0 != b && (b = 1 / b);
  26517. b *= -a;
  26518. if (this.equal || 0 > b) a = this.b1.imass * b, this.b1.posx -= r * a, this.b1.posy -= n * a, a = this.b2.imass * b, this.b2.posx += r * a, this.b2.posy += n * a, a =
  26519. this.b3.imass * b, this.b3.posx -= w * a, this.b3.posy -= t * a, a = this.b4.imass * b, this.b4.posx += w * a, this.b4.posy += t * a, this.b1.delta_rot(-q * this.b1.iinertia * b), this.b2.delta_rot(s * this.b2.iinertia * b), this.b3.delta_rot(-y * this.b3.iinertia * b), this.b4.delta_rot(z * this.b4.iinertia * b)
  26520. }
  26521. return !1
  26522. },
  26523. applyImpulseVel: function () {
  26524. if (this.slack) return !1;
  26525. var a = this.kMass * (this.bias - (this.n12x * (this.b2.velx + this.b2.kinvelx - this.b1.velx - this.b1.kinvelx) + this.n12y * (this.b2.vely + this.b2.kinvely - this.b1.vely - this.b1.kinvely) + this.n34x *
  26526. (this.b4.velx + this.b4.kinvelx - this.b3.velx - this.b3.kinvelx) + this.n34y * (this.b4.vely + this.b4.kinvely - this.b3.vely - this.b3.kinvely) + (this.b2.angvel + this.b2.kinangvel) * this.cx2 - (this.b1.angvel + this.b1.kinangvel) * this.cx1 + (this.b4.angvel + this.b4.kinangvel) * this.cx4 - (this.b3.angvel + this.b3.kinangvel) * this.cx3)) - this.jAcc * this.gamma,
  26527. b = this.jAcc;
  26528. this.jAcc += a;
  26529. !this.equal && 0 < this.jAcc && (this.jAcc = 0);
  26530. if (this.breakUnderForce && this.jAcc < -this.jMax) return !0;
  26531. !this.stiff && this.jAcc < -this.jMax && (this.jAcc = -this.jMax);
  26532. a = this.jAcc - b;
  26533. b = this.b1.imass * a;
  26534. this.b1.velx -= this.n12x * b;
  26535. this.b1.vely -= this.n12y * b;
  26536. b = this.b2.imass * a;
  26537. this.b2.velx += this.n12x * b;
  26538. this.b2.vely += this.n12y * b;
  26539. b = this.b3.imass * a;
  26540. this.b3.velx -= this.n34x * b;
  26541. this.b3.vely -= this.n34y * b;
  26542. b = this.b4.imass * a;
  26543. this.b4.velx += this.n34x * b;
  26544. this.b4.vely += this.n34y * b;
  26545. this.b1.angvel -= this.cx1 * this.b1.iinertia * a;
  26546. this.b2.angvel += this.cx2 * this.b2.iinertia * a;
  26547. this.b3.angvel -= this.cx3 * this.b3.iinertia * a;
  26548. this.b4.angvel += this.cx4 * this.b4.iinertia * a;
  26549. return !1
  26550. },
  26551. warmStart: function () {
  26552. if (!this.slack) {
  26553. var a =
  26554. this.b1.imass * this.jAcc;
  26555. this.b1.velx -= this.n12x * a;
  26556. this.b1.vely -= this.n12y * a;
  26557. a = this.b2.imass * this.jAcc;
  26558. this.b2.velx += this.n12x * a;
  26559. this.b2.vely += this.n12y * a;
  26560. a = this.b3.imass * this.jAcc;
  26561. this.b3.velx -= this.n34x * a;
  26562. this.b3.vely -= this.n34y * a;
  26563. a = this.b4.imass * this.jAcc;
  26564. this.b4.velx += this.n34x * a;
  26565. this.b4.vely += this.n34y * a;
  26566. this.b1.angvel -= this.cx1 * this.b1.iinertia * this.jAcc;
  26567. this.b2.angvel += this.cx2 * this.b2.iinertia * this.jAcc;
  26568. this.b3.angvel -= this.cx3 * this.b3.iinertia * this.jAcc;
  26569. this.b4.angvel += this.cx4 * this.b4.iinertia *
  26570. this.jAcc
  26571. }
  26572. },
  26573. preStep: function (a) {
  26574. -1 == this.pre_dt && (this.pre_dt = a);
  26575. var b = a / this.pre_dt;
  26576. this.pre_dt = a;
  26577. this.stepped = !0;
  26578. this.equal = this.jointMin == this.jointMax;
  26579. this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
  26580. this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
  26581. this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
  26582. this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
  26583. this.a3relx = this.b3.axisy * this.a3localx - this.b3.axisx * this.a3localy;
  26584. this.a3rely =
  26585. this.a3localx * this.b3.axisx + this.a3localy * this.b3.axisy;
  26586. this.a4relx = this.b4.axisy * this.a4localx - this.b4.axisx * this.a4localy;
  26587. this.a4rely = this.a4localx * this.b4.axisx + this.a4localy * this.b4.axisy;
  26588. var d = function (a) {
  26589. var b = 0,
  26590. d = 0,
  26591. c = 0,
  26592. g = 0,
  26593. b = a.b2.posx + a.a2relx - (a.b1.posx + a.a1relx),
  26594. d = a.b2.posy + a.a2rely - (a.b1.posy + a.a1rely),
  26595. c = a.b4.posx + a.a4relx - (a.b3.posx + a.a3relx),
  26596. g = a.b4.posy + a.a4rely - (a.b3.posy + a.a3rely),
  26597. h = Math.sqrt(b * b + d * d),
  26598. k = Math.sqrt(c * c + g * g);
  26599. if (0 != h) {
  26600. var r = 1 / h;
  26601. a.n12x = b * r;
  26602. a.n12y = d * r
  26603. }
  26604. 0 != k ? (r = 1 / k, a.n34x = c *
  26605. r, a.n34y = g * r, r = a.ratio) : r = a.ratio / Math.sqrt(a.n34x * a.n34x + a.n34y * a.n34y);
  26606. a.n34x *= r;
  26607. a.n34y *= r;
  26608. b = h + a.ratio * k;
  26609. a.equal ? (b -= a.jointMax, a.slack = !1) : b < a.jointMin ? (b = a.jointMin - b, a.n12x = -a.n12x, a.n12y = -a.n12y, a.n34x = -a.n34x, a.n34y = -a.n34y, a.slack = !1) : b > a.jointMax ? (b -= a.jointMax, a.slack = !1) : (a.n12x = 0, a.n12y = 0, a.n34x = 0, b = a.n34y = 0, a.slack = !0);
  26610. return b
  26611. }(this);
  26612. if (!this.slack) {
  26613. this.kMass = function (a) {
  26614. a.cx1 = a.n12y * a.a1relx - a.n12x * a.a1rely;
  26615. a.cx2 = a.n12y * a.a2relx - a.n12x * a.a2rely;
  26616. a.cx3 = a.n34y * a.a3relx - a.n34x * a.a3rely;
  26617. a.cx4 = a.n34y * a.a4relx - a.n34x * a.a4rely;
  26618. var b = a.b1.smass + a.b2.smass + a.ratio * a.ratio * (a.b3.smass + a.b4.smass) + a.b1.sinertia * a.cx1 * a.cx1 + a.b2.sinertia * a.cx2 * a.cx2 + a.b3.sinertia * a.cx3 * a.cx3 + a.b4.sinertia * a.cx4 * a.cx4;
  26619. a.b1 == a.b4 && (b -= 2 * ((a.n12x * a.n34x + a.n12y * a.n34y) * a.b1.smass + a.cx1 * a.cx4 * a.b1.sinertia));
  26620. a.b1 == a.b3 && (b += 2 * ((a.n12x * a.n34x + a.n12y * a.n34y) * a.b1.smass + a.cx1 * a.cx3 * a.b1.sinertia));
  26621. a.b2 == a.b3 && (b -= 2 * ((a.n12x * a.n34x + a.n12y * a.n34y) * a.b2.smass + a.cx2 * a.cx3 * a.b2.sinertia));
  26622. a.b2 == a.b4 && (b += 2 * ((a.n12x *
  26623. a.n34x + a.n12y * a.n34y) * a.b2.smass + a.cx2 * a.cx4 * a.b2.sinertia));
  26624. return b
  26625. }(this);
  26626. 0 != this.kMass ? this.kMass = 1 / this.kMass : this.jAcc = 0;
  26627. if (this.stiff) this.gamma = this.bias = 0;
  26628. else {
  26629. if (this.breakUnderError && d * d > this.maxError * this.maxError) return !0;
  26630. var c;
  26631. this.kMass *= function (b) {
  26632. var d = 2 * Math.PI * b.frequency;
  26633. b.gamma = 1 / (a * d * (2 * b.damping + d * a));
  26634. var l = 1 / (1 + b.gamma);
  26635. c = a * d * d * b.gamma;
  26636. b.gamma *= l;
  26637. return l
  26638. }(this);
  26639. this.bias = -d * c;
  26640. this.bias < -this.maxError ? this.bias = -this.maxError : this.bias > this.maxError && (this.bias = this.maxError)
  26641. }
  26642. this.jAcc *=
  26643. b;
  26644. this.jMax = this.maxForce * a
  26645. }
  26646. return !1
  26647. },
  26648. clearcache: function () {
  26649. this.jAcc = 0;
  26650. this.pre_dt = -1
  26651. },
  26652. pair_exists: function (a, b) {
  26653. return this.b1.id == a && (this.b2.id == b || this.b3.id == b || this.b4.id == b) || this.b2.id == a && (this.b3.id == b || this.b4.id == b || this.b1.id == b) || this.b3.id == a && (this.b4.id == b || this.b1.id == b || this.b2.id == b) || this.b4.id == a && (this.b1.id == b || this.b2.id == b || this.b3.id == b)
  26654. },
  26655. forest: function () {
  26656. if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  26657. var a = this.b1.component == this.b1.component.parent ? this.b1.component :
  26658. function (a) {
  26659. a = a.b1.component;
  26660. for (var b = null; a != a.parent;) {
  26661. var c = a.parent;
  26662. a.parent = b;
  26663. b = a;
  26664. a = c
  26665. }
  26666. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26667. return a
  26668. }(this),
  26669. b = this.component == this.component.parent ? this.component : function (a) {
  26670. a = a.component;
  26671. for (var b = null; a != a.parent;) {
  26672. var c = a.parent;
  26673. a.parent = b;
  26674. b = a;
  26675. a = c
  26676. }
  26677. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26678. return a
  26679. }(this);
  26680. a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
  26681. }
  26682. this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component ==
  26683. this.b2.component.parent ? this.b2.component : function (a) {
  26684. a = a.b2.component;
  26685. for (var b = null; a != a.parent;) {
  26686. var c = a.parent;
  26687. a.parent = b;
  26688. b = a;
  26689. a = c
  26690. }
  26691. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26692. return a
  26693. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  26694. a = a.component;
  26695. for (var b = null; a != a.parent;) {
  26696. var c = a.parent;
  26697. a.parent = b;
  26698. b = a;
  26699. a = c
  26700. }
  26701. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26702. return a
  26703. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)));
  26704. this.b3.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC &&
  26705. (a = this.b3.component == this.b3.component.parent ? this.b3.component : function (a) {
  26706. a = a.b3.component;
  26707. for (var b = null; a != a.parent;) {
  26708. var c = a.parent;
  26709. a.parent = b;
  26710. b = a;
  26711. a = c
  26712. }
  26713. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26714. return a
  26715. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  26716. a = a.component;
  26717. for (var b = null; a != a.parent;) {
  26718. var c = a.parent;
  26719. a.parent = b;
  26720. b = a;
  26721. a = c
  26722. }
  26723. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26724. return a
  26725. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)));
  26726. this.b4.type ==
  26727. c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b4.component == this.b4.component.parent ? this.b4.component : function (a) {
  26728. a = a.b4.component;
  26729. for (var b = null; a != a.parent;) {
  26730. var c = a.parent;
  26731. a.parent = b;
  26732. b = a;
  26733. a = c
  26734. }
  26735. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26736. return a
  26737. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  26738. a = a.component;
  26739. for (var b = null; a != a.parent;) {
  26740. var c = a.parent;
  26741. a.parent = b;
  26742. b = a;
  26743. a = c
  26744. }
  26745. for (; null != b;) c = b.parent, b.parent = a, b = c;
  26746. return a
  26747. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent =
  26748. a : (b.parent = a, a.rank++)))
  26749. },
  26750. wake_connected: function () {
  26751. null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
  26752. null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake();
  26753. null != this.b3 && this.b3.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b3.wake();
  26754. null != this.b4 && this.b4.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b4.wake()
  26755. },
  26756. validate: function () {
  26757. if (null == this.b1 || null == this.b2 || null == this.b3 || null == this.b4) throw "Error: PulleyJoint cannot be simulated with null bodies";
  26758. if (this.b1 == this.b2 || this.b3 == this.b4) throw "Error: PulleyJoint cannot have body1==body2 or body3==body4";
  26759. if (this.b1.space != this.space || this.b2.space != this.space || this.b3.space != this.space || this.b4.space != this.space) throw "Error: Constraints must have each body within the same space to which the constraint has been assigned";
  26760. if (this.jointMin > this.jointMax) throw "Error: PulleyJoint must have jointMin <= jointMax";
  26761. if (this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: PulleyJoint cannot have both bodies in a linked pair non-dynamic";
  26762. if (this.b3.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b4.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: PulleyJoint cannot have both bodies in a linked pair non-dynamic";
  26763. },
  26764. copy: function (a, b) {
  26765. var d = new h.constraint.PulleyJoint(null, null, null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2(), this.outer_zn.get_anchor3(), this.outer_zn.get_anchor4(), this.jointMin, this.jointMax, this.ratio);
  26766. this.copyto(d);
  26767. if (null != a && null != this.b1) {
  26768. for (var g = null, e = 0; e < a.length;) {
  26769. var f = a[e];
  26770. ++e;
  26771. if (f.id == this.b1.id) {
  26772. g = f.bc;
  26773. break
  26774. }
  26775. }
  26776. null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
  26777. d.zpp_inner_zn.b1 = a.zpp_inner
  26778. }))
  26779. }
  26780. if (null != a && null != this.b2) {
  26781. g = null;
  26782. for (e = 0; e < a.length;)
  26783. if (f = a[e], ++e, f.id == this.b2.id) {
  26784. g = f.bc;
  26785. break
  26786. }
  26787. null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
  26788. d.zpp_inner_zn.b2 = a.zpp_inner
  26789. }))
  26790. }
  26791. if (null != a && null != this.b3) {
  26792. g = null;
  26793. for (e = 0; e < a.length;)
  26794. if (f = a[e], ++e, f.id == this.b3.id) {
  26795. g = f.bc;
  26796. break
  26797. }
  26798. null !=
  26799. g ? d.zpp_inner_zn.b3 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b3.id, function (a) {
  26800. d.zpp_inner_zn.b3 = a.zpp_inner
  26801. }))
  26802. }
  26803. if (null != a && null != this.b4) {
  26804. g = null;
  26805. for (e = 0; e < a.length;)
  26806. if (f = a[e], ++e, f.id == this.b4.id) {
  26807. g = f.bc;
  26808. break
  26809. }
  26810. null != g ? d.zpp_inner_zn.b4 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b4.id, function (a) {
  26811. d.zpp_inner_zn.b4 = a.zpp_inner
  26812. }))
  26813. }
  26814. return d
  26815. },
  26816. setup_a4: function () {
  26817. this.wrap_a4 = h.geom.Vec2.get(this.a4localx, this.a4localy, null);
  26818. this.wrap_a4.zpp_inner._inuse = !0;
  26819. this.wrap_a4.zpp_inner._validate =
  26820. A(this, this.validate_a4);
  26821. this.wrap_a4.zpp_inner._invalidate = A(this, this.invalidate_a4)
  26822. },
  26823. invalidate_a4: function (a) {
  26824. this.immutable_midstep("Constraint::a4");
  26825. this.a4localx = a.x;
  26826. this.a4localy = a.y;
  26827. this.wake()
  26828. },
  26829. validate_a4: function () {
  26830. this.wrap_a4.zpp_inner.x = this.a4localx;
  26831. this.wrap_a4.zpp_inner.y = this.a4localy
  26832. },
  26833. setup_a3: function () {
  26834. this.wrap_a3 = h.geom.Vec2.get(this.a3localx, this.a3localy, null);
  26835. this.wrap_a3.zpp_inner._inuse = !0;
  26836. this.wrap_a3.zpp_inner._validate = A(this, this.validate_a3);
  26837. this.wrap_a3.zpp_inner._invalidate =
  26838. A(this, this.invalidate_a3)
  26839. },
  26840. invalidate_a3: function (a) {
  26841. this.immutable_midstep("Constraint::a3");
  26842. this.a3localx = a.x;
  26843. this.a3localy = a.y;
  26844. this.wake()
  26845. },
  26846. validate_a3: function () {
  26847. this.wrap_a3.zpp_inner.x = this.a3localx;
  26848. this.wrap_a3.zpp_inner.y = this.a3localy
  26849. },
  26850. setup_a2: function () {
  26851. this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
  26852. this.wrap_a2.zpp_inner._inuse = !0;
  26853. this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
  26854. this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
  26855. },
  26856. invalidate_a2: function (a) {
  26857. this.immutable_midstep("Constraint::a2");
  26858. this.a2localx = a.x;
  26859. this.a2localy = a.y;
  26860. this.wake()
  26861. },
  26862. validate_a2: function () {
  26863. this.wrap_a2.zpp_inner.x = this.a2localx;
  26864. this.wrap_a2.zpp_inner.y = this.a2localy
  26865. },
  26866. setup_a1: function () {
  26867. this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
  26868. this.wrap_a1.zpp_inner._inuse = !0;
  26869. this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
  26870. this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
  26871. },
  26872. invalidate_a1: function (a) {
  26873. this.immutable_midstep("Constraint::a1");
  26874. this.a1localx = a.x;
  26875. this.a1localy = a.y;
  26876. this.wake()
  26877. },
  26878. validate_a1: function () {
  26879. this.wrap_a1.zpp_inner.x = this.a1localx;
  26880. this.wrap_a1.zpp_inner.y = this.a1localy
  26881. },
  26882. inactiveBodies: function () {
  26883. null != this.b1 && this.b1.constraints.remove(this);
  26884. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this);
  26885. this.b3 != this.b1 && this.b3 != this.b2 && null != this.b3 && this.b3.constraints.remove(this);
  26886. this.b4 != this.b1 && this.b4 != this.b2 && this.b4 != this.b3 && null != this.b4 && this.b4.constraints.remove(this)
  26887. },
  26888. activeBodies: function () {
  26889. null != this.b1 && this.b1.constraints.add(this);
  26890. this.b2 !=
  26891. this.b1 && null != this.b2 && this.b2.constraints.add(this);
  26892. this.b3 != this.b1 && this.b3 != this.b2 && null != this.b3 && this.b3.constraints.add(this);
  26893. this.b4 != this.b1 && this.b4 != this.b2 && this.b4 != this.b3 && null != this.b4 && this.b4.constraints.add(this)
  26894. },
  26895. bodyImpulse: function (a) {
  26896. if (this.stepped) {
  26897. var b = h.geom.Vec3.get();
  26898. if (a == this.b1) {
  26899. var d = b;
  26900. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26901. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26902. var c = d.zpp_inner;
  26903. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26904. d.zpp_inner.validate();
  26905. c.x = d.zpp_inner.x - this.jAcc * this.n12x;
  26906. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26907. d.zpp_inner.validate();
  26908. d.zpp_inner.x;
  26909. d = b;
  26910. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26911. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26912. c = d.zpp_inner;
  26913. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26914. d.zpp_inner.validate();
  26915. c.y = d.zpp_inner.y - this.jAcc * this.n12y;
  26916. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26917. d.zpp_inner.validate();
  26918. d.zpp_inner.y;
  26919. d = b;
  26920. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26921. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26922. c = d.zpp_inner;
  26923. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26924. d.zpp_inner.validate();
  26925. c.z = d.zpp_inner.z - this.cx1 * this.jAcc;
  26926. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26927. d.zpp_inner.validate();
  26928. d.zpp_inner.z
  26929. }
  26930. if (a == this.b2) {
  26931. d = b;
  26932. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26933. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26934. c = d.zpp_inner;
  26935. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26936. d.zpp_inner.validate();
  26937. c.x = d.zpp_inner.x + this.jAcc * this.n12x;
  26938. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26939. d.zpp_inner.validate();
  26940. d.zpp_inner.x;
  26941. d = b;
  26942. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26943. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26944. c = d.zpp_inner;
  26945. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26946. d.zpp_inner.validate();
  26947. c.y = d.zpp_inner.y + this.jAcc * this.n12y;
  26948. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26949. d.zpp_inner.validate();
  26950. d.zpp_inner.y;
  26951. d = b;
  26952. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26953. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26954. c = d.zpp_inner;
  26955. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26956. d.zpp_inner.validate();
  26957. c.z = d.zpp_inner.z + this.cx2 * this.jAcc;
  26958. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26959. d.zpp_inner.validate();
  26960. d.zpp_inner.z
  26961. }
  26962. if (a == this.b3) {
  26963. d = b;
  26964. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26965. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26966. c = d.zpp_inner;
  26967. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26968. d.zpp_inner.validate();
  26969. c.x = d.zpp_inner.x - this.jAcc * this.n34x;
  26970. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26971. d.zpp_inner.validate();
  26972. d.zpp_inner.x;
  26973. d = b;
  26974. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26975. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26976. c = d.zpp_inner;
  26977. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26978. d.zpp_inner.validate();
  26979. c.y = d.zpp_inner.y - this.jAcc * this.n34y;
  26980. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26981. d.zpp_inner.validate();
  26982. d.zpp_inner.y;
  26983. d = b;
  26984. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26985. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26986. c = d.zpp_inner;
  26987. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26988. d.zpp_inner.validate();
  26989. c.z = d.zpp_inner.z - this.cx3 * this.jAcc;
  26990. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26991. d.zpp_inner.validate();
  26992. d.zpp_inner.z
  26993. }
  26994. if (a == this.b4) {
  26995. d = b;
  26996. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  26997. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  26998. a = d.zpp_inner;
  26999. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27000. d.zpp_inner.validate();
  27001. a.x = d.zpp_inner.x + this.jAcc * this.n34x;
  27002. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27003. d.zpp_inner.validate();
  27004. d.zpp_inner.x;
  27005. d = b;
  27006. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27007. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  27008. a = d.zpp_inner;
  27009. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27010. d.zpp_inner.validate();
  27011. a.y = d.zpp_inner.y + this.jAcc * this.n34y;
  27012. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27013. d.zpp_inner.validate();
  27014. d.zpp_inner.y;
  27015. d = b;
  27016. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27017. if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
  27018. a = d.zpp_inner;
  27019. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27020. d.zpp_inner.validate();
  27021. a.z = d.zpp_inner.z + this.cx4 * this.jAcc;
  27022. if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
  27023. d.zpp_inner.validate();
  27024. d.zpp_inner.z
  27025. }
  27026. return b
  27027. }
  27028. return h.geom.Vec3.get(0, 0, 0)
  27029. },
  27030. is_slack: function () {
  27031. var a;
  27032. this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
  27033. this.a1rely = this.a1localx * this.b1.axisx +
  27034. this.a1localy * this.b1.axisy;
  27035. this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
  27036. this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
  27037. this.a3relx = this.b3.axisy * this.a3localx - this.b3.axisx * this.a3localy;
  27038. this.a3rely = this.a3localx * this.b3.axisx + this.a3localy * this.b3.axisy;
  27039. this.a4relx = this.b4.axisy * this.a4localx - this.b4.axisx * this.a4localy;
  27040. this.a4rely = this.a4localx * this.b4.axisx + this.a4localy * this.b4.axisy;
  27041. var b = 0,
  27042. d = 0,
  27043. c = a = 0,
  27044. b = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx),
  27045. d = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
  27046. a = this.b4.posx + this.a4relx - (this.b3.posx + this.a3relx);
  27047. c = this.b4.posy + this.a4rely - (this.b3.posy + this.a3rely);
  27048. b = Math.sqrt(b * b + d * d);
  27049. a = Math.sqrt(a * a + c * c);
  27050. 0 == a && Math.sqrt(0);
  27051. c = b + this.ratio * a;
  27052. this.equal ? (c -= this.jointMax, a = !1) : c < this.jointMin ? (c = this.jointMin - c, a = !1) : c > this.jointMax ? (c -= this.jointMax, a = !1) : (c = 0, a = !0);
  27053. c;
  27054. return a
  27055. },
  27056. __class__: c.constraint.ZPP_PulleyJoint
  27057. });
  27058. c.constraint.ZPP_UserConstraint = function (a, b) {
  27059. this.Keff = this.vec3 = this.J = this.jOld =
  27060. null;
  27061. this.jMax = 0;
  27062. this.velonly = !1;
  27063. this.soft = this.gamma = 0;
  27064. this.L = this.y = null;
  27065. this.stepped = !1;
  27066. this.jAcc = this.bias = null;
  27067. this.dim = 0;
  27068. this.outer_zn = this.bodies = null;
  27069. c.constraint.ZPP_Constraint.call(this);
  27070. this.bodies = [];
  27071. this.dim = a;
  27072. this.velonly = b;
  27073. this.jAcc = [];
  27074. this.bias = [];
  27075. this.L = [];
  27076. this.J = [];
  27077. this.jOld = [];
  27078. this.y = [];
  27079. this.Keff = [];
  27080. this.vec3 = h.geom.Vec3.get(0, 0, 0);
  27081. for (var d = 0; d < a;)
  27082. for (var g = d++, e = this.jAcc[g] = this.bias[g] = this.J[g] = this.jOld[g] = this.y[g] = 0; e < a;) {
  27083. var f = e++;
  27084. this.L[g * a + f] = 0
  27085. }
  27086. this.stepped = !1
  27087. };
  27088. s["zpp_nape.constraint.ZPP_UserConstraint"] =
  27089. c.constraint.ZPP_UserConstraint;
  27090. c.constraint.ZPP_UserConstraint.__name__ = ["zpp_nape", "constraint", "ZPP_UserConstraint"];
  27091. c.constraint.ZPP_UserConstraint.__super__ = c.constraint.ZPP_Constraint;
  27092. c.constraint.ZPP_UserConstraint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  27093. draw: function (a) {
  27094. this.outer_zn.__draw(a)
  27095. },
  27096. applyImpulsePos: function () {
  27097. if (this.velonly) return !1;
  27098. this.outer_zn.__prepare();
  27099. this.outer_zn.__position(this.J);
  27100. var a = this.lsq(this.J);
  27101. if (this.breakUnderError && a > this.maxError * this.maxError) return !0;
  27102. if (a < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
  27103. for (var a = 0, b = this.dim; a < b;) {
  27104. var d = a++;
  27105. this.J[d] *= -1
  27106. }
  27107. this.outer_zn.__eff_mass(this.Keff);
  27108. this.transform(this.solve(this.Keff), this.J);
  27109. this.outer_zn.__clamp(this.J);
  27110. b = 0;
  27111. for (a = this.bodies; b < a.length;) {
  27112. d = a[b];
  27113. ++b;
  27114. d = d.body;
  27115. this.outer_zn.__impulse(this.J, d.outer, this.vec3);
  27116. var c = d.imass;
  27117. d.posx += this.vec3.get_x() * c;
  27118. d.posy += this.vec3.get_y() * c;
  27119. d.delta_rot(this.vec3.get_z() * d.iinertia)
  27120. }
  27121. return !1
  27122. },
  27123. applyImpulseVel: function () {
  27124. this.outer_zn.__velocity(this.J);
  27125. for (var a = 0, b = this.dim; a < b;) {
  27126. var d = a++;
  27127. this.J[d] = this.bias[d] - this.J[d]
  27128. }
  27129. this.transform(this.L, this.J);
  27130. a = 0;
  27131. for (b = this.dim; a < b;) d = a++, this.jOld[d] = this.jAcc[d], this.jAcc[d] += this.J[d] = this.J[d] * this.soft - this.jAcc[d] * this.gamma;
  27132. this.outer_zn.__clamp(this.jAcc);
  27133. if ((this.breakUnderForce || !this.stiff) && this.lsq(this.jAcc) > this.jMax * this.jMax) {
  27134. if (this.breakUnderForce) return !0;
  27135. this.stiff || this._clamp(this.jAcc, this.jMax)
  27136. }
  27137. a = 0;
  27138. for (b = this.dim; a < b;) d = a++, this.J[d] = this.jAcc[d] - this.jOld[d];
  27139. b = 0;
  27140. for (a = this.bodies; b <
  27141. a.length;) {
  27142. d = a[b];
  27143. ++b;
  27144. d = d.body;
  27145. this.outer_zn.__impulse(this.J, d.outer, this.vec3);
  27146. var c = d.imass;
  27147. d.velx += this.vec3.get_x() * c;
  27148. d.vely += this.vec3.get_y() * c;
  27149. d.angvel += this.vec3.get_z() * d.iinertia
  27150. }
  27151. return !1
  27152. },
  27153. warmStart: function () {
  27154. for (var a = 0, b = this.bodies; a < b.length;) {
  27155. var d = b[a];
  27156. ++a;
  27157. d = d.body;
  27158. this.outer_zn.__impulse(this.jAcc, d.outer, this.vec3);
  27159. var c = d.imass;
  27160. d.velx += this.vec3.get_x() * c;
  27161. d.vely += this.vec3.get_y() * c;
  27162. d.angvel += this.vec3.get_z() * d.iinertia
  27163. }
  27164. },
  27165. preStep: function (a) {
  27166. -1 == this.pre_dt && (this.pre_dt = a);
  27167. var b = a / this.pre_dt;
  27168. this.pre_dt = a;
  27169. this.stepped = !0;
  27170. this.outer_zn.__prepare();
  27171. this.outer_zn.__eff_mass(this.Keff);
  27172. this.L = this.solve(this.Keff);
  27173. if (this.stiff || this.velonly) {
  27174. c = 0;
  27175. for (e = this.dim; c < e;) f = c++, this.bias[f] = 0;
  27176. this.gamma = 0;
  27177. this.soft = 1
  27178. } else {
  27179. var d;
  27180. d = 2 * Math.PI * this.frequency;
  27181. this.gamma = 1 / (a * d * (2 * this.damping + d * a));
  27182. c = 1 / (1 + this.gamma);
  27183. d = a * d * d * this.gamma;
  27184. this.gamma *= c;
  27185. this.soft = c;
  27186. this.outer_zn.__position(this.bias);
  27187. if (this.breakUnderError && this.lsq(this.bias) > this.maxError * this.maxError) return !0;
  27188. for (var c =
  27189. 0, e = this.dim; c < e;) {
  27190. var f = c++;
  27191. this.bias[f] *= -d
  27192. }
  27193. this._clamp(this.bias, this.maxError)
  27194. }
  27195. c = 0;
  27196. for (e = this.dim; c < e;) f = c++, this.jAcc[f] *= b;
  27197. this.jMax = this.maxForce * a;
  27198. return !1
  27199. },
  27200. transform: function (a, b) {
  27201. for (var d = 0, c = this.dim; d < c;) {
  27202. var e = d++,
  27203. f = b[e],
  27204. l = a[e * this.dim + e];
  27205. if (0 != l) {
  27206. for (var m = 0; m < e;) var h = m++,
  27207. f = f - a[e * this.dim + h] * this.y[h];
  27208. this.y[e] = f / l
  27209. } else this.y[e] = 0
  27210. }
  27211. d = 0;
  27212. for (c = this.dim; d < c;)
  27213. if (e = d++, e = this.dim - 1 - e, l = a[e * this.dim + e], 0 != l) {
  27214. for (var f = this.y[e], p = e + 1, m = this.dim; p < m;) h = p++, f -= a[h * this.dim + e] * b[h];
  27215. b[e] = f /
  27216. l
  27217. } else b[e] = 0
  27218. },
  27219. solve: function (a) {
  27220. for (var b = 0, d = 0, c = this.dim; d < c;) {
  27221. for (var e = d++, f = 0, l = 0, m = e - 1; l < m;) var h = l++,
  27222. f = f + this.L[e * this.dim + h] * this.L[e * this.dim + h];
  27223. f = Math.sqrt(a[b++] - f);
  27224. this.L[e * this.dim + e] = f;
  27225. if (0 != f)
  27226. for (f = 1 / f, l = e + 1, m = this.dim; l < m;) {
  27227. for (var p = l++, k = 0, r = 0, n = e - 1; r < n;) h = r++, k += this.L[p * this.dim + h] * this.L[e * this.dim + h];
  27228. this.L[p * this.dim + e] = f * (a[b++] - k)
  27229. } else {
  27230. l = e + 1;
  27231. for (m = this.dim; l < m;) p = l++, this.L[p * this.dim + e] = 0;
  27232. b += this.dim - e - 1
  27233. }
  27234. }
  27235. return this.L
  27236. },
  27237. _clamp: function (a, b) {
  27238. var d = this.lsq(a);
  27239. if (d > b * b)
  27240. for (var d =
  27241. b / Math.sqrt(d), c = 0, e = this.dim; c < e;) {
  27242. var f = c++;
  27243. a[f] *= d
  27244. }
  27245. },
  27246. lsq: function (a) {
  27247. for (var b = 0, d = 0, c = this.dim; d < c;) var e = d++,
  27248. b = b + a[e] * a[e];
  27249. return b
  27250. },
  27251. clearcache: function () {
  27252. for (var a = 0, b = this.dim; a < b;) {
  27253. var d = a++;
  27254. this.jAcc[d] = 0
  27255. }
  27256. this.pre_dt = -1
  27257. },
  27258. broken: function () {
  27259. this.outer_zn.__broken()
  27260. },
  27261. pair_exists: function (a, b) {
  27262. for (var d = !1, c = this.bodies.length | 0, e = 0; e < c;) {
  27263. for (var f = e++, l = this.bodies[f].body, f = f + 1; f < c;) {
  27264. var m = f++,
  27265. m = this.bodies[m].body;
  27266. if (l.id == a && m.id == b || l.id == b && m.id == a) {
  27267. d = !0;
  27268. break
  27269. }
  27270. }
  27271. if (d) break
  27272. }
  27273. return d
  27274. },
  27275. forest: function () {
  27276. for (var a =
  27277. 0, b = this.bodies; a < b.length;) {
  27278. var d = b[a];
  27279. ++a;
  27280. if (d.body.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  27281. var g = d.body.component == d.body.component.parent ? d.body.component : function (a) {
  27282. a = d.body.component;
  27283. for (var b = null; a != a.parent;) {
  27284. var c = a.parent;
  27285. a.parent = b;
  27286. b = a;
  27287. a = c
  27288. }
  27289. for (; null != b;) c = b.parent, b.parent = a, b = c;
  27290. return a
  27291. }(this),
  27292. e = this.component == this.component.parent ? this.component : function (a) {
  27293. a = a.component;
  27294. for (var b = null; a != a.parent;) {
  27295. var d = a.parent;
  27296. a.parent = b;
  27297. b = a;
  27298. a = d
  27299. }
  27300. for (; null != b;) d = b.parent, b.parent = a, b = d;
  27301. return a
  27302. }(this);
  27303. g != e && (g.rank < e.rank ? g.parent = e : g.rank > e.rank ? e.parent = g : (e.parent = g, g.rank++))
  27304. }
  27305. }
  27306. },
  27307. wake_connected: function () {
  27308. for (var a = 0, b = this.bodies; a < b.length;) {
  27309. var d = b[a];
  27310. ++a;
  27311. d.body.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && d.body.wake()
  27312. }
  27313. },
  27314. validate: function () {
  27315. for (var a = 0, b = this.bodies; a < b.length;) {
  27316. var d = b[a];
  27317. ++a;
  27318. if (d.body.space != this.space) throw "Error: Constraints must have each body within the same sapce to which the constraint has been assigned";
  27319. }
  27320. this.outer_zn.__validate()
  27321. },
  27322. copy: function (a, b) {
  27323. var d = this.outer_zn.__copy();
  27324. this.copyto(d);
  27325. throw "not done yet";
  27326. },
  27327. inactiveBodies: function () {
  27328. for (var a = 0, b = this.bodies; a < b.length;) {
  27329. var d = b[a];
  27330. ++a;
  27331. null != d.body && d.body.constraints.remove(this)
  27332. }
  27333. },
  27334. activeBodies: function () {
  27335. for (var a = 0, b = this.bodies; a < b.length;) {
  27336. var d = b[a];
  27337. ++a;
  27338. null != d.body && d.body.constraints.add(this)
  27339. }
  27340. },
  27341. bodyImpulse: function (a) {
  27342. for (var b = 0, d = this.dim; b < d;) {
  27343. var c = b++;
  27344. this.J[c] = this.jAcc[c]
  27345. }
  27346. b = h.geom.Vec3.get(0, 0, 0);
  27347. this.stepped && this.outer_zn.__impulse(this.J, a.outer, b);
  27348. return b
  27349. },
  27350. remBody: function (a) {
  27351. for (var b = null, d =
  27352. this.bodies.length | 0, c = 0; c < d;) {
  27353. var e = this.bodies[c];
  27354. if (e.body == a) {
  27355. e.cnt--;
  27356. 0 == e.cnt && (0 < d && (this.bodies[c] = this.bodies[d - 1]), this.bodies.pop(), this.active && null != this.space && null != a && a.constraints.remove(this));
  27357. b = e;
  27358. break
  27359. }
  27360. c++
  27361. }
  27362. return null != b
  27363. },
  27364. addBody: function (a) {
  27365. for (var b = null, d = 0, g = this.bodies; d < g.length;) {
  27366. var e = g[d];
  27367. ++d;
  27368. if (e.body == a) {
  27369. b = e;
  27370. break
  27371. }
  27372. }
  27373. null == b ? (this.bodies.push(new c.constraint.ZPP_UserBody(1, a)), this.active && null != this.space && null != a && a.constraints.add(this)) : b.cnt++
  27374. },
  27375. bindVec2_invalidate: function (a) {
  27376. this.outer_zn.__invalidate()
  27377. },
  27378. __class__: c.constraint.ZPP_UserConstraint
  27379. });
  27380. c.constraint.ZPP_UserBody = function (a, b) {
  27381. this.body = null;
  27382. this.cnt = 0;
  27383. this.cnt = a;
  27384. this.body = b
  27385. };
  27386. s["zpp_nape.constraint.ZPP_UserBody"] = c.constraint.ZPP_UserBody;
  27387. c.constraint.ZPP_UserBody.__name__ = ["zpp_nape", "constraint", "ZPP_UserBody"];
  27388. c.constraint.ZPP_UserBody.prototype = {
  27389. __class__: c.constraint.ZPP_UserBody
  27390. };
  27391. c.constraint.ZPP_WeldJoint = function () {
  27392. this.stepped = !1;
  27393. this.phase = this.kMassa = this.kMassb = this.kMassd = this.kMassc = this.kMasse = this.kMassf = this.jAccx = this.jAccy =
  27394. this.jAccz = this.jMax = this.gamma = this.biasx = this.biasy = this.biasz = 0;
  27395. this.wrap_a2 = null;
  27396. this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
  27397. this.wrap_a1 = this.b2 = null;
  27398. this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
  27399. this.outer_zn = this.b1 = null;
  27400. c.constraint.ZPP_Constraint.call(this);
  27401. this.jAccz = this.jAccy = this.jAccx = this.phase = 0;
  27402. this.jMax = Math.POSITIVE_INFINITY;
  27403. this.stepped = !1;
  27404. this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx = 0
  27405. };
  27406. s["zpp_nape.constraint.ZPP_WeldJoint"] =
  27407. c.constraint.ZPP_WeldJoint;
  27408. c.constraint.ZPP_WeldJoint.__name__ = ["zpp_nape", "constraint", "ZPP_WeldJoint"];
  27409. c.constraint.ZPP_WeldJoint.__super__ = c.constraint.ZPP_Constraint;
  27410. c.constraint.ZPP_WeldJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
  27411. draw: function (a) {
  27412. var b = this.outer_zn,
  27413. d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
  27414. null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
  27415. return b.zpp_inner_zn.wrap_a1
  27416. }(this)),
  27417. g = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
  27418. null ==
  27419. b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
  27420. return b.zpp_inner_zn.wrap_a2
  27421. }(this));
  27422. if (!this.stiff) {
  27423. var e = g.sub(d);
  27424. 0 != function (a) {
  27425. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  27426. return Math.sqrt(function (a) {
  27427. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  27428. e.zpp_inner.validate();
  27429. return e.zpp_inner.x
  27430. }(a) * function (a) {
  27431. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  27432. e.zpp_inner.validate();
  27433. return e.zpp_inner.x
  27434. }(a) +
  27435. function (a) {
  27436. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  27437. e.zpp_inner.validate();
  27438. return e.zpp_inner.y
  27439. }(a) * function (a) {
  27440. if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  27441. e.zpp_inner.validate();
  27442. return e.zpp_inner.y
  27443. }(a))
  27444. }(this) && a.drawSpring(d, g, 16711935);
  27445. e.dispose();
  27446. var f = 5 / Math.PI / 2;
  27447. if ((null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer) != (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_space().zpp_inner.__static) {
  27448. var l = (null ==
  27449. b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - b.zpp_inner_zn.phase,
  27450. m = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot;
  27451. if (m > l) var h = m,
  27452. m = l,
  27453. l = h;
  27454. c.constraint.ZPP_AngleDraw.drawSpiralSpring(a, (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_position(), m, l, 10 + (m - m) * f, 10 + (l - m) * f, 16711808);
  27455. c.constraint.ZPP_AngleDraw.indicator(a, (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).get_position(), (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot,
  27456. 10 + ((null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot - m) * f, 16711808)
  27457. }(null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer) != (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_space().zpp_inner.__static && (l = b.zpp_inner_zn.phase + (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot, m = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot, m > l && (h = m, m = l, l = h), c.constraint.ZPP_AngleDraw.drawSpiralSpring(a, (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_position(),
  27458. m, l, 10 + (m - m) * f, 10 + (l - m) * f, 8388863), c.constraint.ZPP_AngleDraw.indicator(a, (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).get_position(), (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot, 10 + ((null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - m) * f, 8388863))
  27459. }
  27460. a.drawFilledCircle(d, 2, 255);
  27461. a.drawFilledCircle(g, 2, 16711680);
  27462. d.dispose();
  27463. g.dispose()
  27464. },
  27465. applyImpulsePos: function () {
  27466. var a = 0,
  27467. b = 0,
  27468. a = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
  27469. b = this.a1localx * this.b1.axisx +
  27470. this.a1localy * this.b1.axisy,
  27471. d = 0,
  27472. g = 0,
  27473. d = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
  27474. g = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
  27475. e = 0,
  27476. f = 0,
  27477. l = 0,
  27478. e = this.b2.posx + d - (this.b1.posx + a),
  27479. f = this.b2.posy + g - (this.b1.posy + b),
  27480. l = this.b2.rot - this.b1.rot - this.phase,
  27481. m = 0,
  27482. u = 0,
  27483. p = 0;
  27484. if (this.breakUnderError && e * e + f * f + l * l > this.maxError * this.maxError) return !0;
  27485. m = !0;
  27486. e * e + f * f < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop && (m = !1, f = e = 0);
  27487. if (l * l < c.util.ZPP_Math.sqr(h.Config.constraintAngularSlop))
  27488. if (m) l =
  27489. 0;
  27490. else return !1;
  27491. var k = 0.5,
  27492. r = k,
  27493. e = e * r,
  27494. f = f * r,
  27495. l = l * k;
  27496. if (6 < e * e + f * f) {
  27497. var n = this.b1.smass + this.b2.smass;
  27498. n > h.Config.epsilon && (n = 0.75 / n, m = -e * n, u = -f * n, k = 20, e = m * m + u * u, e > k * k && (r = k * (1 / Math.sqrt(e)), m *= r, u *= r), k = this.b1.imass, this.b1.posx -= m * k, this.b1.posy -= u * k, k = this.b2.imass, this.b2.posx += m * k, this.b2.posy += u * k, e = this.b2.posx + d - (this.b1.posx + a), f = this.b2.posy + g - (this.b1.posy + b), l = this.b2.rot - this.b1.rot - this.phase, r = k = 0.5, e *= r, f *= r, l *= k)
  27499. }
  27500. var w = n = 0,
  27501. t = 0,
  27502. q = 0,
  27503. s = 0,
  27504. y = 0,
  27505. n = m = this.b1.smass + this.b2.smass,
  27506. w = 0,
  27507. t = m,
  27508. y = s = q = 0;
  27509. 0 != this.b1.sinertia && (k = a * this.b1.sinertia, r = b * this.b1.sinertia, n += r * b, w += -r * a, t += k * a, q += -r, s += k, y += this.b1.sinertia);
  27510. 0 != this.b2.sinertia && (k = d * this.b2.sinertia, r = g * this.b2.sinertia, n += r * g, w += -r * d, t += k * d, q += -r, s += k, y += this.b2.sinertia);
  27511. m = -e;
  27512. u = -f;
  27513. p = -l;
  27514. k = 6;
  27515. e = m * m + u * u;
  27516. e > k * k && (r = k * (1 / Math.sqrt(e)), m *= r, u *= r);
  27517. c.util.ZPP_Math.clamp(p, -0.25, 0.25);
  27518. e = n * (t * y - s * s) + w * (q * s - w * y) + q * (w * s - q * t);
  27519. e != e ? m = u = p = 0 : 0 == e ? (m = 0 != n ? m / n : 0, u = 0 != t ? u / t : 0, p = 0 != y ? p / y : 0) : (e = 1 / e, r = s * q - w * y, f = w * s - q * t, l = w * q - n * s, k = e * (m * (t * y - s * s) + u * r + p * f),
  27520. r = e * (m * r + u * (n * y - q * q) + p * l), p = e * (m * f + u * l + p * (n * t - w * w)), m = k, u = r);
  27521. k = this.b1.imass;
  27522. this.b1.posx -= m * k;
  27523. this.b1.posy -= u * k;
  27524. k = this.b2.imass;
  27525. this.b2.posx += m * k;
  27526. this.b2.posy += u * k;
  27527. this.b1.delta_rot(-(u * a - m * b + p) * this.b1.iinertia);
  27528. this.b2.delta_rot((u * d - m * g + p) * this.b2.iinertia);
  27529. return !1
  27530. },
  27531. applyImpulseVel: function () {
  27532. var a = 0,
  27533. b = 0,
  27534. d = 0,
  27535. a = this.b2.velx + this.b2.kinvelx - this.a2rely * (this.b2.angvel + this.b2.kinangvel) - (this.b1.velx + this.b1.kinvelx - this.a1rely * (this.b1.angvel + this.b1.kinangvel)),
  27536. b = this.b2.vely + this.b2.kinvely +
  27537. this.a2relx * (this.b2.angvel + this.b2.kinangvel) - (this.b1.vely + this.b1.kinvely + this.a1relx * (this.b1.angvel + this.b1.kinangvel)),
  27538. d = this.b2.angvel + this.b2.kinangvel - this.b1.angvel - this.b1.kinangvel,
  27539. c = 0,
  27540. e = 0,
  27541. f = 0,
  27542. c = this.biasx - a,
  27543. e = this.biasy - b,
  27544. f = this.biasz - d,
  27545. d = this.kMassa * c + this.kMassb * e + this.kMassc * f,
  27546. l = this.kMassb * c + this.kMassd * e + this.kMasse * f,
  27547. f = this.kMassc * c + this.kMasse * e + this.kMassf * f,
  27548. b = a = this.gamma,
  27549. c = d - this.jAccx * b,
  27550. e = l - this.jAccy * b,
  27551. f = f - this.jAccz * a,
  27552. m = l = d = 0,
  27553. d = this.jAccx,
  27554. l = this.jAccy,
  27555. m = this.jAccz,
  27556. b = a = 1;
  27557. this.jAccx += c * b;
  27558. this.jAccy += e * b;
  27559. this.jAccz += f * a;
  27560. if (this.breakUnderForce) {
  27561. if (this.jAccx * this.jAccx + this.jAccy * this.jAccy + this.jAccz * this.jAccz > this.jMax * this.jMax) return !0
  27562. } else this.stiff || (a = this.jMax, c = this.jAccx * this.jAccx + this.jAccy * this.jAccy + this.jAccz * this.jAccz, c > a * a && (c = b = a * (1 / Math.sqrt(c)), this.jAccx *= c, this.jAccy *= c, this.jAccz *= b));
  27563. c = this.jAccx - d;
  27564. e = this.jAccy - l;
  27565. f = this.jAccz - m;
  27566. a = this.b1.imass;
  27567. this.b1.velx -= c * a;
  27568. this.b1.vely -= e * a;
  27569. a = this.b2.imass;
  27570. this.b2.velx += c * a;
  27571. this.b2.vely += e * a;
  27572. this.b1.angvel -=
  27573. (e * this.a1relx - c * this.a1rely + f) * this.b1.iinertia;
  27574. this.b2.angvel += (e * this.a2relx - c * this.a2rely + f) * this.b2.iinertia;
  27575. return !1
  27576. },
  27577. warmStart: function () {
  27578. var a = this.b1.imass;
  27579. this.b1.velx -= this.jAccx * a;
  27580. this.b1.vely -= this.jAccy * a;
  27581. a = this.b2.imass;
  27582. this.b2.velx += this.jAccx * a;
  27583. this.b2.vely += this.jAccy * a;
  27584. this.b1.angvel -= (this.jAccy * this.a1relx - this.jAccx * this.a1rely + this.jAccz) * this.b1.iinertia;
  27585. this.b2.angvel += (this.jAccy * this.a2relx - this.jAccx * this.a2rely + this.jAccz) * this.b2.iinertia
  27586. },
  27587. preStep: function (a) {
  27588. -1 == this.pre_dt &&
  27589. (this.pre_dt = a);
  27590. var b = a / this.pre_dt;
  27591. this.pre_dt = a;
  27592. this.stepped = !0;
  27593. this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
  27594. this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
  27595. this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
  27596. this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
  27597. var d = this.b1.smass + this.b2.smass;
  27598. this.kMassa = d;
  27599. this.kMassb = 0;
  27600. this.kMassd = d;
  27601. this.kMassf = this.kMasse = this.kMassc = 0;
  27602. if (0 != this.b1.sinertia) {
  27603. var d = this.a1relx * this.b1.sinertia,
  27604. c = this.a1rely * this.b1.sinertia;
  27605. this.kMassa += c * this.a1rely;
  27606. this.kMassb += -c * this.a1relx;
  27607. this.kMassd += d * this.a1relx;
  27608. this.kMassc += -c;
  27609. this.kMasse += d;
  27610. this.kMassf += this.b1.sinertia
  27611. }
  27612. 0 != this.b2.sinertia && (d = this.a2relx * this.b2.sinertia, c = this.a2rely * this.b2.sinertia, this.kMassa += c * this.a2rely, this.kMassb += -c * this.a2relx, this.kMassd += d * this.a2relx, this.kMassc += -c, this.kMasse += d, this.kMassf += this.b2.sinertia);
  27613. d = function (a) {
  27614. var b = a.kMassa * (a.kMassd * a.kMassf - a.kMasse * a.kMasse) + a.kMassb * (a.kMassc * a.kMasse - a.kMassb *
  27615. a.kMassf) + a.kMassc * (a.kMassb * a.kMasse - a.kMassc * a.kMassd);
  27616. return b != b ? function (a) {
  27617. a.kMassa = 0;
  27618. a.kMassb = 0;
  27619. a.kMassd = 0;
  27620. a.kMassc = 0;
  27621. a.kMasse = 0;
  27622. a.kMassf = 0;
  27623. return 7
  27624. }(a) : 0 == b ? function (a) {
  27625. var b = 0;
  27626. 0 != a.kMassa ? a.kMassa = 1 / a.kMassa : (a.kMassa = 0, b |= 1);
  27627. 0 != a.kMassd ? a.kMassd = 1 / a.kMassd : (a.kMassd = 0, b |= 2);
  27628. 0 != a.kMassf ? a.kMassf = 1 / a.kMassf : (a.kMassf = 0, b |= 4);
  27629. a.kMassb = a.kMassc = a.kMasse = 0;
  27630. return b
  27631. }(a) : function (a) {
  27632. b = 1 / b;
  27633. var d = b * (a.kMasse * a.kMassc - a.kMassb * a.kMassf),
  27634. c = b * (a.kMassa * a.kMassf - a.kMassc * a.kMassc),
  27635. e = b * (a.kMassb * a.kMasse -
  27636. a.kMassc * a.kMassd),
  27637. g = b * (a.kMassb * a.kMassc - a.kMassa * a.kMasse),
  27638. f = b * (a.kMassa * a.kMassd - a.kMassb * a.kMassb);
  27639. a.kMassa = b * (a.kMassd * a.kMassf - a.kMasse * a.kMasse);
  27640. a.kMassb = d;
  27641. a.kMassd = c;
  27642. a.kMassc = e;
  27643. a.kMasse = g;
  27644. a.kMassf = f;
  27645. return 0
  27646. }(a)
  27647. }(this);
  27648. 0 != (d & 1) && (this.jAccx = 0);
  27649. 0 != (d & 2) && (this.jAccy = 0);
  27650. 0 != (d & 4) && (this.jAccz = 0);
  27651. if (this.stiff) this.gamma = this.biasz = this.biasy = this.biasx = 0;
  27652. else {
  27653. var e, d = function (b) {
  27654. var d = 2 * Math.PI * b.frequency;
  27655. b.gamma = 1 / (a * d * (2 * b.damping + d * a));
  27656. var c = 1 / (1 + b.gamma);
  27657. e = a * d * d * b.gamma;
  27658. b.gamma *= c;
  27659. return c
  27660. }(this);
  27661. this.kMassa *= d;
  27662. this.kMassb *= d;
  27663. this.kMassd *= d;
  27664. this.kMassc *= d;
  27665. this.kMasse *= d;
  27666. this.kMassf *= d;
  27667. this.biasx = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx);
  27668. this.biasy = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
  27669. this.biasz = this.b2.rot - this.b1.rot - this.phase;
  27670. if (this.breakUnderError && this.biasx * this.biasx + this.biasy * this.biasy + this.biasz * this.biasz > this.maxError * this.maxError) return !0;
  27671. c = d = -e;
  27672. this.biasx *= c;
  27673. this.biasy *= c;
  27674. this.biasz *= d;
  27675. d = this.maxError;
  27676. c = this.biasx * this.biasx + this.biasy * this.biasy +
  27677. this.biasz * this.biasz;
  27678. c > d * d && (d = c = d * (1 / Math.sqrt(c)), this.biasx *= d, this.biasy *= d, this.biasz *= c)
  27679. }
  27680. c = d = b;
  27681. this.jAccx *= c;
  27682. this.jAccy *= c;
  27683. this.jAccz *= d;
  27684. this.jMax = this.maxForce * a;
  27685. return !1
  27686. },
  27687. clearcache: function () {
  27688. this.jAccz = this.jAccy = this.jAccx = 0;
  27689. this.pre_dt = -1
  27690. },
  27691. pair_exists: function (a, b) {
  27692. return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
  27693. },
  27694. forest: function () {
  27695. if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  27696. var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
  27697. a =
  27698. a.b1.component;
  27699. for (var b = null; a != a.parent;) {
  27700. var c = a.parent;
  27701. a.parent = b;
  27702. b = a;
  27703. a = c
  27704. }
  27705. for (; null != b;) c = b.parent, b.parent = a, b = c;
  27706. return a
  27707. }(this),
  27708. b = this.component == this.component.parent ? this.component : function (a) {
  27709. a = a.component;
  27710. for (var b = null; a != a.parent;) {
  27711. var c = a.parent;
  27712. a.parent = b;
  27713. b = a;
  27714. a = c
  27715. }
  27716. for (; null != b;) c = b.parent, b.parent = a, b = c;
  27717. return a
  27718. }(this);
  27719. a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
  27720. }
  27721. this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ?
  27722. this.b2.component : function (a) {
  27723. a = a.b2.component;
  27724. for (var b = null; a != a.parent;) {
  27725. var c = a.parent;
  27726. a.parent = b;
  27727. b = a;
  27728. a = c
  27729. }
  27730. for (; null != b;) c = b.parent, b.parent = a, b = c;
  27731. return a
  27732. }(this), b = this.component == this.component.parent ? this.component : function (a) {
  27733. a = a.component;
  27734. for (var b = null; a != a.parent;) {
  27735. var c = a.parent;
  27736. a.parent = b;
  27737. b = a;
  27738. a = c
  27739. }
  27740. for (; null != b;) c = b.parent, b.parent = a, b = c;
  27741. return a
  27742. }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
  27743. },
  27744. wake_connected: function () {
  27745. null != this.b1 && this.b1.type ==
  27746. c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
  27747. null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
  27748. },
  27749. validate: function () {
  27750. if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
  27751. if (this.b1 == this.b2) throw "Error: WeldJoint cannot be simulated with body1 == body2";
  27752. if (this.b1.space != this.space || this.b2.space != this.space) throw "Error: Constraints must have each body within the same space to which the constraint has been assigned";
  27753. if (this.b1.type !=
  27754. c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Constraints cannot have both bodies non-dynamic";
  27755. },
  27756. copy: function (a, b) {
  27757. var d = new h.constraint.PivotJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2());
  27758. this.copyto(d);
  27759. if (null != a && null != this.b1) {
  27760. for (var g = null, e = 0; e < a.length;) {
  27761. var f = a[e];
  27762. ++e;
  27763. if (f.id == this.b1.id) {
  27764. g = f.bc;
  27765. break
  27766. }
  27767. }
  27768. null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
  27769. d.zpp_inner_zn.b1 =
  27770. a.zpp_inner
  27771. }))
  27772. }
  27773. if (null != a && null != this.b2) {
  27774. g = null;
  27775. for (e = 0; e < a.length;)
  27776. if (f = a[e], ++e, f.id == this.b2.id) {
  27777. g = f.bc;
  27778. break
  27779. }
  27780. null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
  27781. d.zpp_inner_zn.b2 = a.zpp_inner
  27782. }))
  27783. }
  27784. return d
  27785. },
  27786. setup_a2: function () {
  27787. this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
  27788. this.wrap_a2.zpp_inner._inuse = !0;
  27789. this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
  27790. this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
  27791. },
  27792. invalidate_a2: function (a) {
  27793. this.immutable_midstep("Constraint::a2");
  27794. this.a2localx = a.x;
  27795. this.a2localy = a.y;
  27796. this.wake()
  27797. },
  27798. validate_a2: function () {
  27799. this.wrap_a2.zpp_inner.x = this.a2localx;
  27800. this.wrap_a2.zpp_inner.y = this.a2localy
  27801. },
  27802. setup_a1: function () {
  27803. this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
  27804. this.wrap_a1.zpp_inner._inuse = !0;
  27805. this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
  27806. this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
  27807. },
  27808. invalidate_a1: function (a) {
  27809. this.immutable_midstep("Constraint::a1");
  27810. this.a1localx = a.x;
  27811. this.a1localy = a.y;
  27812. this.wake()
  27813. },
  27814. validate_a1: function () {
  27815. this.wrap_a1.zpp_inner.x = this.a1localx;
  27816. this.wrap_a1.zpp_inner.y = this.a1localy
  27817. },
  27818. inactiveBodies: function () {
  27819. null != this.b1 && this.b1.constraints.remove(this);
  27820. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
  27821. },
  27822. activeBodies: function () {
  27823. null != this.b1 && this.b1.constraints.add(this);
  27824. this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
  27825. },
  27826. bodyImpulse: function (a) {
  27827. return this.stepped ? a == this.b1 ? h.geom.Vec3.get(-this.jAccx, -this.jAccy, -(this.jAccy * this.a1relx - this.jAccx *
  27828. this.a1rely + this.jAccz)) : h.geom.Vec3.get(this.jAccx, this.jAccy, this.jAccy * this.a2relx - this.jAccx * this.a2rely + this.jAccz) : h.geom.Vec3.get(0, 0, 0)
  27829. },
  27830. __class__: c.constraint.ZPP_WeldJoint
  27831. });
  27832. c.dynamics = {};
  27833. c.dynamics.ZPP_Arbiter = function () {
  27834. this.colarb = this.fluidarb = this.sensorarb = null;
  27835. this.type = 0;
  27836. this.b1 = this.b2 = this.ws1 = this.ws2 = this.pair = null;
  27837. this.invalidated = !1;
  27838. this.immState = 0;
  27839. this.intchange = this.presentable = this.continuous = this.fresh = !1;
  27840. this.present = 0;
  27841. this.active = this.cleared = this.sleeping = !1;
  27842. this.id =
  27843. this.di = this.stamp = this.up_stamp = this.sleep_stamp = this.endGenerated = 0;
  27844. this.outer = this.hnext = null
  27845. };
  27846. s["zpp_nape.dynamics.ZPP_Arbiter"] = c.dynamics.ZPP_Arbiter;
  27847. c.dynamics.ZPP_Arbiter.__name__ = ["zpp_nape", "dynamics", "ZPP_Arbiter"];
  27848. c.dynamics.ZPP_Arbiter.prototype = {
  27849. sup_retire: function () {
  27850. this.cleared || (this.b1.arbiters.inlined_try_remove(this), this.b2.arbiters.inlined_try_remove(this), null != this.pair && (this.pair = this.pair.arb = null));
  27851. this.b1 = this.b2 = null;
  27852. this.intchange = this.active = !1
  27853. },
  27854. sup_assign: function (a,
  27855. b, d, c) {
  27856. this.b1 = a.body;
  27857. this.ws1 = a;
  27858. this.b2 = b.body;
  27859. this.ws2 = b;
  27860. this.id = d;
  27861. this.di = c;
  27862. this.b1.arbiters.inlined_add(this);
  27863. this.b2.arbiters.inlined_add(this);
  27864. this.active = !0;
  27865. this.present = 0;
  27866. this.presentable = this.fresh = this.sleeping = this.cleared = !1
  27867. },
  27868. lazyRetire: function (a, b) {
  27869. this.cleared = !0;
  27870. null != b && this.b2 != b || this.b1.arbiters.inlined_try_remove(this);
  27871. null != b && this.b1 != b || this.b2.arbiters.inlined_try_remove(this);
  27872. null != this.pair && (this.pair = this.pair.arb = null);
  27873. this.active = !1;
  27874. a.f_arbiters.modified = !0
  27875. },
  27876. swap_features: function () {
  27877. var a =
  27878. this.b1;
  27879. this.b1 = this.b2;
  27880. this.b2 = a;
  27881. a = this.ws1;
  27882. this.ws1 = this.ws2;
  27883. this.ws2 = a;
  27884. a = this.colarb.s1;
  27885. this.colarb.s1 = this.colarb.s2;
  27886. this.colarb.s2 = a
  27887. },
  27888. acting: function () {
  27889. return this.active && 0 != (this.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT)
  27890. },
  27891. inactiveme: function () {
  27892. return !this.active
  27893. },
  27894. wrapper: function () {
  27895. null == this.outer && (c.dynamics.ZPP_Arbiter.internal = !0, this.type == c.dynamics.ZPP_Arbiter.COL ? (this.colarb.outer_zn = new h.dynamics.CollisionArbiter, this.outer = this.colarb.outer_zn) : this.type == c.dynamics.ZPP_Arbiter.FLUID ?
  27896. (this.fluidarb.outer_zn = new h.dynamics.FluidArbiter, this.outer = this.fluidarb.outer_zn) : this.outer = new h.dynamics.Arbiter, this.outer.zpp_inner = this, c.dynamics.ZPP_Arbiter.internal = !1);
  27897. return this.outer
  27898. },
  27899. __class__: c.dynamics.ZPP_Arbiter
  27900. };
  27901. c.dynamics.ZPP_SensorArbiter = function () {
  27902. this.next = null;
  27903. c.dynamics.ZPP_Arbiter.call(this);
  27904. this.type = c.dynamics.ZPP_Arbiter.SENSOR;
  27905. this.sensorarb = this
  27906. };
  27907. s["zpp_nape.dynamics.ZPP_SensorArbiter"] = c.dynamics.ZPP_SensorArbiter;
  27908. c.dynamics.ZPP_SensorArbiter.__name__ = ["zpp_nape",
  27909. "dynamics", "ZPP_SensorArbiter"
  27910. ];
  27911. c.dynamics.ZPP_SensorArbiter.__super__ = c.dynamics.ZPP_Arbiter;
  27912. c.dynamics.ZPP_SensorArbiter.prototype = I(c.dynamics.ZPP_Arbiter.prototype, {
  27913. makeimmutable: function () {},
  27914. makemutable: function () {},
  27915. retire: function () {
  27916. this.cleared || (this.b1.arbiters.inlined_try_remove(this), this.b2.arbiters.inlined_try_remove(this), null != this.pair && (this.pair = this.pair.arb = null));
  27917. this.b1 = this.b2 = null;
  27918. this.intchange = this.active = !1;
  27919. this.next = c.dynamics.ZPP_SensorArbiter.zpp_pool;
  27920. c.dynamics.ZPP_SensorArbiter.zpp_pool =
  27921. this
  27922. },
  27923. assign: function (a, b, d, c) {
  27924. this.b1 = a.body;
  27925. this.ws1 = a;
  27926. this.b2 = b.body;
  27927. this.ws2 = b;
  27928. this.id = d;
  27929. this.di = c;
  27930. this.b1.arbiters.inlined_add(this);
  27931. this.b2.arbiters.inlined_add(this);
  27932. this.active = !0;
  27933. this.present = 0;
  27934. this.presentable = this.fresh = this.sleeping = this.cleared = !1
  27935. },
  27936. free: function () {},
  27937. alloc: function () {},
  27938. __class__: c.dynamics.ZPP_SensorArbiter
  27939. });
  27940. c.dynamics.ZPP_FluidArbiter = function () {
  27941. this.pre_dt = 0;
  27942. this.mutable = !1;
  27943. this.wrap_position = null;
  27944. this.wMass = this.adamp = this.agamma = this.vMassa = this.vMassb = this.vMassc =
  27945. this.dampx = this.dampy = this.lgamma = this.nx = this.ny = this.buoyx = this.buoyy = 0;
  27946. this.nodrag = !1;
  27947. this.centroidx = this.centroidy = this.overlap = this.r1x = this.r1y = this.r2x = this.r2y = 0;
  27948. this.outer_zn = this.next = null;
  27949. c.dynamics.ZPP_Arbiter.call(this);
  27950. this.type = c.dynamics.ZPP_Arbiter.FLUID;
  27951. this.fluidarb = this;
  27952. this.buoyy = this.buoyx = 0;
  27953. this.pre_dt = -1
  27954. };
  27955. s["zpp_nape.dynamics.ZPP_FluidArbiter"] = c.dynamics.ZPP_FluidArbiter;
  27956. c.dynamics.ZPP_FluidArbiter.__name__ = ["zpp_nape", "dynamics", "ZPP_FluidArbiter"];
  27957. c.dynamics.ZPP_FluidArbiter.__super__ =
  27958. c.dynamics.ZPP_Arbiter;
  27959. c.dynamics.ZPP_FluidArbiter.prototype = I(c.dynamics.ZPP_Arbiter.prototype, {
  27960. applyImpulseVel: function () {
  27961. if (!this.nodrag) {
  27962. var a = this.b1.angvel + this.b1.kinangvel,
  27963. b = this.b2.angvel + this.b2.kinangvel,
  27964. d = this.b1.velx + this.b1.kinvelx - this.r1y * a - (this.b2.velx + this.b2.kinvelx - this.r2y * b),
  27965. c = this.b1.vely + this.b1.kinvely + this.r1x * a - (this.b2.vely + this.b2.kinvely + this.r2x * b),
  27966. e = this.vMassa * d + this.vMassb * c,
  27967. c = this.vMassb * d + this.vMassc * c,
  27968. d = e,
  27969. e = this.lgamma,
  27970. d = d - this.dampx * e,
  27971. c = c - this.dampy * e,
  27972. e = 1;
  27973. this.dampx +=
  27974. d * e;
  27975. this.dampy += c * e;
  27976. e = this.b1.imass;
  27977. this.b1.velx -= d * e;
  27978. this.b1.vely -= c * e;
  27979. e = this.b2.imass;
  27980. this.b2.velx += d * e;
  27981. this.b2.vely += c * e;
  27982. this.b1.angvel -= this.b1.iinertia * (c * this.r1x - d * this.r1y);
  27983. this.b2.angvel += this.b2.iinertia * (c * this.r2x - d * this.r2y);
  27984. a = (a - b) * this.wMass - this.adamp * this.agamma;
  27985. this.adamp += a;
  27986. this.b1.angvel -= a * this.b1.iinertia;
  27987. this.b2.angvel += a * this.b2.iinertia
  27988. }
  27989. },
  27990. warmStart: function () {
  27991. var a = this.b1.imass;
  27992. this.b1.velx -= this.dampx * a;
  27993. this.b1.vely -= this.dampy * a;
  27994. a = this.b2.imass;
  27995. this.b2.velx += this.dampx *
  27996. a;
  27997. this.b2.vely += this.dampy * a;
  27998. this.b1.angvel -= this.b1.iinertia * (this.dampy * this.r1x - this.dampx * this.r1y);
  27999. this.b2.angvel += this.b2.iinertia * (this.dampy * this.r2x - this.dampx * this.r2y);
  28000. this.b1.angvel -= this.adamp * this.b1.iinertia;
  28001. this.b2.angvel += this.adamp * this.b2.iinertia
  28002. },
  28003. preStep: function (a, b) {
  28004. -1 == this.pre_dt && (this.pre_dt = b);
  28005. var d = b / this.pre_dt;
  28006. this.pre_dt = b;
  28007. this.r1x = this.centroidx - this.b1.posx;
  28008. this.r1y = this.centroidy - this.b1.posy;
  28009. this.r2x = this.centroidx - this.b2.posx;
  28010. this.r2y = this.centroidy - this.b2.posy;
  28011. var g = 0,
  28012. e = 0;
  28013. this.ws1.fluidEnabled && null != this.ws1.fluidProperties.wrap_gravity ? (g = this.ws1.fluidProperties.gravityx, e = this.ws1.fluidProperties.gravityy) : (g = a.gravityx, e = a.gravityy);
  28014. var f = 0,
  28015. l = 0;
  28016. this.ws2.fluidEnabled && null != this.ws2.fluidProperties.wrap_gravity ? (f = this.ws2.fluidProperties.gravityx, l = this.ws2.fluidProperties.gravityy) : (f = a.gravityx, l = a.gravityy);
  28017. var m = 0,
  28018. u = 0;
  28019. if (this.ws1.fluidEnabled && this.ws2.fluidEnabled) {
  28020. var p = this.overlap * this.ws1.fluidProperties.density,
  28021. k = this.overlap * this.ws2.fluidProperties.density;
  28022. if (p > k) var r = p + k,
  28023. m = m - g * r,
  28024. u = u - e * r;
  28025. else if (p < k) r = p + k, m += f * r, u += l * r;
  28026. else {
  28027. var n = 0,
  28028. w = 0,
  28029. r = 0.5,
  28030. n = (g + f) * r,
  28031. w = (e + l) * r;
  28032. this.ws1.worldCOMx * n + this.ws1.worldCOMy * w > this.ws2.worldCOMx * n + this.ws2.worldCOMy * w ? (r = p + k, m -= n * r, u -= w * r) : (r = p + k, m += n * r, u += w * r)
  28033. }
  28034. } else this.ws1.fluidEnabled ? (r = this.overlap * this.ws1.fluidProperties.density, m -= g * r, u -= e * r) : this.ws2.fluidEnabled && (r = this.overlap * this.ws2.fluidProperties.density, m += f * r, u += l * r);
  28035. r = b;
  28036. m *= r;
  28037. u *= r;
  28038. this.buoyx = m;
  28039. this.buoyy = u;
  28040. this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC &&
  28041. (r = this.b1.imass, this.b1.velx -= m * r, this.b1.vely -= u * r, this.b1.angvel -= (u * this.r1x - m * this.r1y) * this.b1.iinertia);
  28042. this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (r = this.b2.imass, this.b2.velx += m * r, this.b2.vely += u * r, this.b2.angvel += (u * this.r2x - m * this.r2y) * this.b2.iinertia);
  28043. if (this.ws1.fluidEnabled && 0 != this.ws1.fluidProperties.viscosity || this.ws2.fluidEnabled && 0 != this.ws2.fluidProperties.viscosity) {
  28044. this.nodrag = !1;
  28045. var t = 0;
  28046. this.ws1.fluidEnabled && (this.ws2.validate_angDrag(), t += this.ws1.fluidProperties.viscosity *
  28047. this.ws2.angDrag * this.overlap / this.ws2.area);
  28048. this.ws2.fluidEnabled && (this.ws1.validate_angDrag(), t += this.ws2.fluidProperties.viscosity * this.ws1.angDrag * this.overlap / this.ws1.area);
  28049. 0 != t ? (r = this.b1.sinertia + this.b2.sinertia, this.wMass = 0 != r ? 1 / r : 0, t *= 4E-4, this.wMass *= function (a) {
  28050. var d = 2 * Math.PI * t;
  28051. a.agamma = 1 / (b * d * (2 + d * b));
  28052. d = 1 / (1 + a.agamma);
  28053. a.agamma *= d;
  28054. return d
  28055. }(this)) : this.agamma = this.wMass = 0;
  28056. g = this.b2.velx + this.b2.kinvelx - this.r2y * (this.b2.angvel + this.b2.kinangvel) - (this.b1.velx + this.b1.kinvelx - this.r1y *
  28057. (this.b2.angvel + this.b2.kinangvel));
  28058. e = this.b2.vely + this.b2.kinvely + this.r2x * (this.b2.angvel + this.b2.kinangvel) - (this.b1.vely + this.b1.kinvely + this.r1x * (this.b1.angvel + this.b1.kinangvel));
  28059. g * g + e * e < h.Config.epsilon * h.Config.epsilon || (r = 1 / Math.sqrt(g * g + e * e), this.nx = g * r, this.ny = e * r);
  28060. var q = 0;
  28061. if (this.ws1.fluidEnabled)
  28062. if (r = -this.ws1.fluidProperties.viscosity * this.overlap / this.ws2.area, this.ws2.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) q -= r * this.ws2.circle.radius * h.Config.fluidLinearDrag / (2 * this.ws2.circle.radius *
  28063. Math.PI);
  28064. else {
  28065. f = this.ws2.polygon;
  28066. e = g = 0;
  28067. for (f = f.edges.head; null != f;) l = f.elt, g += l.length, l = r * l.length * (l.gnormx * this.nx + l.gnormy * this.ny), 0 < l && (l = l *= -h.Config.fluidVacuumDrag), e -= 0.5 * l * h.Config.fluidLinearDrag, f = f.next;
  28068. q += e / g
  28069. }
  28070. if (this.ws2.fluidEnabled)
  28071. if (r = -this.ws2.fluidProperties.viscosity * this.overlap / this.ws1.area, this.ws1.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) q -= r * this.ws1.circle.radius * h.Config.fluidLinearDrag / (2 * this.ws1.circle.radius * Math.PI);
  28072. else {
  28073. f = this.ws1.polygon;
  28074. e = g = 0;
  28075. for (f = f.edges.head; null !=
  28076. f;) l = f.elt, g += l.length, l = r * l.length * (l.gnormx * this.nx + l.gnormy * this.ny), 0 < l && (l = l *= -h.Config.fluidVacuumDrag), e -= 0.5 * l * h.Config.fluidLinearDrag, f = f.next;
  28077. q += e / g
  28078. }
  28079. 0 != q ? (r = this.b1.smass + this.b2.smass, f = e = g = 0, g = r, e = 0, f = r, 0 != this.b1.sinertia && (r = this.r1x * this.b1.sinertia, l = this.r1y * this.b1.sinertia, g += l * this.r1y, e += -l * this.r1x, f += r * this.r1x), 0 != this.b2.sinertia && (r = this.r2x * this.b2.sinertia, l = this.r2y * this.b2.sinertia, g += l * this.r2y, e += -l * this.r2x, f += r * this.r2x), l = g * f - e * e, l != l ? (g = e = f = 0, 3) : 0 == l ? (r = 0, 0 != g ?
  28080. g = 1 / g : (g = 0, r |= 1), 0 != f ? f = 1 / f : (f = 0, r |= 2), e = 0, r) : (l = 1 / l, r = f * l, f = g * l, g = r, e *= -l, 0), this.vMassa = g, this.vMassb = e, this.vMassc = f, r = function (a) {
  28081. var d = 2 * Math.PI * q;
  28082. a.lgamma = 1 / (b * d * (2 + d * b));
  28083. d = 1 / (1 + a.lgamma);
  28084. a.lgamma *= d;
  28085. return d
  28086. }(this), this.vMassa *= r, this.vMassb *= r, this.vMassc *= r) : this.lgamma = this.vMassc = this.vMassb = this.vMassa = 0
  28087. } else this.nodrag = !0, this.adamp = this.dampy = this.dampx = 0;
  28088. r = d;
  28089. this.dampx *= r;
  28090. this.dampy *= r;
  28091. this.adamp *= d
  28092. },
  28093. inject: function (a, b, d) {
  28094. this.overlap = a;
  28095. this.centroidx = b;
  28096. this.centroidy = d
  28097. },
  28098. makeimmutable: function () {
  28099. this.mutable = !1;
  28100. null != this.wrap_position && (this.wrap_position.zpp_inner._immutable = !0)
  28101. },
  28102. makemutable: function () {
  28103. this.mutable = !0;
  28104. null != this.wrap_position && (this.wrap_position.zpp_inner._immutable = !1)
  28105. },
  28106. retire: function () {
  28107. this.cleared || (this.b1.arbiters.inlined_try_remove(this), this.b2.arbiters.inlined_try_remove(this), null != this.pair && (this.pair = this.pair.arb = null));
  28108. this.b1 = this.b2 = null;
  28109. this.intchange = this.active = !1;
  28110. this.next = c.dynamics.ZPP_FluidArbiter.zpp_pool;
  28111. c.dynamics.ZPP_FluidArbiter.zpp_pool = this;
  28112. this.pre_dt = -1
  28113. },
  28114. assign: function (a, b, d, c) {
  28115. this.b1 = a.body;
  28116. this.ws1 = a;
  28117. this.b2 = b.body;
  28118. this.ws2 = b;
  28119. this.id = d;
  28120. this.di = c;
  28121. this.b1.arbiters.inlined_add(this);
  28122. this.b2.arbiters.inlined_add(this);
  28123. this.active = !0;
  28124. this.present = 0;
  28125. this.presentable = this.fresh = this.sleeping = this.cleared = !1;
  28126. this.nx = 0;
  28127. this.ny = 1;
  28128. this.adamp = this.dampy = this.dampx = 0
  28129. },
  28130. getposition: function () {
  28131. this.wrap_position = h.geom.Vec2.get(null, null, null);
  28132. this.wrap_position.zpp_inner._inuse = !0;
  28133. this.wrap_position.zpp_inner._immutable = !this.mutable;
  28134. this.wrap_position.zpp_inner._validate =
  28135. A(this, this.position_validate);
  28136. this.wrap_position.zpp_inner._invalidate = A(this, this.position_invalidate)
  28137. },
  28138. position_invalidate: function (a) {
  28139. this.centroidx = a.x;
  28140. this.centroidy = a.y
  28141. },
  28142. position_validate: function () {
  28143. if (!this.active) throw "Error: Arbiter not currently in use";
  28144. this.wrap_position.zpp_inner.x = this.centroidx;
  28145. this.wrap_position.zpp_inner.y = this.centroidy
  28146. },
  28147. free: function () {},
  28148. alloc: function () {},
  28149. __class__: c.dynamics.ZPP_FluidArbiter
  28150. });
  28151. c.dynamics.ZPP_ColArbiter = function () {
  28152. this.pre_dt = 0;
  28153. this.stat = this.mutable = !1;
  28154. this.next = null;
  28155. this.hc2 = this.hpc2 = !1;
  28156. this.c1 = this.oc1 = this.c2 = this.oc2 = null;
  28157. this.__ref_vertex = 0;
  28158. this.__ref_edge1 = this.__ref_edge2 = null;
  28159. this.biasCoef = 0;
  28160. this.rev = !1;
  28161. this.kMassa = this.kMassb = this.kMassc = this.Ka = this.Kb = this.Kc = this.rMass = this.jrAcc = this.rn1a = this.rt1a = this.rn1b = this.rt1b = this.rn2a = this.rt2a = this.rn2b = this.rt2b = this.k1x = this.k1y = this.k2x = this.k2y = this.surfacex = this.surfacey = this.lnormx = this.lnormy = this.lproj = this.radius = 0;
  28162. this.wrap_normal = null;
  28163. this.nx = this.ny = 0;
  28164. this.s1 = this.s2 = this.contacts =
  28165. this.wrap_contacts = this.innards = null;
  28166. this.userdef_dyn_fric = this.userdef_stat_fric = this.userdef_restitution = this.userdef_rfric = !1;
  28167. this.dyn_fric = this.stat_fric = this.restitution = this.rfric = 0;
  28168. this.outer_zn = null;
  28169. c.dynamics.ZPP_Arbiter.call(this);
  28170. this.pre_dt = -1;
  28171. this.contacts = new c.dynamics.ZPP_Contact;
  28172. this.innards = new c.dynamics.ZPP_IContact;
  28173. this.type = c.dynamics.ZPP_Arbiter.COL;
  28174. this.colarb = this
  28175. };
  28176. s["zpp_nape.dynamics.ZPP_ColArbiter"] = c.dynamics.ZPP_ColArbiter;
  28177. c.dynamics.ZPP_ColArbiter.__name__ = ["zpp_nape",
  28178. "dynamics", "ZPP_ColArbiter"
  28179. ];
  28180. c.dynamics.ZPP_ColArbiter.__super__ = c.dynamics.ZPP_Arbiter;
  28181. c.dynamics.ZPP_ColArbiter.prototype = I(c.dynamics.ZPP_Arbiter.prototype, {
  28182. applyImpulsePos: function () {
  28183. if (2 == this.ptype) {
  28184. var a = this.c1,
  28185. b = 0,
  28186. d = 0,
  28187. b = this.b2.axisy * a.lr2x - this.b2.axisx * a.lr2y,
  28188. d = a.lr2x * this.b2.axisx + a.lr2y * this.b2.axisy,
  28189. c = 1,
  28190. b = b + this.b2.posx * c,
  28191. d = d + this.b2.posy * c,
  28192. e = 0,
  28193. f = 0,
  28194. e = this.b1.axisy * a.lr1x - this.b1.axisx * a.lr1y,
  28195. f = a.lr1x * this.b1.axisx + a.lr1y * this.b1.axisy,
  28196. c = 1,
  28197. e = e + this.b1.posx * c,
  28198. f = f + this.b1.posy * c,
  28199. l = a = 0,
  28200. a = b - e,
  28201. l = d - f,
  28202. m = Math.sqrt(a * a + l * l),
  28203. u = this.radius - h.Config.collisionSlop,
  28204. c = m - u;
  28205. 0 > a * this.nx + l * this.ny && (a = -a, l = -l, c -= this.radius);
  28206. 0 > c && (m < h.Config.epsilon ? 0 != this.b1.smass ? this.b1.posx += 10 * h.Config.epsilon : this.b2.posx += 10 * h.Config.epsilon : (c = 1 / m, a *= c, l *= c, c = 0.5 * (e + b), d = 0.5 * (f + d), e = c - this.b1.posx, f = d - this.b1.posy, b = c - this.b2.posx, d -= this.b2.posy, e = l * e - a * f, b = l * b - a * d, d = this.b2.smass + b * b * this.b2.sinertia + this.b1.smass + e * e * this.b1.sinertia, 0 != d && (m = -this.biasCoef * (m - u) / d, d = u = 0, c = m, u = a * c, d = l * c, c = this.b1.imass,
  28207. this.b1.posx -= u * c, this.b1.posy -= d * c, this.b1.delta_rot(-e * this.b1.iinertia * m), c = this.b2.imass, this.b2.posx += u * c, this.b2.posy += d * c, this.b2.delta_rot(b * this.b2.iinertia * m))))
  28208. } else {
  28209. var p = f = a = l = 0,
  28210. u = m = 0;
  28211. 0 == this.ptype ? (l = this.b1.axisy * this.lnormx - this.b1.axisx * this.lnormy, a = this.lnormx * this.b1.axisx + this.lnormy * this.b1.axisy, b = this.lproj + (l * this.b1.posx + a * this.b1.posy), f = this.b2.axisy * this.c1.lr1x - this.b2.axisx * this.c1.lr1y, p = this.c1.lr1x * this.b2.axisx + this.c1.lr1y * this.b2.axisy, c = 1, f += this.b2.posx * c, p +=
  28212. this.b2.posy * c, this.hpc2 && (m = this.b2.axisy * this.c2.lr1x - this.b2.axisx * this.c2.lr1y, u = this.c2.lr1x * this.b2.axisx + this.c2.lr1y * this.b2.axisy, c = 1, m += this.b2.posx * c, u += this.b2.posy * c)) : (l = this.b2.axisy * this.lnormx - this.b2.axisx * this.lnormy, a = this.lnormx * this.b2.axisx + this.lnormy * this.b2.axisy, b = this.lproj + (l * this.b2.posx + a * this.b2.posy), f = this.b1.axisy * this.c1.lr1x - this.b1.axisx * this.c1.lr1y, p = this.c1.lr1x * this.b1.axisx + this.c1.lr1y * this.b1.axisy, c = 1, f += this.b1.posx * c, p += this.b1.posy * c, this.hpc2 && (m =
  28213. this.b1.axisy * this.c2.lr1x - this.b1.axisx * this.c2.lr1y, u = this.c2.lr1x * this.b1.axisx + this.c2.lr1y * this.b1.axisy, c = 1, m += this.b1.posx * c, u += this.b1.posy * c));
  28214. c = f * l + p * a - b - this.radius;
  28215. c += h.Config.collisionSlop;
  28216. e = 0;
  28217. this.hpc2 && (e = m * l + u * a - b - this.radius, e += h.Config.collisionSlop);
  28218. if (0 > c || 0 > e) {
  28219. this.rev && (l = -l, a = -a);
  28220. var k = 0,
  28221. r = 0,
  28222. k = f - this.b1.posx,
  28223. r = p - this.b1.posy,
  28224. d = b = 0,
  28225. b = f - this.b2.posx,
  28226. d = p - this.b2.posy,
  28227. n = 0,
  28228. w = 0,
  28229. p = f = 0;
  28230. if (this.hpc2) {
  28231. n = m - this.b1.posx;
  28232. w = u - this.b1.posy;
  28233. f = m - this.b2.posx;
  28234. p = u - this.b2.posy;
  28235. m = a * k - l * r;
  28236. u = a * b -
  28237. l * d;
  28238. b = a * n - l * w;
  28239. d = a * f - l * p;
  28240. f = this.b1.smass + this.b2.smass;
  28241. this.kMassa = f + this.b1.sinertia * m * m + this.b2.sinertia * u * u;
  28242. this.kMassb = f + this.b1.sinertia * m * b + this.b2.sinertia * u * d;
  28243. this.kMassc = f + this.b1.sinertia * b * b + this.b2.sinertia * d * d;
  28244. var p = f = k = 0,
  28245. k = this.kMassa,
  28246. f = this.kMassb,
  28247. p = this.kMassc,
  28248. r = c * this.biasCoef,
  28249. w = e * this.biasCoef,
  28250. n = e = 0,
  28251. e = -r,
  28252. n = -w,
  28253. t = this.kMassa * this.kMassc - this.kMassb * this.kMassb;
  28254. t != t ? e = n = 0 : 0 == t ? (e = 0 != this.kMassa ? e / this.kMassa : 0, n = 0 != this.kMassc ? n / this.kMassc : 0) : (t = 1 / t, c = t * (this.kMassc * e - this.kMassb * n),
  28255. n = t * (this.kMassa * n - this.kMassb * e), e = c);
  28256. 0 <= e && 0 <= n ? (c = (e + n) * this.b1.imass, this.b1.posx -= l * c, this.b1.posy -= a * c, this.b1.delta_rot(-this.b1.iinertia * (m * e + b * n)), c = (e + n) * this.b2.imass, this.b2.posx += l * c, this.b2.posy += a * c, this.b2.delta_rot(this.b2.iinertia * (u * e + d * n))) : (e = -r / k, n = 0, c = f * e + w, 0 <= e && 0 <= c ? (c = (e + n) * this.b1.imass, this.b1.posx -= l * c, this.b1.posy -= a * c, this.b1.delta_rot(-this.b1.iinertia * (m * e + b * n)), c = (e + n) * this.b2.imass, this.b2.posx += l * c, this.b2.posy += a * c, this.b2.delta_rot(this.b2.iinertia * (u * e + d * n))) :
  28257. (e = 0, n = -w / p, c = f * n + r, 0 <= n && 0 <= c && (c = (e + n) * this.b1.imass, this.b1.posx -= l * c, this.b1.posy -= a * c, this.b1.delta_rot(-this.b1.iinertia * (m * e + b * n)), c = (e + n) * this.b2.imass, this.b2.posx += l * c, this.b2.posy += a * c, this.b2.delta_rot(this.b2.iinertia * (u * e + d * n)))))
  28258. } else e = a * k - l * r, b = a * b - l * d, d = this.b2.smass + b * b * this.b2.sinertia + this.b1.smass + e * e * this.b1.sinertia, 0 != d && (c = m = -this.biasCoef * c / d, u = l * c, d = a * c, c = this.b1.imass, this.b1.posx -= u * c, this.b1.posy -= d * c, this.b1.delta_rot(-e * this.b1.iinertia * m), c = this.b2.imass, this.b2.posx +=
  28259. u * c, this.b2.posy += d * c, this.b2.delta_rot(b * this.b2.iinertia * m))
  28260. }
  28261. }
  28262. },
  28263. applyImpulseVel: function () {
  28264. var a, b, d, c, e;
  28265. c = this.k1x + this.b2.velx - this.c1.r2y * this.b2.angvel - (this.b1.velx - this.c1.r1y * this.b1.angvel);
  28266. var f = this.k1y + this.b2.vely + this.c1.r2x * this.b2.angvel - (this.b1.vely + this.c1.r1x * this.b1.angvel);
  28267. d = (f * this.nx - c * this.ny + this.surfacex) * this.c1.tMass;
  28268. c = this.c1.friction * this.c1.jnAcc;
  28269. a = this.c1.jtAcc;
  28270. e = a - d;
  28271. e > c ? e = c : e < -c && (e = -c);
  28272. d = e - a;
  28273. this.c1.jtAcc = e;
  28274. a = -this.ny * d;
  28275. b = this.nx * d;
  28276. this.b2.velx += a * this.b2.imass;
  28277. this.b2.vely += b * this.b2.imass;
  28278. this.b1.velx -= a * this.b1.imass;
  28279. this.b1.vely -= b * this.b1.imass;
  28280. this.b2.angvel += this.rt1b * d * this.b2.iinertia;
  28281. this.b1.angvel -= this.rt1a * d * this.b1.iinertia;
  28282. this.hc2 ? (e = this.k2x + this.b2.velx - this.c2.r2y * this.b2.angvel - (this.b1.velx - this.c2.r1y * this.b1.angvel), b = this.k2y + this.b2.vely + this.c2.r2x * this.b2.angvel - (this.b1.vely + this.c2.r1x * this.b1.angvel), d = (b * this.nx - e * this.ny + this.surfacex) * this.c2.tMass, c = this.c2.friction * this.c2.jnAcc, a = this.c2.jtAcc, e = a - d, e > c ? e = c : e < -c && (e = -c),
  28283. d = e - a, this.c2.jtAcc = e, a = -this.ny * d, b = this.nx * d, this.b2.velx += a * this.b2.imass, this.b2.vely += b * this.b2.imass, this.b1.velx -= a * this.b1.imass, this.b1.vely -= b * this.b1.imass, this.b2.angvel += this.rt2b * d * this.b2.iinertia, this.b1.angvel -= this.rt2a * d * this.b1.iinertia, c = this.k1x + this.b2.velx - this.c1.r2y * this.b2.angvel - (this.b1.velx - this.c1.r1y * this.b1.angvel), f = this.k1y + this.b2.vely + this.c1.r2x * this.b2.angvel - (this.b1.vely + this.c1.r1x * this.b1.angvel), e = this.k2x + this.b2.velx - this.c2.r2y * this.b2.angvel - (this.b1.velx -
  28284. this.c2.r1y * this.b1.angvel), b = this.k2y + this.b2.vely + this.c2.r2x * this.b2.angvel - (this.b1.vely + this.c2.r1x * this.b1.angvel), d = this.c1.jnAcc, a = this.c2.jnAcc, c = c * this.nx + f * this.ny + this.surfacey + this.c1.bounce - (this.Ka * d + this.Kb * a), e = e * this.nx + b * this.ny + this.surfacey + this.c2.bounce - (this.Kb * d + this.Kc * a), b = -(this.kMassa * c + this.kMassb * e), f = -(this.kMassb * c + this.kMassc * e), 0 <= b && 0 <= f ? (c = b - d, e = f - a, this.c1.jnAcc = b, this.c2.jnAcc = f) : (b = -this.c1.nMass * c, 0 <= b && 0 <= this.Kb * b + e ? (c = b - d, e = -a, this.c1.jnAcc = b, this.c2.jnAcc =
  28285. 0) : (f = -this.c2.nMass * e, 0 <= f && 0 <= this.Kb * f + c ? (c = -d, e = f - a, this.c1.jnAcc = 0, this.c2.jnAcc = f) : 0 <= c && 0 <= e ? (c = -d, e = -a, this.c1.jnAcc = this.c2.jnAcc = 0) : e = c = 0)), d = c + e, a = this.nx * d, b = this.ny * d, this.b2.velx += a * this.b2.imass, this.b2.vely += b * this.b2.imass, this.b1.velx -= a * this.b1.imass, this.b1.vely -= b * this.b1.imass, this.b2.angvel += (this.rn1b * c + this.rn2b * e) * this.b2.iinertia, this.b1.angvel -= (this.rn1a * c + this.rn2a * e) * this.b1.iinertia) : (0 != this.radius && (d = (this.b2.angvel - this.b1.angvel) * this.rMass, c = this.rfric * this.c1.jnAcc,
  28286. a = this.jrAcc, this.jrAcc -= d, this.jrAcc > c ? this.jrAcc = c : this.jrAcc < -c && (this.jrAcc = -c), d = this.jrAcc - a, this.b2.angvel += d * this.b2.iinertia, this.b1.angvel -= d * this.b1.iinertia), c = this.k1x + this.b2.velx - this.c1.r2y * this.b2.angvel - (this.b1.velx - this.c1.r1y * this.b1.angvel), f = this.k1y + this.b2.vely + this.c1.r2x * this.b2.angvel - (this.b1.vely + this.c1.r1x * this.b1.angvel), d = (this.c1.bounce + (this.nx * c + this.ny * f) + this.surfacey) * this.c1.nMass, a = this.c1.jnAcc, e = a - d, 0 > e && (e = 0), d = e - a, this.c1.jnAcc = e, a = this.nx * d, b = this.ny *
  28287. d, this.b2.velx += a * this.b2.imass, this.b2.vely += b * this.b2.imass, this.b1.velx -= a * this.b1.imass, this.b1.vely -= b * this.b1.imass, this.b2.angvel += this.rn1b * d * this.b2.iinertia, this.b1.angvel -= this.rn1a * d * this.b1.iinertia)
  28288. },
  28289. warmStart: function () {
  28290. var a = this.nx * this.c1.jnAcc - this.ny * this.c1.jtAcc,
  28291. b = this.ny * this.c1.jnAcc + this.nx * this.c1.jtAcc,
  28292. d = this.b1.imass;
  28293. this.b1.velx -= a * d;
  28294. this.b1.vely -= b * d;
  28295. this.b1.angvel -= this.b1.iinertia * (b * this.c1.r1x - a * this.c1.r1y);
  28296. d = this.b2.imass;
  28297. this.b2.velx += a * d;
  28298. this.b2.vely += b * d;
  28299. this.b2.angvel +=
  28300. this.b2.iinertia * (b * this.c1.r2x - a * this.c1.r2y);
  28301. this.hc2 && (a = this.nx * this.c2.jnAcc - this.ny * this.c2.jtAcc, b = this.ny * this.c2.jnAcc + this.nx * this.c2.jtAcc, d = this.b1.imass, this.b1.velx -= a * d, this.b1.vely -= b * d, this.b1.angvel -= this.b1.iinertia * (b * this.c2.r1x - a * this.c2.r1y), d = this.b2.imass, this.b2.velx += a * d, this.b2.vely += b * d, this.b2.angvel += this.b2.iinertia * (b * this.c2.r2x - a * this.c2.r2y));
  28302. this.b2.angvel += this.jrAcc * this.b2.iinertia;
  28303. this.b1.angvel -= this.jrAcc * this.b1.iinertia
  28304. },
  28305. preStep: function (a) {
  28306. this.invalidated &&
  28307. (this.invalidated = !1, this.userdef_restitution || (this.restitution = this.s1.material.elasticity <= Math.NEGATIVE_INFINITY || this.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : this.s1.material.elasticity >= Math.POSITIVE_INFINITY || this.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (this.s1.material.elasticity + this.s2.material.elasticity) / 2, 0 > this.restitution && (this.restitution = 0), 1 < this.restitution && (this.restitution = 1)), this.userdef_dyn_fric || (this.dyn_fric = Math.sqrt(this.s1.material.dynamicFriction *
  28308. this.s2.material.dynamicFriction)), this.userdef_stat_fric || (this.stat_fric = Math.sqrt(this.s1.material.staticFriction * this.s2.material.staticFriction)), this.userdef_rfric || (this.rfric = Math.sqrt(this.s1.material.rollingFriction * this.s2.material.rollingFriction))); - 1 == this.pre_dt && (this.pre_dt = a);
  28309. var b = a / this.pre_dt;
  28310. this.pre_dt = a;
  28311. var d = this.b1.smass + this.b2.smass;
  28312. this.hc2 = !1;
  28313. a = !0;
  28314. this.biasCoef = this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC ? this.continuous ?
  28315. h.Config.contactContinuousStaticBiasCoef : h.Config.contactStaticBiasCoef : this.continuous ? h.Config.contactContinuousBiasCoef : h.Config.contactBiasCoef;
  28316. this.continuous = !1;
  28317. for (var g = null, e = null, f = this.innards.next, l = this.contacts.next; null != l;) {
  28318. var m = l;
  28319. if (m.stamp + h.Config.arbiterExpirationDelay < this.stamp) l = this.contacts.inlined_erase(g), f = this.innards.inlined_erase(e), m.arbiter = null, m.next = c.dynamics.ZPP_Contact.zpp_pool, c.dynamics.ZPP_Contact.zpp_pool = m;
  28320. else {
  28321. g = m.inner;
  28322. e = m.active;
  28323. m.active = m.stamp == this.stamp;
  28324. if (m.active) {
  28325. a ? (a = !1, this.c1 = g, this.oc1 = m) : (this.hc2 = !0, this.c2 = g, this.oc2 = m);
  28326. g.r2x = m.px - this.b2.posx;
  28327. g.r2y = m.py - this.b2.posy;
  28328. g.r1x = m.px - this.b1.posx;
  28329. g.r1y = m.py - this.b1.posy;
  28330. var u = d + this.b2.sinertia * c.util.ZPP_Math.sqr(g.r2x * this.nx + g.r2y * this.ny),
  28331. u = u + this.b1.sinertia * c.util.ZPP_Math.sqr(g.r1x * this.nx + g.r1y * this.ny);
  28332. g.tMass = u < h.Config.epsilon * h.Config.epsilon ? 0 : 1 / u;
  28333. u = d + this.b2.sinertia * c.util.ZPP_Math.sqr(this.ny * g.r2x - this.nx * g.r2y);
  28334. u += this.b1.sinertia * c.util.ZPP_Math.sqr(this.ny * g.r1x - this.nx * g.r1y);
  28335. g.nMass = u < h.Config.epsilon * h.Config.epsilon ? 0 : 1 / u;
  28336. var p = u = 0,
  28337. k = this.b2.angvel + this.b2.kinangvel,
  28338. u = this.b2.velx + this.b2.kinvelx - g.r2y * k,
  28339. p = this.b2.vely + this.b2.kinvely + g.r2x * k,
  28340. k = this.b1.angvel + this.b1.kinangvel,
  28341. u = u - (this.b1.velx + this.b1.kinvelx - g.r1y * k),
  28342. p = p - (this.b1.vely + this.b1.kinvely + g.r1x * k),
  28343. k = this.nx * u + this.ny * p;
  28344. m.elasticity = this.restitution;
  28345. g.bounce = k * m.elasticity;
  28346. g.bounce > -h.Config.elasticThreshold && (g.bounce = 0);
  28347. k = p * this.nx - u * this.ny;
  28348. u = h.Config.staticFrictionThreshold;
  28349. g.friction = k * k > u * u ? this.dyn_fric :
  28350. this.stat_fric;
  28351. g.jnAcc *= b;
  28352. g.jtAcc *= b
  28353. }
  28354. e != m.active && (this.contacts.modified = !0);
  28355. g = l;
  28356. e = f;
  28357. f = f.next;
  28358. l = l.next
  28359. }
  28360. }
  28361. this.hc2 ? (this.hpc2 = !0, this.oc1.posOnly ? (f = this.c1, this.c1 = this.c2, this.c2 = f, f = this.oc1, this.oc1 = this.oc2, this.oc2 = f, this.hc2 = !1) : this.oc2.posOnly && (this.hc2 = !1), this.oc1.posOnly && (a = !0)) : this.hpc2 = !1;
  28362. this.jrAcc *= b;
  28363. a || (this.rn1a = this.ny * this.c1.r1x - this.nx * this.c1.r1y, this.rt1a = this.c1.r1x * this.nx + this.c1.r1y * this.ny, this.rn1b = this.ny * this.c1.r2x - this.nx * this.c1.r2y, this.rt1b = this.c1.r2x * this.nx +
  28364. this.c1.r2y * this.ny, this.k1x = this.b2.kinvelx - this.c1.r2y * this.b2.kinangvel - (this.b1.kinvelx - this.c1.r1y * this.b1.kinangvel), this.k1y = this.b2.kinvely + this.c1.r2x * this.b2.kinangvel - (this.b1.kinvely + this.c1.r1x * this.b1.kinangvel));
  28365. this.hc2 && (this.rn2a = this.ny * this.c2.r1x - this.nx * this.c2.r1y, this.rt2a = this.c2.r1x * this.nx + this.c2.r1y * this.ny, this.rn2b = this.ny * this.c2.r2x - this.nx * this.c2.r2y, this.rt2b = this.c2.r2x * this.nx + this.c2.r2y * this.ny, this.k2x = this.b2.kinvelx - this.c2.r2y * this.b2.kinangvel - (this.b1.kinvelx -
  28366. this.c2.r1y * this.b1.kinangvel), this.k2y = this.b2.kinvely + this.c2.r2x * this.b2.kinangvel - (this.b1.kinvely + this.c2.r1x * this.b1.kinangvel), this.kMassa = d + this.b1.sinertia * this.rn1a * this.rn1a + this.b2.sinertia * this.rn1b * this.rn1b, this.kMassb = d + this.b1.sinertia * this.rn1a * this.rn2a + this.b2.sinertia * this.rn1b * this.rn2b, this.kMassc = d + this.b1.sinertia * this.rn2a * this.rn2a + this.b2.sinertia * this.rn2b * this.rn2b, this.kMassa * this.kMassa + 2 * this.kMassb * this.kMassb + this.kMassc * this.kMassc < h.Config.illConditionedThreshold *
  28367. (this.kMassa * this.kMassc - this.kMassb * this.kMassb) ? (this.Ka = this.kMassa, this.Kb = this.kMassb, this.Kc = this.kMassc, b = this.kMassa * this.kMassc - this.kMassb * this.kMassb, b != b ? (this.kMassa = this.kMassb = this.kMassc = 0, 3) : 0 == b ? (b = 0, 0 != this.kMassa ? this.kMassa = 1 / this.kMassa : (this.kMassa = 0, b |= 1), 0 != this.kMassc ? this.kMassc = 1 / this.kMassc : (this.kMassc = 0, b |= 2), this.kMassb = 0, b) : (b = 1 / b, d = this.kMassc * b, this.kMassc = this.kMassa * b, this.kMassa = d, this.kMassb *= -b, 0)) : (this.hc2 = !1, this.oc2.dist < this.oc1.dist && (d = this.c1, this.c1 =
  28368. this.c2, this.c2 = d), this.oc2.active = !1, this.contacts.modified = !0));
  28369. this.surfacex = this.b2.svelx;
  28370. this.surfacey = this.b2.svely;
  28371. d = 1;
  28372. this.surfacex += this.b1.svelx * d;
  28373. this.surfacey += this.b1.svely * d;
  28374. this.surfacex = -this.surfacex;
  28375. this.surfacey = -this.surfacey;
  28376. this.rMass = this.b1.sinertia + this.b2.sinertia;
  28377. 0 != this.rMass && (this.rMass = 1 / this.rMass);
  28378. return a
  28379. },
  28380. cleanupContacts: function () {
  28381. var a = !0,
  28382. b = null,
  28383. d = null,
  28384. g = this.innards.next;
  28385. this.hc2 = !1;
  28386. for (var e = this.contacts.next; null != e;) {
  28387. var f = e;
  28388. f.stamp + h.Config.arbiterExpirationDelay <
  28389. this.stamp ? (e = this.contacts.inlined_erase(b), g = this.innards.inlined_erase(d), f.arbiter = null, f.next = c.dynamics.ZPP_Contact.zpp_pool, c.dynamics.ZPP_Contact.zpp_pool = f) : (b = f.inner, d = f.active, f.active = f.stamp == this.stamp, f.active && (a ? (a = !1, this.c1 = b, this.oc1 = f) : (this.hc2 = !0, this.c2 = b, this.oc2 = f)), d != f.active && (this.contacts.modified = !0), b = e, d = g, g = g.next, e = e.next)
  28390. }
  28391. this.hc2 ? (this.hpc2 = !0, this.oc1.posOnly ? (g = this.c1, this.c1 = this.c2, this.c2 = g, g = this.oc1, this.oc1 = this.oc2, this.oc2 = g, this.hc2 = !1) : this.oc2.posOnly &&
  28392. (this.hc2 = !1), this.oc1.posOnly && (a = !0)) : this.hpc2 = !1;
  28393. return a
  28394. },
  28395. setupcontacts: function () {
  28396. this.wrap_contacts = c.util.ZPP_ContactList.get(this.contacts, !0);
  28397. this.wrap_contacts.zpp_inner.immutable = !this.mutable;
  28398. this.wrap_contacts.zpp_inner.adder = A(this, this.contacts_adder);
  28399. this.wrap_contacts.zpp_inner.dontremove = !0;
  28400. this.wrap_contacts.zpp_inner.subber = A(this, this.contacts_subber)
  28401. },
  28402. contacts_subber: function (a) {
  28403. for (var b = null, d = null, g = this.innards.next, e = this.contacts.next; null != e;) {
  28404. var f = e;
  28405. if (f == a.zpp_inner) {
  28406. this.contacts.erase(b);
  28407. this.innards.erase(d);
  28408. a = f;
  28409. a.arbiter = null;
  28410. a.next = c.dynamics.ZPP_Contact.zpp_pool;
  28411. c.dynamics.ZPP_Contact.zpp_pool = a;
  28412. break
  28413. }
  28414. b = e;
  28415. d = g;
  28416. g = g.next;
  28417. e = e.next
  28418. }
  28419. },
  28420. contacts_adder: function (a) {
  28421. throw "Error: Cannot add new contacts, information required is far too specific and detailed :)";
  28422. },
  28423. makeimmutable: function () {
  28424. this.mutable = !1;
  28425. null != this.wrap_normal && (this.wrap_normal.zpp_inner._immutable = !0);
  28426. null != this.wrap_contacts && (this.wrap_contacts.zpp_inner.immutable = !0)
  28427. },
  28428. makemutable: function () {
  28429. this.mutable = !0;
  28430. null != this.wrap_normal &&
  28431. (this.wrap_normal.zpp_inner._immutable = !1);
  28432. null != this.wrap_contacts && (this.wrap_contacts.zpp_inner.immutable = !1)
  28433. },
  28434. retire: function () {
  28435. this.cleared || (this.b1.arbiters.inlined_try_remove(this), this.b2.arbiters.inlined_try_remove(this), null != this.pair && (this.pair = this.pair.arb = null));
  28436. this.b1 = this.b2 = null;
  28437. for (this.intchange = this.active = !1; null != this.contacts.next;) {
  28438. var a = this.contacts.inlined_pop_unsafe();
  28439. a.arbiter = null;
  28440. a.next = c.dynamics.ZPP_Contact.zpp_pool;
  28441. c.dynamics.ZPP_Contact.zpp_pool = a;
  28442. this.innards.inlined_pop()
  28443. }
  28444. a =
  28445. this;
  28446. a.userdef_dyn_fric = !1;
  28447. a.userdef_stat_fric = !1;
  28448. a.userdef_restitution = !1;
  28449. a.userdef_rfric = !1;
  28450. a.__ref_edge1 = a.__ref_edge2 = null;
  28451. a.next = c.dynamics.ZPP_ColArbiter.zpp_pool;
  28452. c.dynamics.ZPP_ColArbiter.zpp_pool = a;
  28453. this.pre_dt = -1
  28454. },
  28455. validate_props: function () {
  28456. this.invalidated && (this.invalidated = !1, this.userdef_restitution || (this.restitution = this.s1.material.elasticity <= Math.NEGATIVE_INFINITY || this.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : this.s1.material.elasticity >= Math.POSITIVE_INFINITY || this.s2.material.elasticity >=
  28457. Math.POSITIVE_INFINITY ? 1 : (this.s1.material.elasticity + this.s2.material.elasticity) / 2, 0 > this.restitution && (this.restitution = 0), 1 < this.restitution && (this.restitution = 1)), this.userdef_dyn_fric || (this.dyn_fric = Math.sqrt(this.s1.material.dynamicFriction * this.s2.material.dynamicFriction)), this.userdef_stat_fric || (this.stat_fric = Math.sqrt(this.s1.material.staticFriction * this.s2.material.staticFriction)), this.userdef_rfric || (this.rfric = Math.sqrt(this.s1.material.rollingFriction * this.s2.material.rollingFriction)))
  28458. },
  28459. calcProperties: function () {
  28460. this.userdef_restitution || (this.restitution = this.s1.material.elasticity <= Math.NEGATIVE_INFINITY || this.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : this.s1.material.elasticity >= Math.POSITIVE_INFINITY || this.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (this.s1.material.elasticity + this.s2.material.elasticity) / 2, 0 > this.restitution && (this.restitution = 0), 1 < this.restitution && (this.restitution = 1));
  28461. this.userdef_dyn_fric || (this.dyn_fric = Math.sqrt(this.s1.material.dynamicFriction *
  28462. this.s2.material.dynamicFriction));
  28463. this.userdef_stat_fric || (this.stat_fric = Math.sqrt(this.s1.material.staticFriction * this.s2.material.staticFriction));
  28464. this.userdef_rfric || (this.rfric = Math.sqrt(this.s1.material.rollingFriction * this.s2.material.rollingFriction))
  28465. },
  28466. assign: function (a, b, d, c) {
  28467. this.b1 = a.body;
  28468. this.ws1 = a;
  28469. this.b2 = b.body;
  28470. this.ws2 = b;
  28471. this.id = d;
  28472. this.di = c;
  28473. this.b1.arbiters.inlined_add(this);
  28474. this.b2.arbiters.inlined_add(this);
  28475. this.active = !0;
  28476. this.present = 0;
  28477. this.presentable = this.fresh = this.sleeping =
  28478. this.cleared = !1;
  28479. this.s1 = a;
  28480. this.s2 = b;
  28481. this.userdef_restitution || (this.restitution = this.s1.material.elasticity <= Math.NEGATIVE_INFINITY || this.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : this.s1.material.elasticity >= Math.POSITIVE_INFINITY || this.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (this.s1.material.elasticity + this.s2.material.elasticity) / 2, 0 > this.restitution && (this.restitution = 0), 1 < this.restitution && (this.restitution = 1));
  28482. this.userdef_dyn_fric || (this.dyn_fric = Math.sqrt(this.s1.material.dynamicFriction *
  28483. this.s2.material.dynamicFriction));
  28484. this.userdef_stat_fric || (this.stat_fric = Math.sqrt(this.s1.material.staticFriction * this.s2.material.staticFriction));
  28485. this.userdef_rfric || (this.rfric = Math.sqrt(this.s1.material.rollingFriction * this.s2.material.rollingFriction))
  28486. },
  28487. injectContact: function (a, b, d, g, e, f, l) {
  28488. null == l && (l = !1);
  28489. for (var m = null, h = this.contacts.next; null != h;) {
  28490. var p = h;
  28491. if (f == p.hash) {
  28492. m = p;
  28493. break
  28494. }
  28495. h = h.next
  28496. }
  28497. null == m ? (null == c.dynamics.ZPP_Contact.zpp_pool ? m = new c.dynamics.ZPP_Contact : (m = c.dynamics.ZPP_Contact.zpp_pool,
  28498. c.dynamics.ZPP_Contact.zpp_pool = m.next, m.next = null), null, h = m.inner, h.jnAcc = h.jtAcc = 0, m.hash = f, m.fresh = !0, m.arbiter = this, this.jrAcc = 0, this.contacts.inlined_add(m), this.innards.add(h)) : m.fresh = !1;
  28499. m.px = a;
  28500. m.py = b;
  28501. this.nx = d;
  28502. this.ny = g;
  28503. m.dist = e;
  28504. m.stamp = this.stamp;
  28505. m.posOnly = l;
  28506. return m
  28507. },
  28508. free: function () {
  28509. this.userdef_rfric = this.userdef_restitution = this.userdef_stat_fric = this.userdef_dyn_fric = !1;
  28510. this.__ref_edge1 = this.__ref_edge2 = null
  28511. },
  28512. alloc: function () {},
  28513. getnormal: function () {
  28514. this.wrap_normal = h.geom.Vec2.get(0,
  28515. 0, null);
  28516. this.wrap_normal.zpp_inner._immutable = !0;
  28517. this.wrap_normal.zpp_inner._inuse = !0;
  28518. this.wrap_normal.zpp_inner._validate = A(this, this.normal_validate)
  28519. },
  28520. normal_validate: function () {
  28521. if (this.cleared) throw "Error: Arbiter not currently in use";
  28522. this.wrap_normal.zpp_inner.x = this.nx;
  28523. this.wrap_normal.zpp_inner.y = this.ny
  28524. },
  28525. __class__: c.dynamics.ZPP_ColArbiter
  28526. });
  28527. c.dynamics.ZPP_Contact = function () {
  28528. this.length = 0;
  28529. this._inuse = this.modified = this.pushmod = !1;
  28530. this.next = null;
  28531. this.dist = this.elasticity = 0;
  28532. this.fresh = !1;
  28533. this.stamp =
  28534. this.hash = 0;
  28535. this.active = this.posOnly = !1;
  28536. this.wrap_position = this.arbiter = this.inner = null;
  28537. this.px = this.py = 0;
  28538. this.outer = null;
  28539. this.inner = new c.dynamics.ZPP_IContact
  28540. };
  28541. s["zpp_nape.dynamics.ZPP_Contact"] = c.dynamics.ZPP_Contact;
  28542. c.dynamics.ZPP_Contact.__name__ = ["zpp_nape", "dynamics", "ZPP_Contact"];
  28543. c.dynamics.ZPP_Contact.prototype = {
  28544. at: function (a) {
  28545. a = this.iterator_at(a);
  28546. return null != a ? a : null
  28547. },
  28548. iterator_at: function (a) {
  28549. for (var b = this.next; 0 < a-- && null != b;) b = b.next;
  28550. return b
  28551. },
  28552. back: function () {
  28553. for (var a = this.next, b =
  28554. a; null != b;) a = b, b = b.next;
  28555. return a
  28556. },
  28557. front: function () {
  28558. return this.next
  28559. },
  28560. inlined_has: function (a) {
  28561. var b;
  28562. b = !1;
  28563. for (var d = this.next; null != d;) {
  28564. if (d == a) {
  28565. b = !0;
  28566. break
  28567. }
  28568. d = d.next
  28569. }
  28570. return b
  28571. },
  28572. has: function (a) {
  28573. return this.inlined_has(a)
  28574. },
  28575. size: function () {
  28576. return this.length
  28577. },
  28578. empty: function () {
  28579. return null == this.next
  28580. },
  28581. reverse: function () {
  28582. for (var a = this.next, b = null; null != a;) {
  28583. var d = a.next;
  28584. a.next = b;
  28585. b = this.next = a;
  28586. a = d
  28587. }
  28588. this.pushmod = this.modified = !0
  28589. },
  28590. inlined_clear: function () {},
  28591. clear: function () {},
  28592. splice: function (a, b) {
  28593. for (; 0 < b-- && null !=
  28594. a.next;) this.erase(a);
  28595. return a.next
  28596. },
  28597. inlined_erase: function (a) {
  28598. var b, d;
  28599. null == a ? (b = this.next, this.next = d = b.next, null == this.next && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  28600. b._inuse = !1;
  28601. this.modified = !0;
  28602. this.length--;
  28603. this.pushmod = !0;
  28604. return d
  28605. },
  28606. erase: function (a) {
  28607. return this.inlined_erase(a)
  28608. },
  28609. inlined_try_remove: function (a) {
  28610. for (var b = null, d = this.next, c = !1; null != d;) {
  28611. if (d == a) {
  28612. this.inlined_erase(b);
  28613. c = !0;
  28614. break
  28615. }
  28616. b = d;
  28617. d = d.next
  28618. }
  28619. return c
  28620. },
  28621. inlined_remove: function (a) {
  28622. this.inlined_try_remove(a)
  28623. },
  28624. try_remove: function (a) {
  28625. for (var b = null, d = this.next, c = !1; null != d;) {
  28626. if (d == a) {
  28627. this.erase(b);
  28628. c = !0;
  28629. break
  28630. }
  28631. b = d;
  28632. d = d.next
  28633. }
  28634. return c
  28635. },
  28636. remove: function (a) {
  28637. this.inlined_try_remove(a)
  28638. },
  28639. inlined_pop_unsafe: function () {
  28640. var a = this.next;
  28641. this.pop();
  28642. return a
  28643. },
  28644. pop_unsafe: function () {
  28645. return this.inlined_pop_unsafe()
  28646. },
  28647. inlined_pop: function () {
  28648. var a = this.next;
  28649. this.next = a.next;
  28650. a._inuse = !1;
  28651. null == this.next && (this.pushmod = !0);
  28652. this.modified = !0;
  28653. this.length--
  28654. },
  28655. pop: function () {
  28656. this.inlined_pop()
  28657. },
  28658. inlined_insert: function (a, b) {
  28659. b._inuse = !0;
  28660. null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
  28661. this.pushmod = this.modified = !0;
  28662. this.length++;
  28663. return b
  28664. },
  28665. insert: function (a, b) {
  28666. return this.inlined_insert(a, b)
  28667. },
  28668. addAll: function (a) {
  28669. for (a = a.next; null != a;) this.add(a), a = a.next
  28670. },
  28671. inlined_add: function (a) {
  28672. a._inuse = !0;
  28673. a.next = this.next;
  28674. this.next = a;
  28675. this.modified = !0;
  28676. this.length++;
  28677. return a
  28678. },
  28679. add: function (a) {
  28680. return this.inlined_add(a)
  28681. },
  28682. setbegin: function (a) {
  28683. this.next = a;
  28684. this.pushmod = this.modified = !0
  28685. },
  28686. begin: function () {
  28687. return this.next
  28688. },
  28689. elem: function () {
  28690. return this
  28691. },
  28692. alloc: function () {},
  28693. free: function () {
  28694. this.arbiter = null
  28695. },
  28696. inactiveme: function () {
  28697. return !(this.active && null != this.arbiter && this.arbiter.active)
  28698. },
  28699. getposition: function () {
  28700. this.wrap_position = h.geom.Vec2.get(null, null, null);
  28701. this.wrap_position.zpp_inner._inuse = !0;
  28702. this.wrap_position.zpp_inner._immutable = !0;
  28703. this.wrap_position.zpp_inner._validate = A(this, this.position_validate)
  28704. },
  28705. position_validate: function () {
  28706. if (this.inactiveme()) throw "Error: Contact not currently in use";
  28707. this.wrap_position.zpp_inner.x = this.px;
  28708. this.wrap_position.zpp_inner.y =
  28709. this.py
  28710. },
  28711. wrapper: function () {
  28712. null == this.outer && (c.dynamics.ZPP_Contact.internal = !0, this.outer = new h.dynamics.Contact, c.dynamics.ZPP_Contact.internal = !1, this.outer.zpp_inner = this);
  28713. return this.outer
  28714. },
  28715. __class__: c.dynamics.ZPP_Contact
  28716. };
  28717. c.dynamics.ZPP_IContact = function () {
  28718. this.length = 0;
  28719. this._inuse = this.modified = this.pushmod = !1;
  28720. this.next = null;
  28721. this.r1x = this.r1y = this.r2x = this.r2y = this.nMass = this.tMass = this.bounce = this.friction = this.jnAcc = this.jtAcc = this.lr1x = this.lr1y = this.lr2x = this.lr2y = 0
  28722. };
  28723. s["zpp_nape.dynamics.ZPP_IContact"] =
  28724. c.dynamics.ZPP_IContact;
  28725. c.dynamics.ZPP_IContact.__name__ = ["zpp_nape", "dynamics", "ZPP_IContact"];
  28726. c.dynamics.ZPP_IContact.prototype = {
  28727. at: function (a) {
  28728. a = this.iterator_at(a);
  28729. return null != a ? a : null
  28730. },
  28731. iterator_at: function (a) {
  28732. for (var b = this.next; 0 < a-- && null != b;) b = b.next;
  28733. return b
  28734. },
  28735. back: function () {
  28736. for (var a = this.next, b = a; null != b;) a = b, b = b.next;
  28737. return a
  28738. },
  28739. front: function () {
  28740. return this.next
  28741. },
  28742. inlined_has: function (a) {
  28743. var b;
  28744. b = !1;
  28745. for (var d = this.next; null != d;) {
  28746. if (d == a) {
  28747. b = !0;
  28748. break
  28749. }
  28750. d = d.next
  28751. }
  28752. return b
  28753. },
  28754. has: function (a) {
  28755. return this.inlined_has(a)
  28756. },
  28757. size: function () {
  28758. return this.length
  28759. },
  28760. empty: function () {
  28761. return null == this.next
  28762. },
  28763. reverse: function () {
  28764. for (var a = this.next, b = null; null != a;) {
  28765. var d = a.next;
  28766. a.next = b;
  28767. b = this.next = a;
  28768. a = d
  28769. }
  28770. this.pushmod = this.modified = !0
  28771. },
  28772. inlined_clear: function () {},
  28773. clear: function () {},
  28774. splice: function (a, b) {
  28775. for (; 0 < b-- && null != a.next;) this.erase(a);
  28776. return a.next
  28777. },
  28778. inlined_erase: function (a) {
  28779. var b, d;
  28780. null == a ? (b = this.next, this.next = d = b.next, null == this.next && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  28781. b._inuse = !1;
  28782. this.modified = !0;
  28783. this.length--;
  28784. this.pushmod = !0;
  28785. return d
  28786. },
  28787. erase: function (a) {
  28788. return this.inlined_erase(a)
  28789. },
  28790. inlined_try_remove: function (a) {
  28791. for (var b = null, d = this.next, c = !1; null != d;) {
  28792. if (d == a) {
  28793. this.inlined_erase(b);
  28794. c = !0;
  28795. break
  28796. }
  28797. b = d;
  28798. d = d.next
  28799. }
  28800. return c
  28801. },
  28802. inlined_remove: function (a) {
  28803. this.inlined_try_remove(a)
  28804. },
  28805. try_remove: function (a) {
  28806. for (var b = null, d = this.next, c = !1; null != d;) {
  28807. if (d == a) {
  28808. this.erase(b);
  28809. c = !0;
  28810. break
  28811. }
  28812. b = d;
  28813. d = d.next
  28814. }
  28815. return c
  28816. },
  28817. remove: function (a) {
  28818. this.inlined_try_remove(a)
  28819. },
  28820. inlined_pop_unsafe: function () {
  28821. var a =
  28822. this.next;
  28823. this.pop();
  28824. return a
  28825. },
  28826. pop_unsafe: function () {
  28827. return this.inlined_pop_unsafe()
  28828. },
  28829. inlined_pop: function () {
  28830. var a = this.next;
  28831. this.next = a.next;
  28832. a._inuse = !1;
  28833. null == this.next && (this.pushmod = !0);
  28834. this.modified = !0;
  28835. this.length--
  28836. },
  28837. pop: function () {
  28838. this.inlined_pop()
  28839. },
  28840. inlined_insert: function (a, b) {
  28841. b._inuse = !0;
  28842. null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
  28843. this.pushmod = this.modified = !0;
  28844. this.length++;
  28845. return b
  28846. },
  28847. insert: function (a, b) {
  28848. return this.inlined_insert(a, b)
  28849. },
  28850. addAll: function (a) {
  28851. for (a = a.next; null !=
  28852. a;) this.add(a), a = a.next
  28853. },
  28854. inlined_add: function (a) {
  28855. a._inuse = !0;
  28856. a.next = this.next;
  28857. this.next = a;
  28858. this.modified = !0;
  28859. this.length++;
  28860. return a
  28861. },
  28862. add: function (a) {
  28863. return this.inlined_add(a)
  28864. },
  28865. setbegin: function (a) {
  28866. this.next = a;
  28867. this.pushmod = this.modified = !0
  28868. },
  28869. begin: function () {
  28870. return this.next
  28871. },
  28872. elem: function () {
  28873. return this
  28874. },
  28875. __class__: c.dynamics.ZPP_IContact
  28876. };
  28877. c.dynamics.ZPP_InteractionFilter = function () {
  28878. this.collisionGroup = this.collisionMask = this.sensorGroup = this.sensorMask = this.fluidGroup = this.fluidMask = 0;
  28879. this.next = this.userData =
  28880. this.outer = this.shapes = this.wrap_shapes = null;
  28881. this.shapes = new c.util.ZNPList_ZPP_Shape;
  28882. this.collisionGroup = this.sensorGroup = this.fluidGroup = 1;
  28883. this.collisionMask = this.sensorMask = this.fluidMask = -1
  28884. };
  28885. s["zpp_nape.dynamics.ZPP_InteractionFilter"] = c.dynamics.ZPP_InteractionFilter;
  28886. c.dynamics.ZPP_InteractionFilter.__name__ = ["zpp_nape", "dynamics", "ZPP_InteractionFilter"];
  28887. c.dynamics.ZPP_InteractionFilter.prototype = {
  28888. invalidate: function () {
  28889. for (var a = this.shapes.head; null != a;) a.elt.invalidate_filter(), a = a.next
  28890. },
  28891. shouldFlow: function (a) {
  28892. return 0 != (this.fluidMask & a.fluidGroup) && 0 != (a.fluidMask & this.fluidGroup)
  28893. },
  28894. shouldSense: function (a) {
  28895. return 0 != (this.sensorMask & a.sensorGroup) && 0 != (a.sensorMask & this.sensorGroup)
  28896. },
  28897. shouldCollide: function (a) {
  28898. return 0 != (this.collisionMask & a.collisionGroup) && 0 != (a.collisionMask & this.collisionGroup)
  28899. },
  28900. copy: function () {
  28901. var a;
  28902. null == c.dynamics.ZPP_InteractionFilter.zpp_pool ? a = new c.dynamics.ZPP_InteractionFilter : (a = c.dynamics.ZPP_InteractionFilter.zpp_pool, c.dynamics.ZPP_InteractionFilter.zpp_pool =
  28903. a.next, a.next = null);
  28904. null;
  28905. a.collisionGroup = this.collisionGroup;
  28906. a.collisionMask = this.collisionMask;
  28907. a.sensorGroup = this.sensorGroup;
  28908. a.sensorMask = this.sensorMask;
  28909. a.fluidGroup = this.fluidGroup;
  28910. a.fluidMask = this.fluidMask;
  28911. return a
  28912. },
  28913. remShape: function (a) {
  28914. this.shapes.remove(a)
  28915. },
  28916. addShape: function (a) {
  28917. this.shapes.add(a)
  28918. },
  28919. feature_cons: function () {
  28920. this.shapes = new c.util.ZNPList_ZPP_Shape
  28921. },
  28922. alloc: function () {},
  28923. free: function () {
  28924. this.outer = null
  28925. },
  28926. wrapper: function () {
  28927. if (null == this.outer) {
  28928. this.outer = new h.dynamics.InteractionFilter;
  28929. var a = this.outer.zpp_inner;
  28930. a.outer = null;
  28931. a.next = c.dynamics.ZPP_InteractionFilter.zpp_pool;
  28932. c.dynamics.ZPP_InteractionFilter.zpp_pool = a;
  28933. this.outer.zpp_inner = this
  28934. }
  28935. return this.outer
  28936. },
  28937. __class__: c.dynamics.ZPP_InteractionFilter
  28938. };
  28939. c.dynamics.ZPP_InteractionGroup = function () {
  28940. this.depth = 0;
  28941. this.group = this.groups = this.wrap_groups = this.interactors = this.wrap_interactors = null;
  28942. this.ignore = !1;
  28943. this.outer = null;
  28944. this.depth = 0;
  28945. this.groups = new c.util.ZNPList_ZPP_InteractionGroup;
  28946. this.interactors = new c.util.ZNPList_ZPP_Interactor
  28947. };
  28948. s["zpp_nape.dynamics.ZPP_InteractionGroup"] = c.dynamics.ZPP_InteractionGroup;
  28949. c.dynamics.ZPP_InteractionGroup.__name__ = ["zpp_nape", "dynamics", "ZPP_InteractionGroup"];
  28950. c.dynamics.ZPP_InteractionGroup.prototype = {
  28951. remInteractor: function (a, b) {
  28952. this.interactors.remove(a)
  28953. },
  28954. addInteractor: function (a) {
  28955. this.interactors.add(a)
  28956. },
  28957. remGroup: function (a) {
  28958. this.groups.remove(a);
  28959. a.depth = 0
  28960. },
  28961. addGroup: function (a) {
  28962. this.groups.add(a);
  28963. a.depth = this.depth + 1
  28964. },
  28965. invalidate: function (a) {
  28966. null == a && (a = !1);
  28967. if (a || this.ignore) {
  28968. for (var b = this.interactors.head; null !=
  28969. b;) {
  28970. var d = b.elt;
  28971. null != d.ibody ? d.ibody.wake() : null != d.ishape ? d.ishape.body.wake() : d.icompound.wake();
  28972. b = b.next
  28973. }
  28974. for (b = this.groups.head; null != b;) b.elt.invalidate(a), b = b.next
  28975. }
  28976. },
  28977. setGroup: function (a) {
  28978. this.group != a && (null != this.group && (this.group.groups.remove(this), this.depth = 0, this.group.invalidate(!0)), this.group = a, null != a ? (a.groups.add(this), this.depth = a.depth + 1, a.invalidate(!0)) : this.invalidate(!0))
  28979. },
  28980. __class__: c.dynamics.ZPP_InteractionGroup
  28981. };
  28982. c.dynamics.ZPP_SpaceArbiterList = function () {
  28983. this.at_index_0 =
  28984. this.at_index_1 = this.at_index_2 = this.at_index_3 = 0;
  28985. this.lengths = this.ite_0 = this.ite_1 = this.ite_2 = this.ite_3 = null;
  28986. this.zip_length = !1;
  28987. this._length = 0;
  28988. this.space = null;
  28989. h.dynamics.ArbiterList.call(this);
  28990. this.at_index_3 = this.at_index_2 = this.at_index_1 = this.at_index_0 = 0;
  28991. this.zip_length = !0;
  28992. this._length = 0;
  28993. this.lengths = [];
  28994. for (var a = 0; 4 > a;) a++, this.lengths.push(0)
  28995. };
  28996. s["zpp_nape.dynamics.ZPP_SpaceArbiterList"] = c.dynamics.ZPP_SpaceArbiterList;
  28997. c.dynamics.ZPP_SpaceArbiterList.__name__ = ["zpp_nape", "dynamics", "ZPP_SpaceArbiterList"];
  28998. c.dynamics.ZPP_SpaceArbiterList.__super__ = h.dynamics.ArbiterList;
  28999. c.dynamics.ZPP_SpaceArbiterList.prototype = I(h.dynamics.ArbiterList.prototype, {
  29000. at: function (a) {
  29001. this.zpp_vm();
  29002. if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
  29003. var b = null,
  29004. d = 0;
  29005. if (null == b)
  29006. if (a < d + this.lengths[0]) {
  29007. b = a - d;
  29008. if (b < this.at_index_0 || null == this.ite_0)
  29009. for (this.at_index_0 = 0, this.ite_0 = this.space.c_arbiters_true.head;;) {
  29010. var c = this.ite_0.elt;
  29011. if (c.active) break;
  29012. this.ite_0 = this.ite_0.next
  29013. }
  29014. for (; this.at_index_0 != b;)
  29015. for (this.at_index_0++,
  29016. this.ite_0 = this.ite_0.next;;) {
  29017. c = this.ite_0.elt;
  29018. if (c.active) break;
  29019. this.ite_0 = this.ite_0.next
  29020. }
  29021. b = this.ite_0.elt.wrapper()
  29022. } else d += this.lengths[0];
  29023. if (null == b)
  29024. if (a < d + this.lengths[1]) {
  29025. b = a - d;
  29026. if (b < this.at_index_1 || null == this.ite_1)
  29027. for (this.at_index_1 = 0, this.ite_1 = this.space.c_arbiters_false.head;;) {
  29028. c = this.ite_1.elt;
  29029. if (c.active) break;
  29030. this.ite_1 = this.ite_1.next
  29031. }
  29032. for (; this.at_index_1 != b;)
  29033. for (this.at_index_1++, this.ite_1 = this.ite_1.next;;) {
  29034. c = this.ite_1.elt;
  29035. if (c.active) break;
  29036. this.ite_1 = this.ite_1.next
  29037. }
  29038. b = this.ite_1.elt.wrapper()
  29039. } else d +=
  29040. this.lengths[1];
  29041. if (null == b)
  29042. if (a < d + this.lengths[2]) {
  29043. b = a - d;
  29044. if (b < this.at_index_2 || null == this.ite_2)
  29045. for (this.at_index_2 = 0, this.ite_2 = this.space.f_arbiters.head;;) {
  29046. c = this.ite_2.elt;
  29047. if (c.active) break;
  29048. this.ite_2 = this.ite_2.next
  29049. }
  29050. for (; this.at_index_2 != b;)
  29051. for (this.at_index_2++, this.ite_2 = this.ite_2.next;;) {
  29052. c = this.ite_2.elt;
  29053. if (c.active) break;
  29054. this.ite_2 = this.ite_2.next
  29055. }
  29056. b = this.ite_2.elt.wrapper()
  29057. } else d += this.lengths[2];
  29058. if (null == b && a < d + this.lengths[3]) {
  29059. b = a - d;
  29060. if (b < this.at_index_3 || null == this.ite_3)
  29061. for (this.at_index_3 =
  29062. 0, this.ite_3 = this.space.s_arbiters.head;;) {
  29063. c = this.ite_3.elt;
  29064. if (c.active) break;
  29065. this.ite_3 = this.ite_3.next
  29066. }
  29067. for (; this.at_index_3 != b;)
  29068. for (this.at_index_3++, this.ite_3 = this.ite_3.next;;) {
  29069. c = this.ite_3.elt;
  29070. if (c.active) break;
  29071. this.ite_3 = this.ite_3.next
  29072. }
  29073. b = this.ite_3.elt.wrapper()
  29074. }
  29075. return b
  29076. },
  29077. clear: function () {
  29078. throw "Error: ArbiterList is immutable";
  29079. },
  29080. remove: function (a) {
  29081. throw "Error: ArbiterList is immutable";
  29082. },
  29083. shift: function () {
  29084. throw "Error: ArbiterList is immutable";
  29085. },
  29086. unshift: function (a) {
  29087. throw "Error: ArbiterList is immutable";
  29088. },
  29089. pop: function () {
  29090. throw "Error: ArbiterList is immutable";
  29091. },
  29092. push: function (a) {
  29093. throw "Error: ArbiterList is immutable";
  29094. },
  29095. zpp_vm: function () {
  29096. var a = !1;
  29097. this.space.c_arbiters_true.modified && (a = !0, this.space.c_arbiters_true.modified = !1);
  29098. this.space.c_arbiters_false.modified && (a = !0, this.space.c_arbiters_false.modified = !1);
  29099. this.space.f_arbiters.modified && (a = !0, this.space.f_arbiters.modified = !1);
  29100. this.space.s_arbiters.modified && (a = !0, this.space.s_arbiters.modified = !1);
  29101. a && (this.zip_length = !0, this._length = 0, this.ite_3 =
  29102. this.ite_2 = this.ite_1 = this.ite_0 = null)
  29103. },
  29104. zpp_gl: function () {
  29105. this.zpp_vm();
  29106. if (this.zip_length) {
  29107. for (var a = this._length = 0, b = 0, d = this.space.c_arbiters_true.head; null != d;) {
  29108. var c = d.elt;
  29109. c.active && b++;
  29110. d = d.next
  29111. }
  29112. this.lengths[a++] = b;
  29113. this._length += b;
  29114. b = 0;
  29115. for (d = this.space.c_arbiters_false.head; null != d;) c = d.elt, c.active && b++, d = d.next;
  29116. this.lengths[a++] = b;
  29117. this._length += b;
  29118. b = 0;
  29119. for (d = this.space.f_arbiters.head; null != d;) c = d.elt, c.active && b++, d = d.next;
  29120. this.lengths[a++] = b;
  29121. this._length += b;
  29122. b = 0;
  29123. for (d = this.space.s_arbiters.head; null !=
  29124. d;) c = d.elt, c.active && b++, d = d.next;
  29125. this.lengths[a++] = b;
  29126. this._length += b;
  29127. this.zip_length = !1
  29128. }
  29129. return this._length
  29130. },
  29131. __class__: c.dynamics.ZPP_SpaceArbiterList
  29132. });
  29133. c.geom = {};
  29134. c.geom.ZPP_AABB = function () {
  29135. this.wrap_max = null;
  29136. this.maxx = this.maxy = 0;
  29137. this.wrap_min = null;
  29138. this.minx = this.miny = 0;
  29139. this.outer = this.next = null;
  29140. this._immutable = !1;
  29141. this._invalidate = this._validate = null
  29142. };
  29143. s["zpp_nape.geom.ZPP_AABB"] = c.geom.ZPP_AABB;
  29144. c.geom.ZPP_AABB.__name__ = ["zpp_nape", "geom", "ZPP_AABB"];
  29145. c.geom.ZPP_AABB.get = function (a, b, d, g) {
  29146. var e;
  29147. null ==
  29148. c.geom.ZPP_AABB.zpp_pool ? e = new c.geom.ZPP_AABB : (e = c.geom.ZPP_AABB.zpp_pool, c.geom.ZPP_AABB.zpp_pool = e.next, e.next = null);
  29149. null;
  29150. e.minx = a;
  29151. e.miny = b;
  29152. e.maxx = d;
  29153. e.maxy = g;
  29154. return e
  29155. };
  29156. c.geom.ZPP_AABB.prototype = {
  29157. toString: function () {
  29158. return "{ x: " + this.minx + " y: " + this.miny + " w: " + (this.maxx - this.minx) + " h: " + (this.maxy - this.miny) + " }"
  29159. },
  29160. setExpandPoint: function (a, b) {
  29161. a < this.minx && (this.minx = a);
  29162. a > this.maxx && (this.maxx = a);
  29163. b < this.miny && (this.miny = b);
  29164. b > this.maxy && (this.maxy = b)
  29165. },
  29166. setExpand: function (a, b) {
  29167. this.minx = a.minx -
  29168. b;
  29169. this.miny = a.miny - b;
  29170. this.maxx = a.maxx + b;
  29171. this.maxy = a.maxy + b
  29172. },
  29173. setCombine: function (a, b) {
  29174. this.minx = a.minx < b.minx ? a.minx : b.minx;
  29175. this.miny = a.miny < b.miny ? a.miny : b.miny;
  29176. this.maxx = a.maxx > b.maxx ? a.maxx : b.maxx;
  29177. this.maxy = a.maxy > b.maxy ? a.maxy : b.maxy
  29178. },
  29179. containsPoint: function (a) {
  29180. return a.x >= this.minx && a.x <= this.maxx && a.y >= this.miny && a.y <= this.maxy
  29181. },
  29182. contains: function (a) {
  29183. return a.minx >= this.minx && a.miny >= this.miny && a.maxx <= this.maxx && a.maxy <= this.maxy
  29184. },
  29185. combine: function (a) {
  29186. a.minx < this.minx && (this.minx = a.minx);
  29187. a.maxx >
  29188. this.maxx && (this.maxx = a.maxx);
  29189. a.miny < this.miny && (this.miny = a.miny);
  29190. a.maxy > this.maxy && (this.maxy = a.maxy)
  29191. },
  29192. intersect: function (a) {
  29193. return a.miny <= this.maxy && this.miny <= a.maxy && a.minx <= this.maxx && this.minx <= a.maxx
  29194. },
  29195. intersectY: function (a) {
  29196. return !(a.miny > this.maxy || this.miny > a.maxy)
  29197. },
  29198. intersectX: function (a) {
  29199. return !(a.minx > this.maxx || this.minx > a.maxx)
  29200. },
  29201. mod_max: function (a) {
  29202. if (a.x != this.maxx || a.y != this.maxy) this.maxx = a.x, this.maxy = a.y, null != this._invalidate && this._invalidate(this)
  29203. },
  29204. dom_max: function () {
  29205. null !=
  29206. this._validate && this._validate();
  29207. this.wrap_max.zpp_inner.x = this.maxx;
  29208. this.wrap_max.zpp_inner.y = this.maxy
  29209. },
  29210. getmax: function () {
  29211. null == this.wrap_max && (this.wrap_max = h.geom.Vec2.get(this.maxx, this.maxy, null), this.wrap_max.zpp_inner._inuse = !0, this._immutable ? this.wrap_max.zpp_inner._immutable = !0 : this.wrap_max.zpp_inner._invalidate = A(this, this.mod_max), this.wrap_max.zpp_inner._validate = A(this, this.dom_max));
  29212. return this.wrap_max
  29213. },
  29214. mod_min: function (a) {
  29215. if (a.x != this.minx || a.y != this.miny) this.minx = a.x, this.miny =
  29216. a.y, null != this._invalidate && this._invalidate(this)
  29217. },
  29218. dom_min: function () {
  29219. null != this._validate && this._validate();
  29220. this.wrap_min.zpp_inner.x = this.minx;
  29221. this.wrap_min.zpp_inner.y = this.miny
  29222. },
  29223. getmin: function () {
  29224. null == this.wrap_min && (this.wrap_min = h.geom.Vec2.get(this.minx, this.miny, null), this.wrap_min.zpp_inner._inuse = !0, this._immutable ? this.wrap_min.zpp_inner._immutable = !0 : this.wrap_min.zpp_inner._invalidate = A(this, this.mod_min), this.wrap_min.zpp_inner._validate = A(this, this.dom_min));
  29225. return this.wrap_min
  29226. },
  29227. perimeter: function () {
  29228. return 2 * (this.maxx - this.minx + (this.maxy - this.miny))
  29229. },
  29230. height: function () {
  29231. return this.maxy - this.miny
  29232. },
  29233. width: function () {
  29234. return this.maxx - this.minx
  29235. },
  29236. copy: function () {
  29237. return c.geom.ZPP_AABB.get(this.minx, this.miny, this.maxx, this.maxy)
  29238. },
  29239. free: function () {
  29240. null != this.outer && (this.outer = this.outer.zpp_inner = null);
  29241. this._validate = this._invalidate = this.wrap_min = this.wrap_max = null
  29242. },
  29243. alloc: function () {},
  29244. wrapper: function () {
  29245. if (null == this.outer) {
  29246. this.outer = new h.geom.AABB;
  29247. var a = this.outer.zpp_inner;
  29248. null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
  29249. a.wrap_min = a.wrap_max = null;
  29250. a._invalidate = null;
  29251. a._validate = null;
  29252. a.next = c.geom.ZPP_AABB.zpp_pool;
  29253. c.geom.ZPP_AABB.zpp_pool = a;
  29254. this.outer.zpp_inner = this
  29255. }
  29256. return this.outer
  29257. },
  29258. invalidate: function () {
  29259. null != this._invalidate && this._invalidate(this)
  29260. },
  29261. validate: function () {
  29262. null != this._validate && this._validate()
  29263. },
  29264. __class__: c.geom.ZPP_AABB
  29265. };
  29266. c.util.ZNPList_ZPP_Vec2 = function () {
  29267. this.length = 0;
  29268. this.modified = this.pushmod = !1;
  29269. this.head = null
  29270. };
  29271. s["zpp_nape.util.ZNPList_ZPP_Vec2"] =
  29272. c.util.ZNPList_ZPP_Vec2;
  29273. c.util.ZNPList_ZPP_Vec2.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Vec2"];
  29274. c.util.ZNPList_ZPP_Vec2.prototype = {
  29275. at: function (a) {
  29276. a = this.iterator_at(a);
  29277. return null != a ? a.elt : null
  29278. },
  29279. iterator_at: function (a) {
  29280. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  29281. return b
  29282. },
  29283. back: function () {
  29284. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  29285. return a.elt
  29286. },
  29287. front: function () {
  29288. return this.head.elt
  29289. },
  29290. inlined_has: function (a) {
  29291. var b;
  29292. b = !1;
  29293. for (var d = this.head; null != d;) {
  29294. if (d.elt == a) {
  29295. b = !0;
  29296. break
  29297. }
  29298. d = d.next
  29299. }
  29300. return b
  29301. },
  29302. has: function (a) {
  29303. return this.inlined_has(a)
  29304. },
  29305. size: function () {
  29306. return this.length
  29307. },
  29308. empty: function () {
  29309. return null == this.head
  29310. },
  29311. reverse: function () {
  29312. for (var a = this.head, b = null; null != a;) {
  29313. var d = a.next;
  29314. a.next = b;
  29315. b = this.head = a;
  29316. a = d
  29317. }
  29318. this.pushmod = this.modified = !0
  29319. },
  29320. inlined_clear: function () {
  29321. for (; null != this.head;) this.inlined_pop();
  29322. this.pushmod = !0
  29323. },
  29324. clear: function () {
  29325. for (; null != this.head;) this.inlined_pop();
  29326. this.pushmod = !0
  29327. },
  29328. splice: function (a, b) {
  29329. for (; 0 < b-- && null != a.next;) this.erase(a);
  29330. return a.next
  29331. },
  29332. inlined_erase: function (a) {
  29333. var b, d;
  29334. null == a ? (b = this.head, this.head =
  29335. d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  29336. a = b;
  29337. a.elt = null;
  29338. a.next = c.util.ZNPNode_ZPP_Vec2.zpp_pool;
  29339. c.util.ZNPNode_ZPP_Vec2.zpp_pool = a;
  29340. this.modified = !0;
  29341. this.length--;
  29342. this.pushmod = !0;
  29343. return d
  29344. },
  29345. erase: function (a) {
  29346. return this.inlined_erase(a)
  29347. },
  29348. inlined_try_remove: function (a) {
  29349. for (var b = null, d = this.head, c = !1; null != d;) {
  29350. if (d.elt == a) {
  29351. this.inlined_erase(b);
  29352. c = !0;
  29353. break
  29354. }
  29355. b = d;
  29356. d = d.next
  29357. }
  29358. return c
  29359. },
  29360. inlined_remove: function (a) {
  29361. this.inlined_try_remove(a)
  29362. },
  29363. try_remove: function (a) {
  29364. for (var b =
  29365. null, d = this.head, c = !1; null != d;) {
  29366. if (d.elt == a) {
  29367. this.erase(b);
  29368. c = !0;
  29369. break
  29370. }
  29371. b = d;
  29372. d = d.next
  29373. }
  29374. return c
  29375. },
  29376. remove: function (a) {
  29377. this.inlined_try_remove(a)
  29378. },
  29379. inlined_pop_unsafe: function () {
  29380. var a = this.head.elt;
  29381. this.pop();
  29382. return a
  29383. },
  29384. pop_unsafe: function () {
  29385. return this.inlined_pop_unsafe()
  29386. },
  29387. inlined_pop: function () {
  29388. var a = this.head;
  29389. this.head = a.next;
  29390. a.elt = null;
  29391. a.next = c.util.ZNPNode_ZPP_Vec2.zpp_pool;
  29392. c.util.ZNPNode_ZPP_Vec2.zpp_pool = a;
  29393. null == this.head && (this.pushmod = !0);
  29394. this.modified = !0;
  29395. this.length--
  29396. },
  29397. pop: function () {
  29398. this.inlined_pop()
  29399. },
  29400. inlined_insert: function (a, b) {
  29401. var d;
  29402. null == c.util.ZNPNode_ZPP_Vec2.zpp_pool ? d = new c.util.ZNPNode_ZPP_Vec2 : (d = c.util.ZNPNode_ZPP_Vec2.zpp_pool, c.util.ZNPNode_ZPP_Vec2.zpp_pool = d.next, d.next = null);
  29403. null;
  29404. d.elt = b;
  29405. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  29406. this.pushmod = this.modified = !0;
  29407. this.length++;
  29408. return d
  29409. },
  29410. insert: function (a, b) {
  29411. return this.inlined_insert(a, b)
  29412. },
  29413. addAll: function (a) {
  29414. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  29415. },
  29416. inlined_add: function (a) {
  29417. var b;
  29418. null == c.util.ZNPNode_ZPP_Vec2.zpp_pool ?
  29419. b = new c.util.ZNPNode_ZPP_Vec2 : (b = c.util.ZNPNode_ZPP_Vec2.zpp_pool, c.util.ZNPNode_ZPP_Vec2.zpp_pool = b.next, b.next = null);
  29420. null;
  29421. b.elt = a;
  29422. b.next = this.head;
  29423. this.head = b;
  29424. this.modified = !0;
  29425. this.length++;
  29426. return a
  29427. },
  29428. add: function (a) {
  29429. return this.inlined_add(a)
  29430. },
  29431. setbegin: function (a) {
  29432. this.head = a;
  29433. this.pushmod = this.modified = !0
  29434. },
  29435. begin: function () {
  29436. return this.head
  29437. },
  29438. __class__: c.util.ZNPList_ZPP_Vec2
  29439. };
  29440. c.geom.ZPP_Collide = function () {};
  29441. s["zpp_nape.geom.ZPP_Collide"] = c.geom.ZPP_Collide;
  29442. c.geom.ZPP_Collide.__name__ = ["zpp_nape",
  29443. "geom", "ZPP_Collide"
  29444. ];
  29445. c.geom.ZPP_Collide.circleContains = function (a, b) {
  29446. var d = 0,
  29447. c = 0,
  29448. d = b.x - a.worldCOMx,
  29449. c = b.y - a.worldCOMy;
  29450. return d * d + c * c < a.radius * a.radius
  29451. };
  29452. c.geom.ZPP_Collide.polyContains = function (a, b) {
  29453. var d;
  29454. d = !0;
  29455. for (var c = a.edges.head; null != c;) {
  29456. var e = c.elt;
  29457. if (e.gnormx * b.x + e.gnormy * b.y <= e.gprojection) c = c.next;
  29458. else {
  29459. d = !1;
  29460. break
  29461. }
  29462. }
  29463. return d
  29464. };
  29465. c.geom.ZPP_Collide.shapeContains = function (a, b) {
  29466. return a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? c.geom.ZPP_Collide.circleContains(a.circle, b) : c.geom.ZPP_Collide.polyContains(a.polygon,
  29467. b)
  29468. };
  29469. c.geom.ZPP_Collide.bodyContains = function (a, b) {
  29470. var d;
  29471. d = !1;
  29472. for (var g = a.shapes.head; null != g;) {
  29473. if (c.geom.ZPP_Collide.shapeContains(g.elt, b)) {
  29474. d = !0;
  29475. break
  29476. }
  29477. g = g.next
  29478. }
  29479. return d
  29480. };
  29481. c.geom.ZPP_Collide.containTest = function (a, b) {
  29482. return a.aabb.contains(b.aabb) ? a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? function (d) {
  29483. d = a.circle.radius + -b.circle.radius;
  29484. var c = 0,
  29485. e = 0,
  29486. c = b.circle.worldCOMx - a.circle.worldCOMx,
  29487. e = b.circle.worldCOMy - a.circle.worldCOMy;
  29488. return c * c + e * e <= d * d
  29489. }(this) :
  29490. function (d) {
  29491. d = !0;
  29492. for (var c = b.polygon.gverts.next; null != c;) {
  29493. var e = c,
  29494. f = void 0,
  29495. f = a.circle.radius,
  29496. l = 0,
  29497. m = 0,
  29498. l = e.x - a.circle.worldCOMx,
  29499. m = e.y - a.circle.worldCOMy;
  29500. if (f = l * l + m * m <= f * f) c = c.next;
  29501. else {
  29502. d = !1;
  29503. break
  29504. }
  29505. }
  29506. return d
  29507. }(this) : b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? function (d) {
  29508. d = !0;
  29509. for (var c = a.polygon.edges.head; null != c;) {
  29510. var e = c.elt;
  29511. if (e.gnormx * b.circle.worldCOMx + e.gnormy * b.circle.worldCOMy + b.circle.radius <= e.gprojection) c = c.next;
  29512. else {
  29513. d = !1;
  29514. break
  29515. }
  29516. }
  29517. return d
  29518. }(this) : function (d) {
  29519. d = !0;
  29520. for (var c = a.polygon.edges.head; null !=
  29521. c;) {
  29522. for (var e = c.elt, f = void 0, f = -1E100, l = b.polygon.gverts.next; null != l;) {
  29523. var m = l,
  29524. m = e.gnormx * m.x + e.gnormy * m.y;
  29525. m > f && (f = m);
  29526. l = l.next
  29527. }
  29528. if (f = f <= e.gprojection) c = c.next;
  29529. else {
  29530. d = !1;
  29531. break
  29532. }
  29533. }
  29534. return d
  29535. }(this) : !1
  29536. };
  29537. c.geom.ZPP_Collide.contactCollide = function (a, b, d, g) {
  29538. if (b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON)
  29539. if (a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
  29540. for (var e = !0, f = -1E100, l = -1, m = null, u = null, p = a.polygon.edges.head; null != p;) {
  29541. for (var k = p.elt, r = 1E100, n = b.polygon.gverts.next; null != n;) {
  29542. var w = n,
  29543. w = k.gnormx * w.x +
  29544. k.gnormy * w.y;
  29545. w < r && (r = w);
  29546. if (r - k.gprojection <= f) break;
  29547. n = n.next
  29548. }
  29549. r -= k.gprojection;
  29550. if (0 <= r) {
  29551. e = !1;
  29552. break
  29553. }
  29554. r > f && (f = r, m = k, l = 1);
  29555. p = p.next
  29556. }
  29557. if (e) {
  29558. for (p = b.polygon.edges.head; null != p;) {
  29559. k = p.elt;
  29560. r = 1E100;
  29561. for (n = a.polygon.gverts.next; null != n;) {
  29562. w = n;
  29563. w = k.gnormx * w.x + k.gnormy * w.y;
  29564. w < r && (r = w);
  29565. if (r - k.gprojection <= f) break;
  29566. n = n.next
  29567. }
  29568. r -= k.gprojection;
  29569. if (0 <= r) {
  29570. e = !1;
  29571. break
  29572. }
  29573. r > f && (f = r, u = k, l = 2);
  29574. p = p.next
  29575. }
  29576. if (e) {
  29577. 1 == l ? (f = b.polygon, k = m, m = 1) : (f = a.polygon, k = u, m = -1);
  29578. e = null;
  29579. r = 1E100;
  29580. for (p = f.edges.head; null != p;) u = p.elt, w = k.gnormx * u.gnormx + k.gnormy *
  29581. u.gnormy, w < r && (r = w, e = u), p = p.next;
  29582. var r = p = 0,
  29583. p = e.gp0.x,
  29584. r = e.gp0.y,
  29585. u = w = 0,
  29586. w = e.gp1.x,
  29587. u = e.gp1.y,
  29588. t = n = 0,
  29589. n = w - p,
  29590. t = u - r,
  29591. q = k.gnormy * p - k.gnormx * r,
  29592. s = k.gnormy * w - k.gnormx * u,
  29593. y = 1 / (s - q),
  29594. q = (-k.tp1 - q) * y;
  29595. q > h.Config.epsilon && (p += n * q, r += t * q);
  29596. q = (-k.tp0 - s) * y;
  29597. q < -h.Config.epsilon && (w += n * q, u += t * q);
  29598. t = n = 0;
  29599. q = m;
  29600. n = k.gnormx * q;
  29601. t = k.gnormy * q;
  29602. d.lnormx = k.lnormx;
  29603. d.lnormy = k.lnormy;
  29604. d.lproj = k.lprojection;
  29605. d.radius = 0;
  29606. d.rev = g != (-1 == m);
  29607. d.ptype = d.rev ? 1 : 0;
  29608. m = p * k.gnormx + r * k.gnormy - k.gprojection;
  29609. s = w * k.gnormx + u * k.gnormy - k.gprojection;
  29610. if (0 < m && 0 < s) return !1;
  29611. g && (n = -n, t = -t);
  29612. m = d.injectContact(p - 0.5 * k.gnormx * m, r - 0.5 * k.gnormy * m, n, t, m, d.rev ? 1 : 0, 0 < m);
  29613. q = 1;
  29614. p -= f.body.posx * q;
  29615. r -= f.body.posy * q;
  29616. m.inner.lr1x = p * f.body.axisy + r * f.body.axisx;
  29617. m.inner.lr1y = r * f.body.axisy - p * f.body.axisx;
  29618. m = d.injectContact(w - 0.5 * k.gnormx * s, u - 0.5 * k.gnormy * s, n, t, s, d.rev ? 0 : 1, 0 < s);
  29619. q = 1;
  29620. w -= f.body.posx * q;
  29621. u -= f.body.posy * q;
  29622. m.inner.lr1x = w * f.body.axisy + u * f.body.axisx;
  29623. m.inner.lr1y = u * f.body.axisy - w * f.body.axisx;
  29624. 1 == l ? (d.__ref_edge1 = k, d.__ref_edge2 = e) : (d.__ref_edge2 = k, d.__ref_edge1 = e);
  29625. return !0
  29626. }
  29627. }
  29628. } else {
  29629. f = -1E100;
  29630. e = !0;
  29631. k = l = null;
  29632. m = b.polygon.gverts.next;
  29633. for (p = b.polygon.edges.head; null != p;) {
  29634. r = p.elt;
  29635. w = r.gnormx * a.circle.worldCOMx + r.gnormy * a.circle.worldCOMy - r.gprojection - a.circle.radius;
  29636. if (0 < w) {
  29637. e = !1;
  29638. break
  29639. }
  29640. w > f && (f = w, l = r, k = m);
  29641. m = m.next;
  29642. p = p.next
  29643. }
  29644. if (e) {
  29645. var z = k,
  29646. x = null == k.next ? b.polygon.gverts.next : k.next,
  29647. k = a.circle.worldCOMy * l.gnormx - a.circle.worldCOMx * l.gnormy;
  29648. if (k <= z.y * l.gnormx - z.x * l.gnormy) return k = function (b) {
  29649. b = a.circle.radius;
  29650. var c = 0,
  29651. e = 0,
  29652. c = z.x - a.circle.worldCOMx,
  29653. e = z.y - a.circle.worldCOMy,
  29654. f = c * c + e * e;
  29655. if (f > b * b) b = null;
  29656. else if (f < h.Config.epsilon * h.Config.epsilon) b = d.injectContact(a.circle.worldCOMx, a.circle.worldCOMy, 1, 0, -b, 0, null);
  29657. else {
  29658. var f = 1 / Math.sqrt(f),
  29659. l = f < h.Config.epsilon ? 1E100 : 1 / f,
  29660. m = 0.5 + (a.circle.radius - 0.5 * b) * f;
  29661. b = g ? d.injectContact(a.circle.worldCOMx + c * m, a.circle.worldCOMy + e * m, -c * f, -e * f, l - b, 0, null) : d.injectContact(a.circle.worldCOMx + c * m, a.circle.worldCOMy + e * m, c * f, e * f, l - b, 0, null)
  29662. }
  29663. return b
  29664. }(this), null != k && (m = k.inner, d.ptype = 2, e = f = 0, f = z.x - b.polygon.body.posx, e = z.y - b.polygon.body.posy, d.__ref_edge1 = l, d.__ref_vertex = -1, g ? (m.lr1x = f * b.polygon.body.axisy + e * b.polygon.body.axisx, m.lr1y = e * b.polygon.body.axisy - f * b.polygon.body.axisx, m.lr2x = a.circle.localCOMx, m.lr2y = a.circle.localCOMy) : (m.lr2x = f * b.polygon.body.axisy + e * b.polygon.body.axisx, m.lr2y = e * b.polygon.body.axisy - f * b.polygon.body.axisx, m.lr1x = a.circle.localCOMx, m.lr1y = a.circle.localCOMy), d.radius = a.circle.radius), null != k;
  29665. if (k >= x.y * l.gnormx - x.x * l.gnormy) return k = function (b) {
  29666. b = a.circle.radius;
  29667. var c = 0,
  29668. e = 0,
  29669. c = x.x - a.circle.worldCOMx,
  29670. e = x.y - a.circle.worldCOMy,
  29671. f = c * c + e * e;
  29672. if (f > b * b) b = null;
  29673. else if (f < h.Config.epsilon * h.Config.epsilon) b = d.injectContact(a.circle.worldCOMx, a.circle.worldCOMy, 1, 0, -b, 0, null);
  29674. else {
  29675. var f = 1 / Math.sqrt(f),
  29676. l = f < h.Config.epsilon ? 1E100 : 1 / f,
  29677. m = 0.5 + (a.circle.radius - 0.5 * b) * f;
  29678. b = g ? d.injectContact(a.circle.worldCOMx + c * m, a.circle.worldCOMy + e * m, -c * f, -e * f, l - b, 0, null) : d.injectContact(a.circle.worldCOMx + c * m, a.circle.worldCOMy + e * m, c * f, e * f, l - b, 0, null)
  29679. }
  29680. return b
  29681. }(this), null != k && (m = k.inner, d.ptype = 2, e = f = 0, f = x.x - b.polygon.body.posx, e = x.y - b.polygon.body.posy, d.__ref_edge1 =
  29682. l, d.__ref_vertex = 1, g ? (m.lr1x = f * b.polygon.body.axisy + e * b.polygon.body.axisx, m.lr1y = e * b.polygon.body.axisy - f * b.polygon.body.axisx, m.lr2x = a.circle.localCOMx, m.lr2y = a.circle.localCOMy) : (m.lr2x = f * b.polygon.body.axisy + e * b.polygon.body.axisx, m.lr2y = e * b.polygon.body.axisy - f * b.polygon.body.axisx, m.lr1x = a.circle.localCOMx, m.lr1y = a.circle.localCOMy), d.radius = a.circle.radius), null != k;
  29683. t = n = 0;
  29684. q = a.circle.radius + 0.5 * f;
  29685. n = l.gnormx * q;
  29686. t = l.gnormy * q;
  29687. e = k = 0;
  29688. k = a.circle.worldCOMx - n;
  29689. e = a.circle.worldCOMy - t;
  29690. m = g ? d.injectContact(k,
  29691. e, l.gnormx, l.gnormy, f, 0, null) : d.injectContact(k, e, -l.gnormx, -l.gnormy, f, 0, null);
  29692. d.ptype = g ? 0 : 1;
  29693. d.lnormx = l.lnormx;
  29694. d.lnormy = l.lnormy;
  29695. d.rev = !g;
  29696. d.lproj = l.lprojection;
  29697. d.radius = a.circle.radius;
  29698. m.inner.lr1x = a.circle.localCOMx;
  29699. m.inner.lr1y = a.circle.localCOMy;
  29700. d.__ref_edge1 = l;
  29701. d.__ref_vertex = 0;
  29702. return !0
  29703. }
  29704. } else if (k = function (c) {
  29705. c = a.circle.radius + b.circle.radius;
  29706. var e = 0,
  29707. f = 0,
  29708. e = b.circle.worldCOMx - a.circle.worldCOMx,
  29709. f = b.circle.worldCOMy - a.circle.worldCOMy,
  29710. l = e * e + f * f;
  29711. if (l > c * c) c = null;
  29712. else if (l < h.Config.epsilon * h.Config.epsilon) c =
  29713. d.injectContact(a.circle.worldCOMx, a.circle.worldCOMy, 1, 0, -c, 0, null);
  29714. else {
  29715. var l = 1 / Math.sqrt(l),
  29716. m = l < h.Config.epsilon ? 1E100 : 1 / l,
  29717. u = 0.5 + (a.circle.radius - 0.5 * c) * l;
  29718. c = g ? d.injectContact(a.circle.worldCOMx + e * u, a.circle.worldCOMy + f * u, -e * l, -f * l, m - c, 0, null) : d.injectContact(a.circle.worldCOMx + e * u, a.circle.worldCOMy + f * u, e * l, f * l, m - c, 0, null)
  29719. }
  29720. return c
  29721. }(this), null != k) return m = k.inner, g ? (m.lr1x = b.circle.localCOMx, m.lr1y = b.circle.localCOMy, m.lr2x = a.circle.localCOMx, m.lr2y = a.circle.localCOMy) : (m.lr1x = a.circle.localCOMx,
  29722. m.lr1y = a.circle.localCOMy, m.lr2x = b.circle.localCOMx, m.lr2y = b.circle.localCOMy), d.radius = a.circle.radius + b.circle.radius, d.ptype = 2, !0;
  29723. return !1
  29724. };
  29725. c.geom.ZPP_Collide.testCollide_safe = function (a, b) {
  29726. if (b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
  29727. var d = a;
  29728. a = b;
  29729. b = d
  29730. }
  29731. return c.geom.ZPP_Collide.testCollide(a, b)
  29732. };
  29733. c.geom.ZPP_Collide.testCollide = function (a, b) {
  29734. return b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? function (d) {
  29735. d = !0;
  29736. for (var c = a.polygon.edges.head; null != c;) {
  29737. for (var e =
  29738. c.elt, f = 1E100, l = b.polygon.gverts.next; null != l;) {
  29739. var m = l,
  29740. m = e.gnormx * m.x + e.gnormy * m.y;
  29741. m < f && (f = m);
  29742. l = l.next
  29743. }
  29744. f -= e.gprojection;
  29745. if (0 < f) {
  29746. d = !1;
  29747. break
  29748. }
  29749. c = c.next
  29750. }
  29751. if (d)
  29752. for (c = b.polygon.edges.head; null != c;) {
  29753. e = c.elt;
  29754. f = 1E100;
  29755. for (l = a.polygon.gverts.next; null != l;) m = l, m = e.gnormx * m.x + e.gnormy * m.y, m < f && (f = m), l = l.next;
  29756. f -= e.gprojection;
  29757. if (0 < f) {
  29758. d = !1;
  29759. break
  29760. }
  29761. c = c.next
  29762. } else d = !1;
  29763. return d
  29764. }(this) : function (d) {
  29765. for (var c = null, e = null, f = !0, l = -1E100, m = b.polygon.gverts.next, h = b.polygon.edges.head; null != h;) {
  29766. var p = h.elt,
  29767. k = p.gnormx * a.circle.worldCOMx +
  29768. p.gnormy * a.circle.worldCOMy - p.gprojection - a.circle.radius;
  29769. if (0 < k) {
  29770. f = !1;
  29771. break
  29772. }
  29773. k > l && (l = k, c = p, e = m);
  29774. m = m.next;
  29775. h = h.next
  29776. }
  29777. return f ? function (d) {
  29778. var f = e,
  29779. l = null == e.next ? b.polygon.gverts.next : e.next,
  29780. m = a.circle.worldCOMy * c.gnormx - a.circle.worldCOMx * c.gnormy;
  29781. return m <= f.y * c.gnormx - f.x * c.gnormy ? function (b) {
  29782. b = a.circle.radius;
  29783. var d = 0,
  29784. c = 0,
  29785. d = f.x - a.circle.worldCOMx,
  29786. c = f.y - a.circle.worldCOMy;
  29787. return d * d + c * c <= b * b
  29788. }(d) : m >= l.y * c.gnormx - l.x * c.gnormy ? function (b) {
  29789. b = a.circle.radius;
  29790. var d = 0,
  29791. c = 0,
  29792. d = l.x - a.circle.worldCOMx,
  29793. c = l.y - a.circle.worldCOMy;
  29794. return d * d + c * c <= b * b
  29795. }(d) : !0
  29796. }(d) : !1
  29797. }(this) : function (d) {
  29798. d = a.circle.radius + b.circle.radius;
  29799. var c = 0,
  29800. e = 0,
  29801. c = b.circle.worldCOMx - a.circle.worldCOMx,
  29802. e = b.circle.worldCOMy - a.circle.worldCOMy;
  29803. return c * c + e * e <= d * d
  29804. }(this)
  29805. };
  29806. c.geom.ZPP_Collide.flowCollide = function (a, b, d) {
  29807. return b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? function (g) {
  29808. for (var e = [], f = [], l = !0, m = !0, u = a.polygon.edges.head; null != u;) {
  29809. for (var p = u.elt, k = 1E100, r = 0, n = b.polygon.gverts.next; null != n;) {
  29810. var w = n,
  29811. w = p.gnormx *
  29812. w.x + p.gnormy * w.y;
  29813. w < k && (k = w);
  29814. w >= p.gprojection + h.Config.epsilon && (f[r] = !0, m = !1);
  29815. r++;
  29816. n = n.next
  29817. }
  29818. k -= p.gprojection;
  29819. if (0 < k) {
  29820. l = !1;
  29821. break
  29822. }
  29823. u = u.next
  29824. }
  29825. m ? (b.polygon.validate_worldCOM(), d.overlap = b.polygon.area, d.centroidx = b.polygon.worldCOMx, d.centroidy = b.polygon.worldCOMy, null, g = !0) : g = l ? function (g) {
  29826. m = !0;
  29827. for (var u = b.polygon.edges.head; null != u;) {
  29828. for (var p = u.elt, k = 1E100, r = 0, n = a.polygon.gverts.next; null != n;) {
  29829. var w = n,
  29830. w = p.gnormx * w.x + p.gnormy * w.y;
  29831. w < k && (k = w);
  29832. w >= p.gprojection + h.Config.epsilon && (e[r] = !0, m = !1);
  29833. r++;
  29834. n = n.next
  29835. }
  29836. k -=
  29837. p.gprojection;
  29838. if (0 < k) {
  29839. l = !1;
  29840. break
  29841. }
  29842. u = u.next
  29843. }
  29844. m ? (a.polygon.validate_worldCOM(), d.overlap = a.polygon.area, d.centroidx = a.polygon.worldCOMx, d.centroidy = a.polygon.worldCOMy, null, g = !0) : g = l ? function (g) {
  29845. for (; null != c.geom.ZPP_Collide.flowpoly.head;) {
  29846. var l = c.geom.ZPP_Collide.flowpoly.pop_unsafe();
  29847. l._inuse || (null != l.outer && (l.outer.zpp_inner = null, l.outer = null), l._isimmutable = null, l._validate = null, l._invalidate = null, l.next = c.geom.ZPP_Vec2.zpp_pool, c.geom.ZPP_Vec2.zpp_pool = l)
  29848. }
  29849. for (var l = null, m = !1, u = a.polygon.gverts.next,
  29850. p = 0, k = b.polygon.gverts.next, r = 0, n = 0, w = b.polygon.edgeCnt; n < w;) {
  29851. var t = n++;
  29852. if (f[t]) k = k.next;
  29853. else {
  29854. r = t;
  29855. break
  29856. }
  29857. }
  29858. if (null == k) {
  29859. k = b.polygon.gverts.next;
  29860. m = !0;
  29861. n = 0;
  29862. for (w = a.polygon.edgeCnt; n < w;)
  29863. if (t = n++, e[t]) u = u.next;
  29864. else {
  29865. p = t;
  29866. break
  29867. }
  29868. null == u ? u = a.polygon.gverts.next : (c.geom.ZPP_Collide.flowpoly.add(u), l = c.geom.ZPP_Collide.flowpoly.head.elt)
  29869. } else c.geom.ZPP_Collide.flowpoly.add(k), l = c.geom.ZPP_Collide.flowpoly.head.elt;
  29870. var q = 1;
  29871. if (null == c.geom.ZPP_Collide.flowpoly.head) {
  29872. for (var t = !0, C = n = a.polygon.gverts.next, q = n.next; null !=
  29873. q;) {
  29874. for (var s = q, w = 2, x = !0, Q = b.polygon.gverts.next, B = Q, z = Q.next; null != z;) {
  29875. var y = z,
  29876. V = 0;
  29877. (function (a) {
  29878. var b = a = 0;
  29879. a = C.x - B.x;
  29880. var b = C.y - B.y,
  29881. d = 0,
  29882. c = 0,
  29883. d = s.x - C.x,
  29884. c = s.y - C.y,
  29885. e = 0,
  29886. f = 0,
  29887. e = y.x - B.x,
  29888. f = y.y - B.y,
  29889. g = c * e - d * f;
  29890. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  29891. return a
  29892. })(g) && V < w && (w = V, k = Q);
  29893. Q = z;
  29894. B = y;
  29895. z = z.next
  29896. }
  29897. x && (y = z = b.polygon.gverts.next, V = 0, function (a) {
  29898. var b = a = 0;
  29899. a = C.x - B.x;
  29900. var b = C.y -
  29901. B.y,
  29902. d = 0,
  29903. c = 0,
  29904. d = s.x - C.x,
  29905. c = s.y - C.y,
  29906. e = 0,
  29907. f = 0,
  29908. e = y.x - B.x,
  29909. f = y.y - B.y,
  29910. g = c * e - d * f;
  29911. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  29912. return a
  29913. }(g) && V < w && (w = V, k = Q));
  29914. if (2 != w) {
  29915. x = q = 0;
  29916. t = w;
  29917. q = C.x + (s.x - C.x) * t;
  29918. x = C.y + (s.y - C.y) * t;
  29919. l = c.geom.ZPP_Vec2.get(q, x, null);
  29920. c.geom.ZPP_Collide.flowpoly.add(l);
  29921. m = !0;
  29922. u = n;
  29923. t = !1;
  29924. break
  29925. }
  29926. n = q;
  29927. C = s;
  29928. q = q.next
  29929. }
  29930. if (t) {
  29931. s = q = a.polygon.gverts.next;
  29932. w = 2;
  29933. x = !0;
  29934. B = Q = b.polygon.gverts.next;
  29935. for (z = Q.next; null != z;) y = z, V = 0,
  29936. function (a) {
  29937. var b = a = 0;
  29938. a = C.x - B.x;
  29939. var b = C.y - B.y,
  29940. d = 0,
  29941. c = 0,
  29942. d = s.x - C.x,
  29943. c = s.y - C.y,
  29944. e = 0,
  29945. f = 0,
  29946. e = y.x - B.x,
  29947. f = y.y - B.y,
  29948. g = c * e - d * f;
  29949. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  29950. return a
  29951. }(g) && V < w && (w = V, k = Q), Q = z, B = y, z = z.next;
  29952. x && (y = z = b.polygon.gverts.next, V = 0, function (a) {
  29953. var b = a = 0;
  29954. a = C.x - B.x;
  29955. var b = C.y - B.y,
  29956. d = 0,
  29957. c = 0,
  29958. d = s.x - C.x,
  29959. c = s.y - C.y,
  29960. e = 0,
  29961. f = 0,
  29962. e = y.x - B.x,
  29963. f = y.y -
  29964. B.y,
  29965. g = c * e - d * f;
  29966. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  29967. return a
  29968. }(g) && V < w && (w = V, k = Q));
  29969. 2 != w && (x = q = 0, t = w, q = C.x + (s.x - C.x) * t, x = C.y + (s.y - C.y) * t, l = c.geom.ZPP_Vec2.get(q, x, null), c.geom.ZPP_Collide.flowpoly.add(l), m = !0, u = n)
  29970. }
  29971. q = 2
  29972. }
  29973. for (;;)
  29974. if (m)
  29975. if (u = u.next, p++, null == u && (u = a.polygon.gverts.next, p = 0), e[p]) {
  29976. B = c.geom.ZPP_Collide.flowpoly.head.elt;
  29977. y = u;
  29978. C = k;
  29979. z = k.next;
  29980. null == z && (z =
  29981. b.polygon.gverts.next);
  29982. t = -1;
  29983. n = null;
  29984. x = w = 0;
  29985. Q = z;
  29986. do {
  29987. s = z;
  29988. V = 0;
  29989. if (function (a) {
  29990. var b = a = 0;
  29991. a = C.x - B.x;
  29992. var b = C.y - B.y,
  29993. d = 0,
  29994. c = 0,
  29995. d = s.x - C.x,
  29996. c = s.y - C.y,
  29997. e = 0,
  29998. f = 0,
  29999. e = y.x - B.x,
  30000. f = y.y - B.y,
  30001. g = c * e - d * f;
  30002. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  30003. return a
  30004. }(g) && V >= t)
  30005. if (n = k, w = r, ++x == q) {
  30006. t = V;
  30007. z = Q;
  30008. break
  30009. } else t = V;
  30010. C = s;
  30011. k = z;
  30012. r++;
  30013. r >= b.polygon.edgeCnt && (r = 0);
  30014. z = z.next;
  30015. null == z && (z = b.polygon.gverts.next)
  30016. } while (0);
  30017. for (; z != Q;) {
  30018. s = z;
  30019. V = 0;
  30020. if (function (a) {
  30021. var b = a = 0;
  30022. a = C.x - B.x;
  30023. var b = C.y - B.y,
  30024. d = 0,
  30025. c = 0,
  30026. d = s.x - C.x,
  30027. c = s.y - C.y,
  30028. e = 0,
  30029. f = 0,
  30030. e = y.x - B.x,
  30031. f = y.y - B.y,
  30032. g = c * e - d * f;
  30033. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  30034. return a
  30035. }(g) && V >= t)
  30036. if (n = k, w = r, ++x == q) {
  30037. t = V;
  30038. z = Q;
  30039. break
  30040. } else t = V;
  30041. C = s;
  30042. k = z;
  30043. r++;
  30044. r >= b.polygon.edgeCnt && (r = 0);
  30045. z = z.next;
  30046. null == z && (z = b.polygon.gverts.next)
  30047. }
  30048. if (null == n) break;
  30049. Q = n;
  30050. q = n.next;
  30051. null == q &&
  30052. (q = b.polygon.gverts.next);
  30053. s = q;
  30054. x = q = 0;
  30055. q = Q.x + (s.x - Q.x) * t;
  30056. x = Q.y + (s.y - Q.y) * t;
  30057. if (null != l && c.geom.ZPP_VecMath.vec_dsq(q, x, l.x, l.y) < h.Config.epsilon) break;
  30058. c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(q, x, null));
  30059. null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
  30060. k = n;
  30061. r = w;
  30062. m = !m;
  30063. q = 2
  30064. } else {
  30065. n = u;
  30066. if (null != l && c.geom.ZPP_VecMath.vec_dsq(n.x, n.y, l.x, l.y) < h.Config.epsilon) break;
  30067. c.geom.ZPP_Collide.flowpoly.add(n);
  30068. null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
  30069. q = 1
  30070. } else if (k = k.next, r++, null == k && (k = b.polygon.gverts.next,
  30071. r = 0), f[r]) {
  30072. B = c.geom.ZPP_Collide.flowpoly.head.elt;
  30073. y = k;
  30074. C = u;
  30075. z = u.next;
  30076. null == z && (z = a.polygon.gverts.next);
  30077. t = -1;
  30078. n = null;
  30079. x = w = 0;
  30080. Q = z;
  30081. do {
  30082. s = z;
  30083. V = 0;
  30084. if (function (a) {
  30085. var b = a = 0;
  30086. a = C.x - B.x;
  30087. var b = C.y - B.y,
  30088. d = 0,
  30089. c = 0,
  30090. d = s.x - C.x,
  30091. c = s.y - C.y,
  30092. e = 0,
  30093. f = 0,
  30094. e = y.x - B.x,
  30095. f = y.y - B.y,
  30096. g = c * e - d * f;
  30097. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  30098. return a
  30099. }(g) && V >= t)
  30100. if (n = u, w = p, ++x == q) {
  30101. t = V;
  30102. z = Q;
  30103. break
  30104. } else t = V;
  30105. C = s;
  30106. u =
  30107. z;
  30108. p++;
  30109. p >= a.polygon.edgeCnt && (p = 0);
  30110. z = z.next;
  30111. null == z && (z = a.polygon.gverts.next)
  30112. } while (0);
  30113. for (; z != Q;) {
  30114. s = z;
  30115. V = 0;
  30116. if (function (a) {
  30117. var b = a = 0;
  30118. a = C.x - B.x;
  30119. var b = C.y - B.y,
  30120. d = 0,
  30121. c = 0,
  30122. d = s.x - C.x,
  30123. c = s.y - C.y,
  30124. e = 0,
  30125. f = 0,
  30126. e = y.x - B.x,
  30127. f = y.y - B.y,
  30128. g = c * e - d * f;
  30129. g * g > h.Config.epsilon * h.Config.epsilon ? (g = 1 / g, e = (f * a - e * b) * g, e > h.Config.epsilon && e < 1 - h.Config.epsilon ? (a = (c * a - d * b) * g, a > h.Config.epsilon && a < 1 - h.Config.epsilon ? (V = e, a = !0) : a = !1) : a = !1) : a = !1;
  30130. return a
  30131. }(g) && V >= t)
  30132. if (n = u, w = p, ++x == q) {
  30133. t = V;
  30134. z = Q;
  30135. break
  30136. } else t = V;
  30137. C = s;
  30138. u = z;
  30139. p++;
  30140. p >= a.polygon.edgeCnt &&
  30141. (p = 0);
  30142. z = z.next;
  30143. null == z && (z = a.polygon.gverts.next)
  30144. }
  30145. if (null == n) break;
  30146. Q = n;
  30147. q = n.next;
  30148. null == q && (q = a.polygon.gverts.next);
  30149. s = q;
  30150. x = q = 0;
  30151. q = Q.x + (s.x - Q.x) * t;
  30152. x = Q.y + (s.y - Q.y) * t;
  30153. if (null != l && c.geom.ZPP_VecMath.vec_dsq(q, x, l.x, l.y) < h.Config.epsilon) break;
  30154. c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(q, x, null));
  30155. null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
  30156. u = n;
  30157. p = w;
  30158. m = !m;
  30159. q = 2
  30160. } else {
  30161. n = k;
  30162. if (null != l && c.geom.ZPP_VecMath.vec_dsq(n.x, n.y, l.x, l.y) < h.Config.epsilon) break;
  30163. c.geom.ZPP_Collide.flowpoly.add(n);
  30164. null == l && (l =
  30165. c.geom.ZPP_Collide.flowpoly.head.elt);
  30166. q = 1
  30167. }
  30168. return null != c.geom.ZPP_Collide.flowpoly.head && null != c.geom.ZPP_Collide.flowpoly.head.next && null != c.geom.ZPP_Collide.flowpoly.head.next.next ? function (a) {
  30169. var b = a = 0,
  30170. e = 0;
  30171. a = e = b = 0;
  30172. for (var f = c.geom.ZPP_Collide.flowpoly.head, g = f.elt, f = f.next, l = f.elt, f = f.next; null != f;) {
  30173. var m = f.elt;
  30174. a += l.x * (m.y - g.y);
  30175. g = m.y * l.x - m.x * l.y;
  30176. b += (l.x + m.x) * g;
  30177. e += (l.y + m.y) * g;
  30178. g = l;
  30179. l = m;
  30180. f = f.next
  30181. }
  30182. f = c.geom.ZPP_Collide.flowpoly.head;
  30183. m = f.elt;
  30184. a += l.x * (m.y - g.y);
  30185. g = m.y * l.x - m.x * l.y;
  30186. b += (l.x + m.x) * g;
  30187. e += (l.y + m.y) *
  30188. g;
  30189. g = l;
  30190. l = m;
  30191. f = f.next;
  30192. f = f.elt;
  30193. a += l.x * (f.y - g.y);
  30194. g = f.y * l.x - f.x * l.y;
  30195. b += (l.x + f.x) * g;
  30196. e += (l.y + f.y) * g;
  30197. a *= 0.5;
  30198. l = 1 / (6 * a);
  30199. d.overlap = -a;
  30200. d.centroidx = b * l;
  30201. d.centroidy = e * l;
  30202. null;
  30203. return !0
  30204. }(g) : !1
  30205. }(g) : !1;
  30206. return g
  30207. }(g) : !1;
  30208. return g
  30209. }(this) : function (g) {
  30210. for (var e = [], f = !0, l = null, m = null, u = -1E100, p = !0, k = b.polygon.gverts.next, r = 0, n = b.polygon.edges.head; null != n;) {
  30211. var w = n.elt,
  30212. t = w.gnormx * a.circle.worldCOMx + w.gnormy * a.circle.worldCOMy;
  30213. if (t > w.gprojection + a.circle.radius) {
  30214. p = !1;
  30215. break
  30216. } else t + a.circle.radius > w.gprojection + h.Config.epsilon &&
  30217. (f = !1, e[r] = !0);
  30218. t -= w.gprojection + a.circle.radius;
  30219. t > u && (u = t, l = w, m = k);
  30220. k = k.next;
  30221. r++;
  30222. n = n.next
  30223. }
  30224. p ? f ? (d.overlap = a.circle.area, d.centroidx = a.circle.worldCOMx, d.centroidy = a.circle.worldCOMy, null, g = !0) : g = function (f) {
  30225. var g = m,
  30226. u = null == m.next ? b.polygon.gverts.next : m.next,
  30227. p = a.circle.worldCOMy * l.gnormx - a.circle.worldCOMx * l.gnormy;
  30228. return p <= g.y * l.gnormx - g.x * l.gnormy ? function (b) {
  30229. b = a.circle.radius;
  30230. var d = 0,
  30231. c = 0,
  30232. d = g.x - a.circle.worldCOMx,
  30233. c = g.y - a.circle.worldCOMy;
  30234. return d * d + c * c <= b * b
  30235. }(f) : p >= u.y * l.gnormx - u.x * l.gnormy ? function (b) {
  30236. b =
  30237. a.circle.radius;
  30238. var d = 0,
  30239. c = 0,
  30240. d = u.x - a.circle.worldCOMx,
  30241. c = u.y - a.circle.worldCOMy;
  30242. return d * d + c * c <= b * b
  30243. }(f) : function (f) {
  30244. for (var g = [], l = 0, m = !0, u = null, p = 0, k = b.polygon.gverts.next; null != k;) {
  30245. var r = k,
  30246. r = c.geom.ZPP_VecMath.vec_dsq(r.x, r.y, a.circle.worldCOMx, a.circle.worldCOMy);
  30247. (g[l] = r <= a.circle.radius * a.circle.radius) ? (p = l, u = k) : m = !1;
  30248. l++;
  30249. k = k.next
  30250. }
  30251. m ? (b.polygon.validate_worldCOM(), d.overlap = b.polygon.area, d.centroidx = b.polygon.worldCOMx, d.centroidy = b.polygon.worldCOMy, null, f = !0) : f = function (f) {
  30252. for (; null != c.geom.ZPP_Collide.flowpoly.head;) {
  30253. var l =
  30254. c.geom.ZPP_Collide.flowpoly.pop_unsafe();
  30255. l._inuse || (null != l.outer && (l.outer.zpp_inner = null, l.outer = null), l._isimmutable = null, l._validate = null, l._invalidate = null, l.next = c.geom.ZPP_Vec2.zpp_pool, c.geom.ZPP_Vec2.zpp_pool = l)
  30256. }
  30257. c.geom.ZPP_Collide.flowsegs.clear();
  30258. var l = null,
  30259. m = 1;
  30260. null == u ? (u = b.polygon.gverts.next, m = 2) : c.geom.ZPP_Collide.flowpoly.add(l = u);
  30261. for (; 0 != m;)
  30262. if (1 == m)
  30263. if (u = u.next, null == u && (u = b.polygon.gverts.next), p++, p >= b.polygon.edgeCnt && (p = 0), g[p]) {
  30264. if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, u.x, u.y) < h.Config.epsilon) break;
  30265. c.geom.ZPP_Collide.flowpoly.add(u)
  30266. } else {
  30267. var k = c.geom.ZPP_Collide.flowpoly.head.elt,
  30268. r = u,
  30269. m = function (b) {
  30270. var d = 0,
  30271. c = 0,
  30272. d = r.x - k.x,
  30273. c = r.y - k.y,
  30274. e = 0,
  30275. f = 0,
  30276. e = k.x - a.circle.worldCOMx,
  30277. f = k.y - a.circle.worldCOMy;
  30278. b = d * d + c * c;
  30279. d = 2 * (e * d + f * c);
  30280. e = Math.sqrt(d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius));
  30281. b = 1 / (2 * b);
  30282. f = (-d - e) * b;
  30283. return f < h.Config.epsilon ? (-d + e) * b : f
  30284. }(f),
  30285. n = 0,
  30286. w = 0,
  30287. w = m,
  30288. n = k.x + (r.x - k.x) * w,
  30289. w = k.y + (r.y - k.y) * w;
  30290. if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) break;
  30291. c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(n,
  30292. w, null));
  30293. m = 2
  30294. } else if (2 == m) {
  30295. var t = u.next;
  30296. null == t && (t = b.polygon.gverts.next);
  30297. var k = u,
  30298. m = 0,
  30299. q = t;
  30300. do {
  30301. var r = t,
  30302. C = p + 1;
  30303. C == b.polygon.edgeCnt && (C = 0);
  30304. if (e[p])
  30305. if (g[C]) {
  30306. m = function (b) {
  30307. var d = 0,
  30308. c = 0,
  30309. d = r.x - k.x,
  30310. c = r.y - k.y,
  30311. e = 0,
  30312. f = 0,
  30313. e = k.x - a.circle.worldCOMx,
  30314. f = k.y - a.circle.worldCOMy;
  30315. b = d * d + c * c;
  30316. d = 2 * (e * d + f * c);
  30317. e = Math.sqrt(d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius));
  30318. b = 1 / (2 * b);
  30319. f = (-d - e) * b;
  30320. return f < h.Config.epsilon ? (-d + e) * b : f
  30321. }(f);
  30322. w = n = 0;
  30323. w = m;
  30324. n = k.x + (r.x - k.x) * w;
  30325. w = k.y + (r.y - k.y) * w;
  30326. if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
  30327. m =
  30328. 0;
  30329. t = q;
  30330. break
  30331. }
  30332. n = c.geom.ZPP_Vec2.get(n, w, null);
  30333. c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt);
  30334. c.geom.ZPP_Collide.flowsegs.add(n);
  30335. c.geom.ZPP_Collide.flowpoly.add(n);
  30336. m = 1;
  30337. t = q;
  30338. break
  30339. } else {
  30340. var v = 0,
  30341. s = 0,
  30342. x = function (b) {
  30343. var d = 0,
  30344. c = 0,
  30345. d = r.x - k.x,
  30346. c = r.y - k.y,
  30347. e = 0,
  30348. f = 0,
  30349. e = k.x - a.circle.worldCOMx,
  30350. f = k.y - a.circle.worldCOMy;
  30351. b = d * d + c * c;
  30352. d = 2 * (e * d + f * c);
  30353. e = d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius);
  30354. e * e < h.Config.epsilon ? (v = 0 > e ? 10 : s = -d / (2 * b), b = !1) : (e = Math.sqrt(e), b = 1 / (2 * b), v = (-d - e) * b, s = (-d + e) * b, b = !0);
  30355. return b
  30356. }(f);
  30357. if (v < 1 - h.Config.epsilon && s > h.Config.epsilon) {
  30358. w = n = 0;
  30359. w = v;
  30360. n = k.x + (r.x - k.x) * w;
  30361. w = k.y + (r.y - k.y) * w;
  30362. if (null != l && c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
  30363. m = 0;
  30364. t = q;
  30365. break
  30366. }
  30367. n = c.geom.ZPP_Vec2.get(n, w, null);
  30368. null != c.geom.ZPP_Collide.flowpoly.head && (c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt), c.geom.ZPP_Collide.flowsegs.add(n));
  30369. c.geom.ZPP_Collide.flowpoly.add(n);
  30370. null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
  30371. x && (x = n = 0, w = s, n = k.x + (r.x - k.x) * w, x = k.y + (r.y - k.y) * w, c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(n,
  30372. x, null)))
  30373. }
  30374. }
  30375. k = r;
  30376. u = t;
  30377. p = C;
  30378. t = t.next;
  30379. null == t && (t = b.polygon.gverts.next)
  30380. } while (0);
  30381. for (; t != q;) {
  30382. r = t;
  30383. C = p + 1;
  30384. C == b.polygon.edgeCnt && (C = 0);
  30385. if (e[p])
  30386. if (g[C]) {
  30387. m = function (b) {
  30388. var d = 0,
  30389. c = 0,
  30390. d = r.x - k.x,
  30391. c = r.y - k.y,
  30392. e = 0,
  30393. f = 0,
  30394. e = k.x - a.circle.worldCOMx,
  30395. f = k.y - a.circle.worldCOMy;
  30396. b = d * d + c * c;
  30397. d = 2 * (e * d + f * c);
  30398. e = Math.sqrt(d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius));
  30399. b = 1 / (2 * b);
  30400. f = (-d - e) * b;
  30401. return f < h.Config.epsilon ? (-d + e) * b : f
  30402. }(f);
  30403. w = n = 0;
  30404. w = m;
  30405. n = k.x + (r.x - k.x) * w;
  30406. w = k.y + (r.y - k.y) * w;
  30407. if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
  30408. m =
  30409. 0;
  30410. t = q;
  30411. break
  30412. }
  30413. n = c.geom.ZPP_Vec2.get(n, w, null);
  30414. c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt);
  30415. c.geom.ZPP_Collide.flowsegs.add(n);
  30416. c.geom.ZPP_Collide.flowpoly.add(n);
  30417. m = 1;
  30418. t = q;
  30419. break
  30420. } else if (s = v = 0, x = function (b) {
  30421. var d = 0,
  30422. c = 0,
  30423. d = r.x - k.x,
  30424. c = r.y - k.y,
  30425. e = 0,
  30426. f = 0,
  30427. e = k.x - a.circle.worldCOMx,
  30428. f = k.y - a.circle.worldCOMy;
  30429. b = d * d + c * c;
  30430. d = 2 * (e * d + f * c);
  30431. e = d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius);
  30432. e * e < h.Config.epsilon ? (v = 0 > e ? 10 : s = -d / (2 * b), b = !1) : (e = Math.sqrt(e), b = 1 / (2 * b), v = (-d - e) * b, s = (-d + e) * b, b = !0);
  30433. return b
  30434. }(f),
  30435. v < 1 - h.Config.epsilon && s > h.Config.epsilon) {
  30436. w = n = 0;
  30437. w = v;
  30438. n = k.x + (r.x - k.x) * w;
  30439. w = k.y + (r.y - k.y) * w;
  30440. if (null != l && c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
  30441. m = 0;
  30442. t = q;
  30443. break
  30444. }
  30445. n = c.geom.ZPP_Vec2.get(n, w, null);
  30446. null != c.geom.ZPP_Collide.flowpoly.head && (c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt), c.geom.ZPP_Collide.flowsegs.add(n));
  30447. c.geom.ZPP_Collide.flowpoly.add(n);
  30448. null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
  30449. x && (x = n = 0, w = s, n = k.x + (r.x - k.x) * w, x = k.y + (r.y - k.y) * w, c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(n,
  30450. x, null)))
  30451. }
  30452. k = r;
  30453. u = t;
  30454. p = C;
  30455. t = t.next;
  30456. null == t && (t = b.polygon.gverts.next)
  30457. }
  30458. }
  30459. return null == c.geom.ZPP_Collide.flowpoly.head ? !1 : null == c.geom.ZPP_Collide.flowpoly.head.next ? function (c) {
  30460. c = !0;
  30461. for (var e = b.polygon.edges.head; null != e;) {
  30462. var f = e.elt;
  30463. if (f.gnormx * a.circle.worldCOMx + f.gnormy * a.circle.worldCOMy > f.gprojection) {
  30464. c = !1;
  30465. break
  30466. }
  30467. e = e.next
  30468. }
  30469. c ? (d.overlap = a.circle.area, d.centroidx = a.circle.worldCOMx, d.centroidy = a.circle.worldCOMy, null, c = !0) : c = !1;
  30470. return c
  30471. }(f) : function (b) {
  30472. var e = b = 0,
  30473. f = 0;
  30474. if (null != c.geom.ZPP_Collide.flowpoly.head.next.next) {
  30475. for (var g =
  30476. 0, l = 0, m = 0, g = m = l = 0, h = c.geom.ZPP_Collide.flowpoly.head, u = h.elt, h = h.next, k = h.elt, h = h.next; null != h;) var p = h.elt,
  30477. g = g + k.x * (p.y - u.y),
  30478. u = p.y * k.x - p.x * k.y,
  30479. l = l + (k.x + p.x) * u,
  30480. m = m + (k.y + p.y) * u,
  30481. u = k,
  30482. k = p,
  30483. h = h.next;
  30484. h = c.geom.ZPP_Collide.flowpoly.head;
  30485. p = h.elt;
  30486. g += k.x * (p.y - u.y);
  30487. u = p.y * k.x - p.x * k.y;
  30488. l += (k.x + p.x) * u;
  30489. m += (k.y + p.y) * u;
  30490. u = k;
  30491. k = p;
  30492. h = h.next;
  30493. h = h.elt;
  30494. g += k.x * (h.y - u.y);
  30495. u = h.y * k.x - h.x * k.y;
  30496. l += (k.x + h.x) * u;
  30497. m += (k.y + h.y) * u;
  30498. g *= 0.5;
  30499. h = 1 / (6 * g);
  30500. l *= h;
  30501. m *= h;
  30502. h = -g;
  30503. b += l * h;
  30504. e += m * h;
  30505. f -= g
  30506. } else c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt),
  30507. c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.next.elt);
  30508. for (; null != c.geom.ZPP_Collide.flowsegs.head;) u = c.geom.ZPP_Collide.flowsegs.pop_unsafe(), k = c.geom.ZPP_Collide.flowsegs.pop_unsafe(), m = h = 0, h = k.x - u.x, m = k.y - u.y, l = g = 0, g = h, l = m, h = 1 / Math.sqrt(g * g + l * l), g *= h, l *= h, h = g, g = -l, l = h, p = m = 0, m = u.x + k.x, p = u.y + k.y, h = 0.5, m *= h, p *= h, h = 1, m -= a.circle.worldCOMx * h, p -= a.circle.worldCOMy * h, u = k = 0, k = g * m + l * p, u = k / a.circle.radius, h = Math.sqrt(1 - u * u), m = Math.acos(u), k = a.circle.radius * (a.circle.radius * m - k * h), u = 2 /
  30509. 3 * a.circle.radius * h * h * h / (m - u * h), m = a.circle.worldCOMx, p = a.circle.worldCOMy, h = u, m += g * h, p += l * h, h = k, b += m * h, e += p * h, f += k;
  30510. h = 1 / f;
  30511. d.overlap = f;
  30512. d.centroidx = b * h;
  30513. d.centroidy = e * h;
  30514. null;
  30515. return !0
  30516. }(f)
  30517. }(f);
  30518. return f
  30519. }(f)
  30520. }(g) : g = !1;
  30521. return g
  30522. }(this) : function (c) {
  30523. c = a.circle;
  30524. var e = b.circle,
  30525. f = 0,
  30526. l = 0,
  30527. f = e.worldCOMx - c.worldCOMx,
  30528. l = e.worldCOMy - c.worldCOMy,
  30529. m = c.radius + e.radius,
  30530. u = f * f + l * l;
  30531. if (u > m * m) c = !1;
  30532. else {
  30533. if (u < h.Config.epsilon * h.Config.epsilon) c.radius < e.radius ? (d.overlap = c.area, d.centroidx = c.worldCOMx, d.centroidy = c.worldCOMy) : (d.overlap =
  30534. e.area, d.centroidx = e.worldCOMx, d.centroidy = e.worldCOMy);
  30535. else {
  30536. var m = Math.sqrt(u),
  30537. u = 1 / m,
  30538. k = 0.5 * (m - (e.radius * e.radius - c.radius * c.radius) * u);
  30539. if (k <= -c.radius) d.overlap = c.area, d.centroidx = c.worldCOMx, d.centroidy = c.worldCOMy;
  30540. else {
  30541. var n = m - k;
  30542. if (n <= -e.radius) d.overlap = e.area, d.centroidx = e.worldCOMx, d.centroidy = e.worldCOMy;
  30543. else {
  30544. var r = 0,
  30545. q = 0,
  30546. w = 0,
  30547. t = 0,
  30548. w = k,
  30549. t = w / c.radius,
  30550. k = Math.sqrt(1 - t * t),
  30551. s = Math.acos(t),
  30552. r = c.radius * (c.radius * s - w * k),
  30553. q = 2 / 3 * c.radius * k * k * k / (s - t * k),
  30554. w = n,
  30555. t = w / e.radius,
  30556. k = Math.sqrt(1 - t * t),
  30557. s = Math.acos(t),
  30558. w = e.radius *
  30559. (e.radius * s - w * k),
  30560. t = 2 / 3 * e.radius * k * k * k / (s - t * k),
  30561. e = r + w,
  30562. m = (q * r + (m - t) * w) / e * u;
  30563. d.overlap = e;
  30564. d.centroidx = c.worldCOMx + f * m;
  30565. d.centroidy = c.worldCOMy + l * m
  30566. }
  30567. }
  30568. }
  30569. null;
  30570. c = !0
  30571. }
  30572. return c
  30573. }(this)
  30574. };
  30575. c.geom.ZPP_Convex = function () {};
  30576. s["zpp_nape.geom.ZPP_Convex"] = c.geom.ZPP_Convex;
  30577. c.geom.ZPP_Convex.__name__ = ["zpp_nape", "geom", "ZPP_Convex"];
  30578. c.geom.ZPP_Convex.isinner = function (a, b, d) {
  30579. var c = 0,
  30580. e = 0,
  30581. c = a.x - b.x,
  30582. e = a.y - b.y,
  30583. f = a = 0;
  30584. a = d.x - b.x;
  30585. f = d.y - b.y;
  30586. return 0 <= f * c - a * e
  30587. };
  30588. c.geom.ZPP_Convex.optimise = function (a) {
  30589. var b = a.vertices,
  30590. d = a.vertices;
  30591. if (null !=
  30592. b) {
  30593. do {
  30594. var g = b;
  30595. g.sort();
  30596. b = b.next
  30597. } while (b != d)
  30598. }
  30599. d = b = a.vertices;
  30600. if (null != b) {
  30601. do {
  30602. g = b;
  30603. a = g.prev;
  30604. for (var e = null, f = g.diagonals.head; null != f;) {
  30605. var l = f.elt;
  30606. if (c.geom.ZPP_Convex.isinner(null == f.next ? g.next : f.next.elt, g, a)) {
  30607. for (var m = !0, h = l, k = h.prev, n = null, r = h.diagonals.head; null != r;) {
  30608. var q = r.elt;
  30609. if (q == g) {
  30610. m = c.geom.ZPP_Convex.isinner(null == r.next ? h.next : r.next.elt, h, k);
  30611. break
  30612. }
  30613. k = q;
  30614. n = r;
  30615. r = r.next
  30616. }
  30617. m ? (f = g.diagonals.erase(e), h.diagonals.erase(n)) : (a = l, e = f, f = f.next)
  30618. } else e = f, a = l, f = f.next
  30619. }
  30620. b = b.next
  30621. } while (b != d)
  30622. }
  30623. };
  30624. c.geom.ZPP_ConvexRayResult =
  30625. function () {
  30626. this.toiDistance = 0;
  30627. this.next = null;
  30628. this.inner = !1;
  30629. this.normal = this.shape = this.convex = this.position = this.ray = null
  30630. };
  30631. s["zpp_nape.geom.ZPP_ConvexRayResult"] = c.geom.ZPP_ConvexRayResult;
  30632. c.geom.ZPP_ConvexRayResult.__name__ = ["zpp_nape", "geom", "ZPP_ConvexRayResult"];
  30633. c.geom.ZPP_ConvexRayResult.getRay = function (a, b, d, g) {
  30634. var e;
  30635. null == c.geom.ZPP_ConvexRayResult.rayPool ? (c.geom.ZPP_ConvexRayResult.internal = !0, e = new h.geom.RayResult, e.zpp_inner = new c.geom.ZPP_ConvexRayResult, e.zpp_inner.ray = e, c.geom.ZPP_ConvexRayResult.internal = !1) : (e = c.geom.ZPP_ConvexRayResult.rayPool.ray, c.geom.ZPP_ConvexRayResult.rayPool = c.geom.ZPP_ConvexRayResult.rayPool.next, e.zpp_inner.next = null);
  30636. var f = e.zpp_inner;
  30637. f.normal = a;
  30638. a.zpp_inner._immutable = !0;
  30639. f.toiDistance = b;
  30640. f.inner = d;
  30641. f.shape = g;
  30642. return e
  30643. };
  30644. c.geom.ZPP_ConvexRayResult.getConvex = function (a, b, d, g) {
  30645. var e;
  30646. null == c.geom.ZPP_ConvexRayResult.convexPool ? (c.geom.ZPP_ConvexRayResult.internal = !0, e = new h.geom.ConvexResult, e.zpp_inner = new c.geom.ZPP_ConvexRayResult, e.zpp_inner.convex = e, c.geom.ZPP_ConvexRayResult.internal = !1) : (e = c.geom.ZPP_ConvexRayResult.convexPool.convex, c.geom.ZPP_ConvexRayResult.convexPool = c.geom.ZPP_ConvexRayResult.convexPool.next, e.zpp_inner.next = null);
  30647. var f = e.zpp_inner;
  30648. f.normal = a;
  30649. f.position = b;
  30650. a.zpp_inner._immutable = !0;
  30651. b.zpp_inner._immutable = !0;
  30652. f.toiDistance = d;
  30653. f.shape = g;
  30654. return e
  30655. };
  30656. c.geom.ZPP_ConvexRayResult.prototype = {
  30657. free: function () {
  30658. this.normal.zpp_inner._immutable = !1;
  30659. this.normal.dispose();
  30660. null != this.position && (this.position.zpp_inner._immutable = !1, this.position.dispose());
  30661. this.shape = null;
  30662. this.toiDistance =
  30663. 0;
  30664. null != this.convex ? (this.next = c.geom.ZPP_ConvexRayResult.convexPool, c.geom.ZPP_ConvexRayResult.convexPool = this) : (this.next = c.geom.ZPP_ConvexRayResult.rayPool, c.geom.ZPP_ConvexRayResult.rayPool = this)
  30665. },
  30666. disposed: function () {
  30667. if (null != this.next) throw "Error: This object has been disposed of and cannot be used";
  30668. },
  30669. __class__: c.geom.ZPP_ConvexRayResult
  30670. };
  30671. c.geom.ZPP_CutVert = function () {
  30672. this.used = !1;
  30673. this.rank = 0;
  30674. this.parent = null;
  30675. this.positive = !1;
  30676. this.value = 0;
  30677. this.vert = null;
  30678. this.posx = this.posy = 0;
  30679. this.prev = this.next =
  30680. null
  30681. };
  30682. s["zpp_nape.geom.ZPP_CutVert"] = c.geom.ZPP_CutVert;
  30683. c.geom.ZPP_CutVert.__name__ = ["zpp_nape", "geom", "ZPP_CutVert"];
  30684. c.geom.ZPP_CutVert.path = function (a) {
  30685. var b;
  30686. null == c.geom.ZPP_CutVert.zpp_pool ? b = new c.geom.ZPP_CutVert : (b = c.geom.ZPP_CutVert.zpp_pool, c.geom.ZPP_CutVert.zpp_pool = b.next, b.next = null);
  30687. null;
  30688. b.vert = a;
  30689. b.parent = b;
  30690. b.rank = 0;
  30691. b.used = !1;
  30692. return b
  30693. };
  30694. c.geom.ZPP_CutVert.prototype = {
  30695. free: function () {
  30696. this.parent = this.vert = null
  30697. },
  30698. alloc: function () {},
  30699. __class__: c.geom.ZPP_CutVert
  30700. };
  30701. c.geom.ZPP_CutInt = function () {
  30702. this.path0 =
  30703. this.end = this.start = this.path1 = null;
  30704. this.virtualint = this.vertex = !1;
  30705. this.time = 0;
  30706. this.next = null
  30707. };
  30708. s["zpp_nape.geom.ZPP_CutInt"] = c.geom.ZPP_CutInt;
  30709. c.geom.ZPP_CutInt.__name__ = ["zpp_nape", "geom", "ZPP_CutInt"];
  30710. c.geom.ZPP_CutInt.get = function (a, b, d, g, e, f, l) {
  30711. null == l && (l = !1);
  30712. null == f && (f = !1);
  30713. var m;
  30714. null == c.geom.ZPP_CutInt.zpp_pool ? m = new c.geom.ZPP_CutInt : (m = c.geom.ZPP_CutInt.zpp_pool, c.geom.ZPP_CutInt.zpp_pool = m.next, m.next = null);
  30715. null;
  30716. m.virtualint = f;
  30717. m.end = b;
  30718. m.start = d;
  30719. m.path0 = g;
  30720. m.path1 = e;
  30721. m.time = a;
  30722. m.vertex = l;
  30723. return m
  30724. };
  30725. c.geom.ZPP_CutInt.prototype = {
  30726. free: function () {
  30727. this.path0 = this.path1 = this.end = this.start = null
  30728. },
  30729. alloc: function () {},
  30730. __class__: c.geom.ZPP_CutInt
  30731. };
  30732. c.geom.ZPP_Cutter = function () {};
  30733. s["zpp_nape.geom.ZPP_Cutter"] = c.geom.ZPP_Cutter;
  30734. c.geom.ZPP_Cutter.__name__ = ["zpp_nape", "geom", "ZPP_Cutter"];
  30735. c.geom.ZPP_Cutter.run = function (a, b, d, g, e, f) {
  30736. var l = 0,
  30737. m = 0;
  30738. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  30739. b.zpp_inner.validate();
  30740. l = b.zpp_inner.x;
  30741. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  30742. b.zpp_inner.validate();
  30743. var m = b.zpp_inner.y,
  30744. u = b = 0;
  30745. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  30746. d.zpp_inner.validate();
  30747. b = d.zpp_inner.x - l;
  30748. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  30749. d.zpp_inner.validate();
  30750. u = d.zpp_inner.y - m;
  30751. d = g ? 0 : Math.NEGATIVE_INFINITY;
  30752. e = e ? 1 : Math.POSITIVE_INFINITY;
  30753. g = -(m * b - l * u);
  30754. var k = null,
  30755. n = !1,
  30756. r = a;
  30757. do {
  30758. var q;
  30759. null == c.geom.ZPP_CutVert.zpp_pool ? q = new c.geom.ZPP_CutVert : (q = c.geom.ZPP_CutVert.zpp_pool, c.geom.ZPP_CutVert.zpp_pool =
  30760. q.next, q.next = null);
  30761. null;
  30762. q.vert = r;
  30763. q.posx = q.vert.x;
  30764. q.posy = q.vert.y;
  30765. q.value = q.posy * b - q.posx * u + g;
  30766. q.positive = 0 < q.value;
  30767. 0 == q.value && (n = !0);
  30768. k = function (a) {
  30769. a = q;
  30770. null == k ? k = a.prev = a.next = a : (a.prev = k, a.next = k.next, k.next.prev = a, k.next = a);
  30771. return a
  30772. }(this);
  30773. r = r.next
  30774. } while (r != a);
  30775. if (n) {
  30776. g = null;
  30777. var w = k,
  30778. n = k;
  30779. if (null != w) {
  30780. do {
  30781. var t = w;
  30782. if (0 != t.value) {
  30783. g = t;
  30784. break
  30785. }
  30786. w = w.next
  30787. } while (w != n)
  30788. }
  30789. var s = 0,
  30790. y = 0,
  30791. s = b,
  30792. y = u,
  30793. A = 1 / Math.sqrt(s * s + y * y),
  30794. s = s * A,
  30795. y = y * A,
  30796. A = s,
  30797. s = -y,
  30798. y = A,
  30799. n = null,
  30800. t = g;
  30801. do {
  30802. if (0 == t.value || null != n && t != n.next) {
  30803. if (r = n.value * t.value, 0 != r) {
  30804. var z =
  30805. n.next,
  30806. r = 0 < r ? n.positive : function (b) {
  30807. b = z.next;
  30808. var d = 0,
  30809. c = 0,
  30810. d = z.posx + b.posx,
  30811. c = z.posy + b.posy;
  30812. b = 0.5 * d + 1E-8 * s;
  30813. c = 0.5 * c + 1E-8 * y;
  30814. d = !1;
  30815. if (null != a) {
  30816. var e = a;
  30817. do {
  30818. var f = e,
  30819. g = f.prev;
  30820. (f.y < c && g.y >= c || g.y < c && f.y >= c) && (f.x <= b || g.x <= b) && f.x + (c - f.y) / (g.y - f.y) * (g.x - f.x) < b && (d = !d);
  30821. e = e.next
  30822. } while (e != a)
  30823. }
  30824. return d
  30825. }(this),
  30826. w = z,
  30827. n = t;
  30828. if (null != w) {
  30829. do {
  30830. var x = w;
  30831. x.positive = r;
  30832. w = w.next
  30833. } while (w != n)
  30834. }
  30835. n = t
  30836. }
  30837. } else n = t;
  30838. t = t.next
  30839. } while (t != g);
  30840. if (0 == t.value || null != n && t != n.next) {
  30841. if (r = n.value * t.value, 0 != r) {
  30842. z = n.next;
  30843. r = 0 < r ? n.positive : function (b) {
  30844. b = z.next;
  30845. var d = 0,
  30846. c = 0,
  30847. d = z.posx + b.posx,
  30848. c = z.posy + b.posy;
  30849. b = 0.5 * d + 1E-8 * s;
  30850. c = 0.5 * c + 1E-8 * y;
  30851. d = !1;
  30852. if (null != a) {
  30853. var e = a;
  30854. do {
  30855. var f = e,
  30856. g = f.prev;
  30857. (f.y < c && g.y >= c || g.y < c && f.y >= c) && (f.x <= b || g.x <= b) && f.x + (c - f.y) / (g.y - f.y) * (g.x - f.x) < b && (d = !d);
  30858. e = e.next
  30859. } while (e != a)
  30860. }
  30861. return d
  30862. }(this);
  30863. w = z;
  30864. n = t;
  30865. if (null != w) {
  30866. do x = w, x.positive = r, w = w.next; while (w != n)
  30867. }
  30868. n = t
  30869. }
  30870. } else n = t;
  30871. t = t.next
  30872. }
  30873. null == c.geom.ZPP_Cutter.ints && (c.geom.ZPP_Cutter.ints = new c.util.ZNPList_ZPP_CutInt);
  30874. null == c.geom.ZPP_Cutter.paths && (c.geom.ZPP_Cutter.paths = new c.util.ZNPList_ZPP_CutVert);
  30875. g = null;
  30876. var B = c.geom.ZPP_GeomVert.get(k.posx, k.posy);
  30877. null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B);
  30878. B;
  30879. var n = g,
  30880. v = c.geom.ZPP_CutVert.path(g);
  30881. c.geom.ZPP_Cutter.paths.add(v);
  30882. r = k;
  30883. do {
  30884. var H = r.next,
  30885. x = c.geom.ZPP_GeomVert.get(H.posx, H.posy);
  30886. if (r.positive == H.positive) B = x, null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B;
  30887. else {
  30888. var D = 0,
  30889. B = 0,
  30890. D = H.posx - r.posx,
  30891. B = H.posy - r.posy,
  30892. E = u * D - b * B,
  30893. E = 1 / E,
  30894. F = 0,
  30895. A = 0,
  30896. F = l - r.posx,
  30897. A = m - r.posy,
  30898. w = (B * F - D * A) * E;
  30899. w < d || w > e ? (c.geom.ZPP_Cutter.ints.add(c.geom.ZPP_CutInt.get(w,
  30900. null, null, null, null, !0, null)), B = x, null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B) : 0 == r.value ? (D = g.prev, g = null, B = c.geom.ZPP_GeomVert.get(D.x, D.y), null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B, B = x, null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B, x = c.geom.ZPP_Cutter.paths.head.elt, c.geom.ZPP_Cutter.paths.add(c.geom.ZPP_CutVert.path(g)), B = c.geom.ZPP_Cutter.paths.head.elt, c.geom.ZPP_Cutter.ints.add(c.geom.ZPP_CutInt.get(w,
  30901. D, g, x, B, !0, null))) : 0 == H.value ? (B = x, null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B, D = g.prev, g = null, B = c.geom.ZPP_GeomVert.get(H.posx, H.posy), null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B, x = c.geom.ZPP_Cutter.paths.head.elt, c.geom.ZPP_Cutter.paths.add(c.geom.ZPP_CutVert.path(g)), B = c.geom.ZPP_Cutter.paths.head.elt, c.geom.ZPP_Cutter.ints.add(c.geom.ZPP_CutInt.get(w, D, g, x, B, !0, null))) : (A = (u * F - b * A) * E, F = E = 0, E = r.posx, F = r.posy, E += D * A, F += B * A, B = c.geom.ZPP_GeomVert.get(E,
  30902. F), null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B, D = g.prev, g = null, B = c.geom.ZPP_GeomVert.get(E, F), null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B, B = x, null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B), B, x = c.geom.ZPP_Cutter.paths.head.elt, c.geom.ZPP_Cutter.paths.add(c.geom.ZPP_CutVert.path(g)), B = c.geom.ZPP_Cutter.paths.head.elt, c.geom.ZPP_Cutter.ints.add(c.geom.ZPP_CutInt.get(w, D, g, x, B, !1, null)))
  30903. }
  30904. r = r.next
  30905. } while (r != k);
  30906. D =
  30907. g.prev;
  30908. D.next.prev = n.prev;
  30909. n.prev.next = D.next;
  30910. D.next = n;
  30911. n.prev = D;
  30912. var G = c.geom.ZPP_Cutter.paths.head.elt,
  30913. l = v == v.parent ? v : function (a) {
  30914. a = v;
  30915. for (var b = null; a != a.parent;) {
  30916. var d = a.parent;
  30917. a.parent = b;
  30918. b = a;
  30919. a = d
  30920. }
  30921. for (; null != b;) d = b.parent, b.parent = a, b = d;
  30922. return a
  30923. }(this),
  30924. m = G == G.parent ? G : function (a) {
  30925. a = G;
  30926. for (var b = null; a != a.parent;) {
  30927. var d = a.parent;
  30928. a.parent = b;
  30929. b = a;
  30930. a = d
  30931. }
  30932. for (; null != b;) d = b.parent, b.parent = a, b = d;
  30933. return a
  30934. }(this);
  30935. l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent = l : (m.parent = l, l.rank++));
  30936. l = c.geom.ZPP_Cutter.ints;
  30937. if (null != l.head && null != l.head.next) {
  30938. m = l.head;
  30939. e = d = u = b = null;
  30940. g = 1;
  30941. do {
  30942. n = 0;
  30943. u = m;
  30944. for (b = m = null; null != u;) {
  30945. n++;
  30946. d = u;
  30947. r = 0;
  30948. for (w = g; null != d && r < g;) r++, d = d.next;
  30949. for (; 0 < r || 0 < w && null != d;) 0 == r ? (e = d, d = d.next, w--) : 0 == w || null == d ? (e = u, u = u.next, r--) : u.elt.time < d.elt.time ? (e = u, u = u.next, r--) : (e = d, d = d.next, w--), null != b ? b.next = e : m = e, b = e;
  30950. u = d
  30951. }
  30952. b.next = null;
  30953. g <<= 1
  30954. } while (1 < n);
  30955. l.head = m;
  30956. l.modified = !0;
  30957. l.pushmod = !0
  30958. }
  30959. for (; null != c.geom.ZPP_Cutter.ints.head;) {
  30960. var L = c.geom.ZPP_Cutter.ints.pop_unsafe(),
  30961. H = c.geom.ZPP_Cutter.ints.pop_unsafe();
  30962. L.virtualint ||
  30963. H.virtualint ? L.virtualint && !H.virtualint ? (H.end = null != H.end && H.end.prev == H.end ? function (a) {
  30964. H.end.next = H.end.prev = null;
  30965. a = H.end;
  30966. null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
  30967. a.prev = a.next = null;
  30968. a.next = c.geom.ZPP_GeomVert.zpp_pool;
  30969. c.geom.ZPP_GeomVert.zpp_pool = a;
  30970. return null
  30971. }(this) : function (a) {
  30972. a = H.end.prev;
  30973. H.end.prev.next = H.end.next;
  30974. H.end.next.prev = H.end.prev;
  30975. H.end.next = H.end.prev = null;
  30976. var b = H.end;
  30977. null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
  30978. b.prev = b.next =
  30979. null;
  30980. b.next = c.geom.ZPP_GeomVert.zpp_pool;
  30981. c.geom.ZPP_GeomVert.zpp_pool = b;
  30982. H.end = null;
  30983. return a
  30984. }(this), H.vertex || (H.end != H.path0.vert ? (H.start.x = H.end.x, H.start.y = H.end.y, H.end = null != H.end && H.end.prev == H.end ? function (a) {
  30985. H.end.next = H.end.prev = null;
  30986. a = H.end;
  30987. null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
  30988. a.prev = a.next = null;
  30989. a.next = c.geom.ZPP_GeomVert.zpp_pool;
  30990. c.geom.ZPP_GeomVert.zpp_pool = a;
  30991. return null
  30992. }(this) : function (a) {
  30993. a = H.end.prev;
  30994. H.end.prev.next = H.end.next;
  30995. H.end.next.prev = H.end.prev;
  30996. H.end.next = H.end.prev = null;
  30997. var b = H.end;
  30998. null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
  30999. b.prev = b.next = null;
  31000. b.next = c.geom.ZPP_GeomVert.zpp_pool;
  31001. c.geom.ZPP_GeomVert.zpp_pool = b;
  31002. H.end = null;
  31003. return a
  31004. }(this)) : (l = H.start.next, H.start.x = l.x, H.start.y = l.y, null != l && l.prev == l ? (l.next = l.prev = null, null != l.wrap && (l.wrap.zpp_inner._inuse = !1, l.wrap.dispose(), l.wrap = null), l.prev = l.next = null, l.next = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = l, l = null) : (l.prev.next = l.next, l.next.prev =
  31005. l.prev, l.next = l.prev = null, null != l.wrap && (l.wrap.zpp_inner._inuse = !1, l.wrap.dispose(), l.wrap = null), l.prev = l.next = null, l.next = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = l))), H.end.next.prev = H.start.prev, H.start.prev.next = H.end.next, H.end.next = H.start, H.start.prev = H.end, l = H.path0 == H.path0.parent ? H.path0 : function (a) {
  31006. a = H.path0;
  31007. for (var b = null; a != a.parent;) {
  31008. var d = a.parent;
  31009. a.parent = b;
  31010. b = a;
  31011. a = d
  31012. }
  31013. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31014. return a
  31015. }(this), m = H.path1 == H.path1.parent ? H.path1 : function (a) {
  31016. a =
  31017. H.path1;
  31018. for (var b = null; a != a.parent;) {
  31019. var d = a.parent;
  31020. a.parent = b;
  31021. b = a;
  31022. a = d
  31023. }
  31024. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31025. return a
  31026. }(this), l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent = l : (m.parent = l, l.rank++))) : H.virtualint && !L.virtualint && (L.end = null != L.end && L.end.prev == L.end ? function (a) {
  31027. L.end.next = L.end.prev = null;
  31028. a = L.end;
  31029. null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
  31030. a.prev = a.next = null;
  31031. a.next = c.geom.ZPP_GeomVert.zpp_pool;
  31032. c.geom.ZPP_GeomVert.zpp_pool = a;
  31033. return null
  31034. }(this) : function (a) {
  31035. a =
  31036. L.end.prev;
  31037. L.end.prev.next = L.end.next;
  31038. L.end.next.prev = L.end.prev;
  31039. L.end.next = L.end.prev = null;
  31040. var b = L.end;
  31041. null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
  31042. b.prev = b.next = null;
  31043. b.next = c.geom.ZPP_GeomVert.zpp_pool;
  31044. c.geom.ZPP_GeomVert.zpp_pool = b;
  31045. L.end = null;
  31046. return a
  31047. }(this), L.vertex || (L.end != L.path0.vert ? (L.start.x = L.end.x, L.start.y = L.end.y, L.end = null != L.end && L.end.prev == L.end ? function (a) {
  31048. L.end.next = L.end.prev = null;
  31049. a = L.end;
  31050. null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap =
  31051. null);
  31052. a.prev = a.next = null;
  31053. a.next = c.geom.ZPP_GeomVert.zpp_pool;
  31054. c.geom.ZPP_GeomVert.zpp_pool = a;
  31055. return null
  31056. }(this) : function (a) {
  31057. a = L.end.prev;
  31058. L.end.prev.next = L.end.next;
  31059. L.end.next.prev = L.end.prev;
  31060. L.end.next = L.end.prev = null;
  31061. var b = L.end;
  31062. null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
  31063. b.prev = b.next = null;
  31064. b.next = c.geom.ZPP_GeomVert.zpp_pool;
  31065. c.geom.ZPP_GeomVert.zpp_pool = b;
  31066. L.end = null;
  31067. return a
  31068. }(this)) : (l = L.start.next, L.start.x = l.x, L.start.y = l.y, null != l && l.prev == l ? (l.next = l.prev = null, null !=
  31069. l.wrap && (l.wrap.zpp_inner._inuse = !1, l.wrap.dispose(), l.wrap = null), l.prev = l.next = null, l.next = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = l, l = null) : (l.prev.next = l.next, l.next.prev = l.prev, l.next = l.prev = null, null != l.wrap && (l.wrap.zpp_inner._inuse = !1, l.wrap.dispose(), l.wrap = null), l.prev = l.next = null, l.next = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = l))), L.end.next.prev = L.start.prev, L.start.prev.next = L.end.next, L.end.next = L.start, L.start.prev = L.end, l = L.path0 == L.path0.parent ?
  31070. L.path0 : function (a) {
  31071. a = L.path0;
  31072. for (var b = null; a != a.parent;) {
  31073. var d = a.parent;
  31074. a.parent = b;
  31075. b = a;
  31076. a = d
  31077. }
  31078. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31079. return a
  31080. }(this), m = L.path1 == L.path1.parent ? L.path1 : function (a) {
  31081. a = L.path1;
  31082. for (var b = null; a != a.parent;) {
  31083. var d = a.parent;
  31084. a.parent = b;
  31085. b = a;
  31086. a = d
  31087. }
  31088. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31089. return a
  31090. }(this), l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent = l : (m.parent = l, l.rank++))) : (L.end.next.prev = H.start.prev, H.start.prev.next = L.end.next, L.end.next = H.start, H.start.prev = L.end,
  31091. H.end.next.prev = L.start.prev, L.start.prev.next = H.end.next, H.end.next = L.start, L.start.prev = H.end, l = L.path0 == L.path0.parent ? L.path0 : function (a) {
  31092. a = L.path0;
  31093. for (var b = null; a != a.parent;) {
  31094. var d = a.parent;
  31095. a.parent = b;
  31096. b = a;
  31097. a = d
  31098. }
  31099. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31100. return a
  31101. }(this), m = H.path1 == H.path1.parent ? H.path1 : function (a) {
  31102. a = H.path1;
  31103. for (var b = null; a != a.parent;) {
  31104. var d = a.parent;
  31105. a.parent = b;
  31106. b = a;
  31107. a = d
  31108. }
  31109. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31110. return a
  31111. }(this), l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent =
  31112. l : (m.parent = l, l.rank++)), l = L.path1 == L.path1.parent ? L.path1 : function (a) {
  31113. a = L.path1;
  31114. for (var b = null; a != a.parent;) {
  31115. var d = a.parent;
  31116. a.parent = b;
  31117. b = a;
  31118. a = d
  31119. }
  31120. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31121. return a
  31122. }(this), m = H.path0 == H.path0.parent ? H.path0 : function (a) {
  31123. a = H.path0;
  31124. for (var b = null; a != a.parent;) {
  31125. var d = a.parent;
  31126. a.parent = b;
  31127. b = a;
  31128. a = d
  31129. }
  31130. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31131. return a
  31132. }(this), l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent = l : (m.parent = l, l.rank++)));
  31133. l = L;
  31134. l.end = l.start = null;
  31135. l.path0 = l.path1 = null;
  31136. l.next =
  31137. c.geom.ZPP_CutInt.zpp_pool;
  31138. c.geom.ZPP_CutInt.zpp_pool = l;
  31139. l = H;
  31140. l.end = l.start = null;
  31141. l.path0 = l.path1 = null;
  31142. l.next = c.geom.ZPP_CutInt.zpp_pool;
  31143. c.geom.ZPP_CutInt.zpp_pool = l
  31144. }
  31145. f = null == f ? new h.geom.GeomPolyList : f;
  31146. for (l = c.geom.ZPP_Cutter.paths.head; null != l;) {
  31147. t = l.elt;
  31148. m = t == t.parent ? t : function (a) {
  31149. a = t;
  31150. for (var b = null; a != a.parent;) {
  31151. var d = a.parent;
  31152. a.parent = b;
  31153. b = a;
  31154. a = d
  31155. }
  31156. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31157. return a
  31158. }(this);
  31159. if (!m.used) {
  31160. m.used = !0;
  31161. var aa = m.vert;
  31162. for (b = !0; null != m.vert && (b || aa != m.vert);) b = !1, aa.x == aa.next.x &&
  31163. aa.y == aa.next.y ? (aa == m.vert && (m.vert = aa.next == aa ? null : aa.next, b = !0), u = null != aa && aa.prev == aa ? aa = aa.next = aa.prev = null : function (a) {
  31164. a = aa.next;
  31165. aa.prev.next = aa.next;
  31166. aa.next.prev = aa.prev;
  31167. aa = aa.next = aa.prev = null;
  31168. return a
  31169. }(this), aa = u) : aa = aa.next;
  31170. null != m.vert && (b = h.geom.GeomPoly.get(), b.zpp_inner.vertices = m.vert, f.zpp_inner.reverse_flag ? f.push(b) : f.unshift(b))
  31171. }
  31172. l = l.next
  31173. }
  31174. for (; null != c.geom.ZPP_Cutter.paths.head;) l = t = c.geom.ZPP_Cutter.paths.pop_unsafe(), l.vert = null, l.parent = null, l.next = c.geom.ZPP_CutVert.zpp_pool,
  31175. c.geom.ZPP_CutVert.zpp_pool = l;
  31176. for (; null != k;) k = null != k && k.prev == k ? function (a) {
  31177. k.next = k.prev = null;
  31178. a = k;
  31179. a.vert = null;
  31180. a.parent = null;
  31181. a.next = c.geom.ZPP_CutVert.zpp_pool;
  31182. c.geom.ZPP_CutVert.zpp_pool = a;
  31183. return k = null
  31184. }(this) : function (a) {
  31185. a = k.next;
  31186. k.prev.next = k.next;
  31187. k.next.prev = k.prev;
  31188. k.next = k.prev = null;
  31189. var b = k;
  31190. b.vert = null;
  31191. b.parent = null;
  31192. b.next = c.geom.ZPP_CutVert.zpp_pool;
  31193. c.geom.ZPP_CutVert.zpp_pool = b;
  31194. k = null;
  31195. return a
  31196. }(this);
  31197. return f
  31198. };
  31199. c.geom.ZPP_Geom = function () {};
  31200. s["zpp_nape.geom.ZPP_Geom"] = c.geom.ZPP_Geom;
  31201. c.geom.ZPP_Geom.__name__ = ["zpp_nape", "geom", "ZPP_Geom"];
  31202. c.geom.ZPP_Geom.validateShape = function (a) {
  31203. a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.validate_gaxi();
  31204. a.zip_aabb && null != a.body && (a.zip_aabb = !1, a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.__validate_aabb() : a.polygon.__validate_aabb());
  31205. a.zip_worldCOM && null != a.body && (a.zip_worldCOM = !1, a.zip_localCOM && (a.zip_localCOM = !1, a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.__validate_localCOM(), null != a.wrap_localCOM && (a.wrap_localCOM.zpp_inner.x =
  31206. a.localCOMx, a.wrap_localCOM.zpp_inner.y = a.localCOMy)), a.body.validate_axis(), a.worldCOMx = a.body.posx + (a.body.axisy * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy))
  31207. };
  31208. c.geom.ZPP_GeomVert = function () {
  31209. this.forced = !1;
  31210. this.prev = this.next = this.wrap = null;
  31211. this.x = this.y = 0
  31212. };
  31213. s["zpp_nape.geom.ZPP_GeomVert"] = c.geom.ZPP_GeomVert;
  31214. c.geom.ZPP_GeomVert.__name__ = ["zpp_nape", "geom", "ZPP_GeomVert"];
  31215. c.geom.ZPP_GeomVert.get = function (a, b) {
  31216. var d;
  31217. null == c.geom.ZPP_GeomVert.zpp_pool ?
  31218. d = new c.geom.ZPP_GeomVert : (d = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = d.next, d.next = null);
  31219. d.forced = !1;
  31220. d.x = a;
  31221. d.y = b;
  31222. return d
  31223. };
  31224. c.geom.ZPP_GeomVert.prototype = {
  31225. getwrap: function () {
  31226. this.wrap.zpp_inner.x = this.x;
  31227. this.wrap.zpp_inner.y = this.y
  31228. },
  31229. modwrap: function (a) {
  31230. this.x = a.x;
  31231. this.y = a.y
  31232. },
  31233. wrapper: function () {
  31234. null == this.wrap && (this.wrap = h.geom.Vec2.get(this.x, this.y, null), this.wrap.zpp_inner._inuse = !0, this.wrap.zpp_inner._invalidate = A(this, this.modwrap), this.wrap.zpp_inner._validate = A(this, this.getwrap));
  31235. return this.wrap
  31236. },
  31237. alloc: function () {
  31238. this.forced = !1
  31239. },
  31240. free: function () {
  31241. null != this.wrap && (this.wrap.zpp_inner._inuse = !1, this.wrap.dispose(), this.wrap = null);
  31242. this.prev = this.next = null
  31243. },
  31244. __class__: c.geom.ZPP_GeomVert
  31245. };
  31246. c.geom.ZPP_GeomPoly = function (a) {
  31247. this.outer = this.vertices = null;
  31248. this.outer = a
  31249. };
  31250. s["zpp_nape.geom.ZPP_GeomPoly"] = c.geom.ZPP_GeomPoly;
  31251. c.geom.ZPP_GeomPoly.__name__ = ["zpp_nape", "geom", "ZPP_GeomPoly"];
  31252. c.geom.ZPP_GeomPoly.prototype = {
  31253. __class__: c.geom.ZPP_GeomPoly
  31254. };
  31255. c.geom.ZPP_GeomVertexIterator = function () {
  31256. this.outer =
  31257. this.next = null;
  31258. this.first = this.forward = !1;
  31259. this.ptr = this.start = null;
  31260. c.geom.ZPP_GeomVertexIterator.internal = !0;
  31261. this.outer = new h.geom.GeomVertexIterator;
  31262. c.geom.ZPP_GeomVertexIterator.internal = !1
  31263. };
  31264. s["zpp_nape.geom.ZPP_GeomVertexIterator"] = c.geom.ZPP_GeomVertexIterator;
  31265. c.geom.ZPP_GeomVertexIterator.__name__ = ["zpp_nape", "geom", "ZPP_GeomVertexIterator"];
  31266. c.geom.ZPP_GeomVertexIterator.get = function (a, b) {
  31267. var d;
  31268. null == c.geom.ZPP_GeomVertexIterator.zpp_pool ? d = new c.geom.ZPP_GeomVertexIterator : (d = c.geom.ZPP_GeomVertexIterator.zpp_pool,
  31269. c.geom.ZPP_GeomVertexIterator.zpp_pool = d.next, d.next = null);
  31270. null;
  31271. d.outer.zpp_inner = d;
  31272. d.ptr = a;
  31273. d.forward = b;
  31274. d.start = a;
  31275. d.first = null != a;
  31276. return d.outer
  31277. };
  31278. c.geom.ZPP_GeomVertexIterator.prototype = {
  31279. alloc: function () {},
  31280. free: function () {
  31281. this.ptr = this.start = this.outer.zpp_inner = null
  31282. },
  31283. __class__: c.geom.ZPP_GeomVertexIterator
  31284. };
  31285. c.geom.ZPP_MarchSpan = function () {
  31286. this.next = null;
  31287. this.out = !1;
  31288. this.rank = 0;
  31289. this.parent = null;
  31290. this.parent = this
  31291. };
  31292. s["zpp_nape.geom.ZPP_MarchSpan"] = c.geom.ZPP_MarchSpan;
  31293. c.geom.ZPP_MarchSpan.__name__ = ["zpp_nape",
  31294. "geom", "ZPP_MarchSpan"
  31295. ];
  31296. c.geom.ZPP_MarchSpan.prototype = {
  31297. alloc: function () {
  31298. this.out = !1;
  31299. this.rank = 0
  31300. },
  31301. free: function () {
  31302. this.parent = this
  31303. },
  31304. __class__: c.geom.ZPP_MarchSpan
  31305. };
  31306. c.geom.ZPP_MarchPair = function () {
  31307. this.pd = this.span1 = this.span2 = this.spanr = this.next = null;
  31308. this.keyr = this.okeyr = 0;
  31309. this.pr = null;
  31310. this.key2 = this.okey2 = 0;
  31311. this.p2 = null;
  31312. this.key1 = this.okey1 = 0;
  31313. this.p1 = null
  31314. };
  31315. s["zpp_nape.geom.ZPP_MarchPair"] = c.geom.ZPP_MarchPair;
  31316. c.geom.ZPP_MarchPair.__name__ = ["zpp_nape", "geom", "ZPP_MarchPair"];
  31317. c.geom.ZPP_MarchPair.prototype = {
  31318. alloc: function () {},
  31319. free: function () {
  31320. this.span1 = this.span2 = this.spanr = this.p1 = this.p2 = this.pr = this.pd = null
  31321. },
  31322. __class__: c.geom.ZPP_MarchPair
  31323. };
  31324. c.geom.ZPP_MarchingSquares = function () {};
  31325. s["zpp_nape.geom.ZPP_MarchingSquares"] = c.geom.ZPP_MarchingSquares;
  31326. c.geom.ZPP_MarchingSquares.__name__ = ["zpp_nape", "geom", "ZPP_MarchingSquares"];
  31327. c.geom.ZPP_MarchingSquares.run = function (a, b, d, g, e, f, l, m, h) {
  31328. var k = g - b;
  31329. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  31330. f.zpp_inner.validate();
  31331. var n =
  31332. k / f.zpp_inner.x,
  31333. k = n | 0,
  31334. r = e - d;
  31335. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  31336. f.zpp_inner.validate();
  31337. var q = r / f.zpp_inner.y,
  31338. r = q | 0;
  31339. n != k && k++;
  31340. q != r && r++;
  31341. m && (null == c.geom.ZPP_MarchingSquares.map ? c.geom.ZPP_MarchingSquares.map = new c.util.ZNPArray2_ZPP_MarchPair(k, r) : c.geom.ZPP_MarchingSquares.map.resize(k, r, null));
  31342. null == c.geom.ZPP_MarchingSquares.isos ? c.geom.ZPP_MarchingSquares.isos = new c.util.ZNPArray2_Float(k + 1, r + 1) : c.geom.ZPP_MarchingSquares.isos.resize(k + 1, r + 1, 0);
  31343. for (var w =
  31344. 0, n = r + 1; w < n;) {
  31345. var q = w++,
  31346. t;
  31347. if (0 == q) t = d;
  31348. else if (q <= r) {
  31349. t = d;
  31350. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  31351. f.zpp_inner.validate();
  31352. t += f.zpp_inner.y * q
  31353. } else t = e;
  31354. for (var s = t, y = 0, A = k + 1; y < A;) {
  31355. t = y++;
  31356. var z;
  31357. if (0 == t) z = b;
  31358. else if (t <= k) {
  31359. z = b;
  31360. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  31361. f.zpp_inner.validate();
  31362. z += f.zpp_inner.x * t
  31363. } else z = g;
  31364. c.geom.ZPP_MarchingSquares.isos.set(t, q, a(z, s))
  31365. }
  31366. }
  31367. null == c.geom.ZPP_MarchingSquares.ints ? c.geom.ZPP_MarchingSquares.ints =
  31368. new c.util.ZNPArray2_ZPP_GeomVert(k + 1, (r << 1) + 1) : c.geom.ZPP_MarchingSquares.ints.resize(k + 1, (r << 1) + 1, null);
  31369. s = null;
  31370. m && (null == c.geom.ZPP_MarchSpan.zpp_pool ? s = new c.geom.ZPP_MarchSpan : (s = c.geom.ZPP_MarchSpan.zpp_pool, c.geom.ZPP_MarchSpan.zpp_pool = s.next, s.next = null), s.out = !1, s.rank = 0);
  31371. z = d;
  31372. for (n = 0; n < r;) {
  31373. q = n++;
  31374. y = z;
  31375. if (q == r - 1) w = e;
  31376. else {
  31377. w = d;
  31378. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  31379. f.zpp_inner.validate();
  31380. w += f.zpp_inner.y * (q + 1)
  31381. }
  31382. var x = w;
  31383. z = x;
  31384. for (var B = b, A = null, w = 0; w < k;) {
  31385. t =
  31386. w++;
  31387. var v = B;
  31388. if (t == k - 1) B = g;
  31389. else {
  31390. B = b;
  31391. if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  31392. f.zpp_inner.validate();
  31393. B += f.zpp_inner.x * (t + 1)
  31394. }
  31395. var H = B,
  31396. B = H,
  31397. v = c.geom.ZPP_MarchingSquares.me.marchSquare(a, c.geom.ZPP_MarchingSquares.isos, c.geom.ZPP_MarchingSquares.ints, v, y, H, x, t, q, 0 == t || !m, 0 == q || !m, t == k - 1 || !m, q == r - 1 || !m, l);
  31398. null == v ? A = null : m ? (H = null != v.p2 && 14 != v.okey2 ? v.p2 : v.p1, v.pd = 0 == ((H == v.p2 ? v.okey2 : v.okey1) & 128) ? H.prev : H.prev.prev, c.geom.ZPP_MarchingSquares.map.set(t, q, v), null != A &&
  31399. c.geom.ZPP_MarchingSquares.me.combLeft(v.key1) ? (c.geom.ZPP_MarchingSquares.me.combLR(A, v), v.span1 = A.spanr) : (null == c.geom.ZPP_MarchSpan.zpp_pool ? v.span1 = new c.geom.ZPP_MarchSpan : (v.span1 = c.geom.ZPP_MarchSpan.zpp_pool, c.geom.ZPP_MarchSpan.zpp_pool = v.span1.next, v.span1.next = null), v.span1.alloc(), v.span1.next = s, s = v.span1), null != v.p2 ? (null == c.geom.ZPP_MarchSpan.zpp_pool ? v.span2 = new c.geom.ZPP_MarchSpan : (v.span2 = c.geom.ZPP_MarchSpan.zpp_pool, c.geom.ZPP_MarchSpan.zpp_pool = v.span2.next, v.span2.next = null),
  31400. v.span2.alloc(), v.span2.next = s, s = v.span2, v.spanr = v.span2) : v.spanr = v.span1, A = c.geom.ZPP_MarchingSquares.me.combRight(v.keyr) ? v : null) : (c.geom.ZPP_MarchingSquares.me.output(h, v.p1), null != v.p2 && c.geom.ZPP_MarchingSquares.me.output(h, v.p2), v.p1 = v.p2 = v.pr = v.pd = null, v.span1 = v.span2 = v.spanr = null, v.next = c.geom.ZPP_MarchPair.zpp_pool, c.geom.ZPP_MarchPair.zpp_pool = v)
  31401. }
  31402. }
  31403. if (m) {
  31404. for (n = 1; n < r;)
  31405. for (q = n++, A = null, w = 0; w < k;)
  31406. if (t = w++, a = c.geom.ZPP_MarchingSquares.map.get(t, q), null == a) A = null;
  31407. else if (c.geom.ZPP_MarchingSquares.me.combUp(null !=
  31408. a.p2 && 14 == a.okey2 ? a.okey2 : a.okey1))
  31409. if (b = c.geom.ZPP_MarchingSquares.map.get(t, q - 1), null == b) A = null;
  31410. else if (c.geom.ZPP_MarchingSquares.me.combDown(null != b.p2 && 56 == b.okey2 ? b.okey2 : b.okey1)) {
  31411. var D = null != b.p2 && 56 == b.okey2 ? b.span2 : b.span1,
  31412. E = null != a.p2 && 14 == a.okey2 ? a.span2 : a.span1;
  31413. (D == D.parent ? D : function (a) {
  31414. a = D;
  31415. for (var b = null; a != a.parent;) {
  31416. var d = a.parent;
  31417. a.parent = b;
  31418. b = a;
  31419. a = d
  31420. }
  31421. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31422. return a
  31423. }(this)) == (E == E.parent ? E : function (a) {
  31424. a = E;
  31425. for (var b = null; a != a.parent;) {
  31426. var d = a.parent;
  31427. a.parent = b;
  31428. b = a;
  31429. a = d
  31430. }
  31431. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31432. return a
  31433. }(this)) ? A != E && c.geom.ZPP_MarchingSquares.me.combUD_virtual(b, a) : (d = D == D.parent ? D : function (a) {
  31434. a = D;
  31435. for (var b = null; a != a.parent;) {
  31436. var d = a.parent;
  31437. a.parent = b;
  31438. b = a;
  31439. a = d
  31440. }
  31441. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31442. return a
  31443. }(this), g = E == E.parent ? E : function (a) {
  31444. a = E;
  31445. for (var b = null; a != a.parent;) {
  31446. var d = a.parent;
  31447. a.parent = b;
  31448. b = a;
  31449. a = d
  31450. }
  31451. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31452. return a
  31453. }(this), d != g && (d.rank < g.rank ? d.parent = g : d.rank > g.rank ? g.parent = d : (g.parent =
  31454. d, d.rank++)), c.geom.ZPP_MarchingSquares.me.combUD(b, a));
  31455. A = 0 != ((E == a.span2 ? a.okey2 : a.okey1) & 4) ? E : null
  31456. } else A = null;
  31457. else A = null;
  31458. for (n = 0; n < r;)
  31459. for (q = n++, w = 0; w < k;) {
  31460. t = w++;
  31461. var F = c.geom.ZPP_MarchingSquares.map.get(t, q);
  31462. null != F && (a = F.span1 == F.span1.parent ? F.span1 : function (a) {
  31463. a = F.span1;
  31464. for (var b = null; a != a.parent;) {
  31465. var d = a.parent;
  31466. a.parent = b;
  31467. b = a;
  31468. a = d
  31469. }
  31470. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31471. return a
  31472. }(this), a.out || (a.out = !0, c.geom.ZPP_MarchingSquares.me.output(h, F.p1)), null != F.p2 && (a = F.span2 == F.span2.parent ? F.span2 :
  31473. function (a) {
  31474. a = F.span2;
  31475. for (var b = null; a != a.parent;) {
  31476. var d = a.parent;
  31477. a.parent = b;
  31478. b = a;
  31479. a = d
  31480. }
  31481. for (; null != b;) d = b.parent, b.parent = a, b = d;
  31482. return a
  31483. }(this), a.out || (a.out = !0, c.geom.ZPP_MarchingSquares.me.output(h, F.p2))), v = F, v.p1 = v.p2 = v.pr = v.pd = null, v.span1 = v.span2 = v.spanr = null, v.next = c.geom.ZPP_MarchPair.zpp_pool, c.geom.ZPP_MarchPair.zpp_pool = v, c.geom.ZPP_MarchingSquares.map.set(t, q, null))
  31484. }
  31485. for (; null != s;) h = s, s = h.next, v = h, v.parent = v, v.next = c.geom.ZPP_MarchSpan.zpp_pool, c.geom.ZPP_MarchSpan.zpp_pool = v
  31486. }
  31487. };
  31488. c.geom.ZPP_MarchingSquares.ISO =
  31489. function (a, b, d) {
  31490. return a(b, d)
  31491. };
  31492. c.geom.ZPP_MarchingSquares.prototype = {
  31493. ylerp: function (a, b, d, c, e, f, l) {
  31494. for (var m = this.lerp(a, b, c, e); 0 != l-- && a < m && m < b;) {
  31495. var h = f(d, m);
  31496. if (0 == h) break;
  31497. 0 > c * h ? (b = m, e = h) : (a = m, c = h);
  31498. m = this.lerp(a, b, c, e)
  31499. }
  31500. return m
  31501. },
  31502. xlerp: function (a, b, d, c, e, f, l) {
  31503. for (var m = this.lerp(a, b, c, e); 0 != l-- && a < m && m < b;) {
  31504. var h = f(m, d);
  31505. if (0 == h) break;
  31506. 0 > c * h ? (b = m, e = h) : (a = m, c = h);
  31507. m = this.lerp(a, b, c, e)
  31508. }
  31509. return m
  31510. },
  31511. lerp: function (a, b, d, c) {
  31512. if (0 == d) return a;
  31513. if (0 == c) return b;
  31514. c = d - c;
  31515. d = c * c < h.Config.epsilon * h.Config.epsilon ? 0.5 : d /
  31516. c;
  31517. 0 > d ? d = 0 : 1 < d && (d = 1);
  31518. return a + d * (b - a)
  31519. },
  31520. marchSquare: function (a, b, d, g, e, f, l, m, h, k, n, r, q, w) {
  31521. var t = 0,
  31522. s = b.list[h * b.width + m];
  31523. 0 > s && (t |= 8);
  31524. var y = b.list[h * b.width + (m + 1)];
  31525. 0 > y && (t |= 4);
  31526. var A = b.list[(h + 1) * b.width + (m + 1)];
  31527. 0 > A && (t |= 2);
  31528. b = b.list[(h + 1) * b.width + m];
  31529. 0 > b && (t |= 1);
  31530. if (0 == t) return null;
  31531. var z;
  31532. null == c.geom.ZPP_MarchPair.zpp_pool ? z = new c.geom.ZPP_MarchPair : (z = c.geom.ZPP_MarchPair.zpp_pool, c.geom.ZPP_MarchPair.zpp_pool = z.next, z.next = null);
  31533. null;
  31534. if (10 != t && 5 != t) {
  31535. var x = c.geom.ZPP_MarchingSquares.look_march[t];
  31536. z.okey1 =
  31537. x;
  31538. for (t = 0; 8 > t;) {
  31539. var B = t++;
  31540. if (0 != (x & 1 << B)) {
  31541. var v = null;
  31542. if (0 == B) {
  31543. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31544. } else if (2 == B) {
  31545. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31546. } else if (4 == B) {
  31547. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31548. } else if (6 == B) {
  31549. if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
  31550. } else if (1 == B) {
  31551. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x ==
  31552. g || v.x == f)
  31553. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31554. } else if (5 == B) {
  31555. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31556. if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
  31557. } else if (3 == B) {
  31558. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31559. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31560. } else if (v = d.list[((h << 1) + 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31561. if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31562. z.p1 = function (a) {
  31563. a = v;
  31564. null == z.p1 ? z.p1 = a.prev = a.next = a : (a.prev = z.p1, a.next = z.p1.next, z.p1.next.prev = a, z.p1.next = a);
  31565. return a
  31566. }(this)
  31567. }
  31568. }
  31569. z.p1 = z.p1.next;
  31570. z.key1 = x;
  31571. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 ==
  31572. x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key1 = 0, z.p1 = null;
  31573. 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
  31574. } else if (B = 0 > a(0.5 * (g + f), 0.5 * (e + l)), 10 == t)
  31575. if (B) {
  31576. x = 187;
  31577. z.okey1 = x;
  31578. for (t = 0; 8 > t;)
  31579. if (B = t++, 0 != (x & 1 << B)) {
  31580. v = null;
  31581. if (0 == B) {
  31582. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31583. } else if (2 == B) {
  31584. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31585. } else if (4 == B) {
  31586. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31587. } else if (6 == B) {
  31588. if (v = c.geom.ZPP_GeomVert.get(g,
  31589. l), k || q) v.forced = !0
  31590. } else if (1 == B) {
  31591. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31592. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31593. } else if (5 == B) {
  31594. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31595. if (v.x == g && 0 != (x & 64) || v.x ==
  31596. f && 0 != (x & 16)) x ^= 32
  31597. } else if (3 == B) {
  31598. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31599. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31600. } else if (v = d.list[((h << 1) + 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31601. if (v.y == e && 0 != (x &
  31602. 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31603. z.p1 = function (a) {
  31604. a = v;
  31605. null == z.p1 ? z.p1 = a.prev = a.next = a : (a.prev = z.p1, a.next = z.p1.next, z.p1.next.prev = a, z.p1.next = a);
  31606. return a
  31607. }(this)
  31608. }
  31609. z.p1 = z.p1.next;
  31610. z.key1 = x;
  31611. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key1 = 0, z.p1 = null;
  31612. 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
  31613. } else {
  31614. x = 131;
  31615. z.okey1 = x;
  31616. for (t = 0; 8 > t;)
  31617. if (B = t++, 0 != (x & 1 << B)) {
  31618. v = null;
  31619. if (0 == B) {
  31620. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31621. } else if (2 == B) {
  31622. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31623. } else if (4 == B) {
  31624. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31625. } else if (6 == B) {
  31626. if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
  31627. } else if (1 == B) {
  31628. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31629. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31630. } else if (5 == B) {
  31631. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v =
  31632. c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31633. if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
  31634. } else if (3 == B) {
  31635. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31636. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31637. } else if (v = d.list[((h << 1) + 1) * d.width + m], null ==
  31638. v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31639. if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31640. z.p1 = function (a) {
  31641. a = v;
  31642. null == z.p1 ? z.p1 = a.prev = a.next = a : (a.prev = z.p1, a.next = z.p1.next, z.p1.next.prev = a, z.p1.next = a);
  31643. return a
  31644. }(this)
  31645. }
  31646. z.p1 = z.p1.next;
  31647. z.key1 = x;
  31648. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key1 = 0, z.p1 = null;
  31649. if (0 != x) {
  31650. x = 56;
  31651. z.okey2 = x;
  31652. for (t = 0; 8 > t;)
  31653. if (B = t++, 0 != (x & 1 << B)) {
  31654. v = null;
  31655. if (0 == B) {
  31656. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31657. } else if (2 == B) {
  31658. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31659. } else if (4 == B) {
  31660. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31661. } else if (6 == B) {
  31662. if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
  31663. } else if (1 == B) {
  31664. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31665. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31666. } else if (5 == B) {
  31667. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31668. if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
  31669. } else if (3 == B) {
  31670. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x,
  31671. v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31672. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31673. } else if (v = d.list[((h << 1) + 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31674. if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31675. z.p2 = function (a) {
  31676. a = v;
  31677. null == z.p2 ? z.p2 = a.prev = a.next = a : (a.prev = z.p2, a.next = z.p2.next, z.p2.next.prev = a, z.p2.next = a);
  31678. return a
  31679. }(this)
  31680. }
  31681. z.p2 = z.p2.next;
  31682. z.key2 = x;
  31683. if (1 == x || 4 == x || 16 ==
  31684. x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key2 = 0, z.p2 = null;
  31685. 0 == x ? (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1) : (z.pr = z.p2, z.okeyr = z.okey2, z.keyr = z.key2)
  31686. } else {
  31687. x = 56;
  31688. z.okey1 = x;
  31689. for (t = 0; 8 > t;)
  31690. if (B = t++, 0 != (x & 1 << B)) {
  31691. v = null;
  31692. if (0 == B) {
  31693. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31694. } else if (2 == B) {
  31695. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31696. } else if (4 == B) {
  31697. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31698. } else if (6 == B) {
  31699. if (v = c.geom.ZPP_GeomVert.get(g,
  31700. l), k || q) v.forced = !0
  31701. } else if (1 == B) {
  31702. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31703. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31704. } else if (5 == B) {
  31705. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31706. if (v.x == g && 0 != (x & 64) || v.x ==
  31707. f && 0 != (x & 16)) x ^= 32
  31708. } else if (3 == B) {
  31709. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31710. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31711. } else if (v = d.list[((h << 1) + 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31712. if (v.y == e && 0 != (x &
  31713. 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31714. z.p1 = function (a) {
  31715. a = v;
  31716. null == z.p1 ? z.p1 = a.prev = a.next = a : (a.prev = z.p1, a.next = z.p1.next, z.p1.next.prev = a, z.p1.next = a);
  31717. return a
  31718. }(this)
  31719. }
  31720. z.p1 = z.p1.next;
  31721. z.key1 = x;
  31722. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key1 = 0, z.p1 = null;
  31723. 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
  31724. }
  31725. } else if (B) {
  31726. x = 238;
  31727. z.okey1 = x;
  31728. for (t = 0; 8 > t;)
  31729. if (B = t++, 0 != (x & 1 << B)) {
  31730. v = null;
  31731. if (0 == B) {
  31732. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31733. } else if (2 == B) {
  31734. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31735. } else if (4 == B) {
  31736. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31737. } else if (6 == B) {
  31738. if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
  31739. } else if (1 == B) {
  31740. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31741. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31742. } else if (5 == B) {
  31743. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v =
  31744. c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31745. if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
  31746. } else if (3 == B) {
  31747. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31748. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31749. } else if (v = d.list[((h << 1) + 1) * d.width + m], null ==
  31750. v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31751. if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31752. z.p1 = function (a) {
  31753. a = v;
  31754. null == z.p1 ? z.p1 = a.prev = a.next = a : (a.prev = z.p1, a.next = z.p1.next, z.p1.next.prev = a, z.p1.next = a);
  31755. return a
  31756. }(this)
  31757. }
  31758. z.p1 = z.p1.next;
  31759. z.key1 = x;
  31760. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key1 = 0, z.p1 = null;
  31761. 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
  31762. } else {
  31763. x = 224;
  31764. z.okey1 = x;
  31765. for (t = 0; 8 > t;)
  31766. if (B = t++, 0 != (x & 1 << B)) {
  31767. v = null;
  31768. if (0 == B) {
  31769. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31770. } else if (2 == B) {
  31771. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31772. } else if (4 == B) {
  31773. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31774. } else if (6 == B) {
  31775. if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
  31776. } else if (1 == B) {
  31777. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width +
  31778. m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31779. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31780. } else if (5 == B) {
  31781. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31782. if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
  31783. } else if (3 == B) {
  31784. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h <<
  31785. 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31786. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31787. } else if (v = d.list[((h << 1) + 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31788. if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31789. z.p1 = function (a) {
  31790. a = v;
  31791. null == z.p1 ? z.p1 = a.prev = a.next = a : (a.prev = z.p1, a.next = z.p1.next, z.p1.next.prev = a, z.p1.next = a);
  31792. return a
  31793. }(this)
  31794. }
  31795. z.p1 =
  31796. z.p1.next;
  31797. z.key1 = x;
  31798. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key1 = 0, z.p1 = null;
  31799. if (0 != x) {
  31800. x = 14;
  31801. z.okey2 = x;
  31802. for (t = 0; 8 > t;)
  31803. if (B = t++, 0 != (x & 1 << B)) {
  31804. v = null;
  31805. if (0 == B) {
  31806. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31807. } else if (2 == B) {
  31808. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31809. } else if (4 == B) {
  31810. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31811. } else if (6 == B) {
  31812. if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
  31813. } else if (1 == B) {
  31814. if (v =
  31815. d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31816. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31817. } else if (5 == B) {
  31818. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31819. if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
  31820. } else if (3 == B) {
  31821. if (v =
  31822. d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31823. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31824. } else if (v = d.list[((h << 1) + 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e, l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31825. if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31826. z.p2 = function (a) {
  31827. a =
  31828. v;
  31829. null == z.p2 ? z.p2 = a.prev = a.next = a : (a.prev = z.p2, a.next = z.p2.next, z.p2.next.prev = a, z.p2.next = a);
  31830. return a
  31831. }(this)
  31832. }
  31833. z.p2 = z.p2.next;
  31834. z.key2 = x;
  31835. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key2 = 0, z.p2 = null;
  31836. 0 == x ? (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1) : (z.pr = z.p2, z.okeyr = z.okey2, z.keyr = z.key2)
  31837. } else {
  31838. x = 14;
  31839. z.okey1 = x;
  31840. for (t = 0; 8 > t;)
  31841. if (B = t++, 0 != (x & 1 << B)) {
  31842. v = null;
  31843. if (0 == B) {
  31844. if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
  31845. } else if (2 ==
  31846. B) {
  31847. if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
  31848. } else if (4 == B) {
  31849. if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
  31850. } else if (6 == B) {
  31851. if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
  31852. } else if (1 == B) {
  31853. if (v = d.list[(h << 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g, f, e, s, y, a, w), e), d.list[(h << 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), n && (v.forced = !0), v.x == g || v.x == f)
  31854. if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
  31855. } else if (5 == B) {
  31856. if (v = d.list[((h << 1) + 2) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(this.xlerp(g,
  31857. f, l, b, A, a, w), l), d.list[((h << 1) + 2) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), q && (v.forced = !0), v.x == g || v.x == f)
  31858. if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
  31859. } else if (3 == B) {
  31860. if (v = d.list[((h << 1) + 1) * d.width + (m + 1)], null == v ? (v = c.geom.ZPP_GeomVert.get(f, this.ylerp(e, l, f, y, A, a, w)), d.list[((h << 1) + 1) * d.width + (m + 1)] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), r && (v.forced = !0), v.y == e || v.y == l)
  31861. if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
  31862. } else if (v = d.list[((h << 1) + 1) * d.width + m], null == v ? (v = c.geom.ZPP_GeomVert.get(g, this.ylerp(e,
  31863. l, g, s, b, a, w)), d.list[((h << 1) + 1) * d.width + m] = v) : v = c.geom.ZPP_GeomVert.get(v.x, v.y), k && (v.forced = !0), v.y == e || v.y == l)
  31864. if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
  31865. z.p1 = function (a) {
  31866. a = v;
  31867. null == z.p1 ? z.p1 = a.prev = a.next = a : (a.prev = z.p1, a.next = z.p1.next, z.p1.next.prev = a, z.p1.next = a);
  31868. return a
  31869. }(this)
  31870. }
  31871. z.p1 = z.p1.next;
  31872. z.key1 = x;
  31873. if (1 == x || 4 == x || 16 == x || 64 == x || 3 == x || 12 == x || 48 == x || 192 == x || 129 == x || 6 == x || 24 == x || 96 == x || 5 == x || 20 == x || 80 == x || 65 == x || 17 == x || 68 == x) x = 0, z.key1 = 0, z.p1 = null;
  31874. 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr =
  31875. z.key1)
  31876. }
  31877. }
  31878. return z
  31879. },
  31880. comb: function (a) {
  31881. var b = 0;
  31882. 0 != (a & 1) && b++;
  31883. 0 != (a & 2) && b++;
  31884. 0 != (a & 4) && b++;
  31885. return 2 <= b
  31886. },
  31887. combDown: function (a) {
  31888. return this.comb((a & 112) >> 4)
  31889. },
  31890. combUp: function (a) {
  31891. return this.comb(a & 7)
  31892. },
  31893. combRight: function (a) {
  31894. return this.comb((a & 28) >> 2)
  31895. },
  31896. combLeft: function (a) {
  31897. return this.comb(a & 1 | (a & 192) >> 5)
  31898. },
  31899. combUD_virtual: function (a, b) {
  31900. var d = a.pd,
  31901. c = null != b.p2 && 14 == b.key2 ? b.p2 : b.p1;
  31902. d.forced = c.forced = d.prev.forced = c.next.forced = !0
  31903. },
  31904. combUD: function (a, b) {
  31905. var d = a.pd,
  31906. g = null != b.p2 && 14 == b.key2 ? b.p2 : b.p1,
  31907. e = d.prev,
  31908. f =
  31909. g.next;
  31910. g.next = d.next;
  31911. d.next.prev = g;
  31912. null != d.wrap && (d.wrap.zpp_inner._inuse = !1, d.wrap.dispose(), d.wrap = null);
  31913. d.prev = d.next = null;
  31914. d.next = c.geom.ZPP_GeomVert.zpp_pool;
  31915. c.geom.ZPP_GeomVert.zpp_pool = d;
  31916. f.prev = e.prev;
  31917. e.prev.next = f;
  31918. e == a.p1 && (a.p1 = f);
  31919. d = e;
  31920. null != d.wrap && (d.wrap.zpp_inner._inuse = !1, d.wrap.dispose(), d.wrap = null);
  31921. d.prev = d.next = null;
  31922. d.next = c.geom.ZPP_GeomVert.zpp_pool;
  31923. c.geom.ZPP_GeomVert.zpp_pool = d
  31924. },
  31925. combLR: function (a, b) {
  31926. var d = this.linkright(a.pr, a.okeyr),
  31927. g = this.linkleft(b.p1, b.okey1),
  31928. e = d.next,
  31929. f = g.prev;
  31930. 0 != (a.keyr & 4) ? (b.pr == b.p1 && (b.pr = d.prev), b.p1 = d.prev, d.prev.next = g.next, g.next.prev = d.prev, null != d.wrap && (d.wrap.zpp_inner._inuse = !1, d.wrap.dispose(), d.wrap = null), d.prev = d.next = null, d.next = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = d) : (d.next = g.next, g.next.prev = d);
  31931. d = g;
  31932. null != d.wrap && (d.wrap.zpp_inner._inuse = !1, d.wrap.dispose(), d.wrap = null);
  31933. d.prev = d.next = null;
  31934. d.next = c.geom.ZPP_GeomVert.zpp_pool;
  31935. c.geom.ZPP_GeomVert.zpp_pool = d;
  31936. 0 != (a.keyr & 16) ? (b.pd = e.next, e.next.prev = f.prev, f.prev.next =
  31937. e.next, d = e, null != d.wrap && (d.wrap.zpp_inner._inuse = !1, d.wrap.dispose(), d.wrap = null), d.prev = d.next = null, d.next = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = d) : (e.prev = f.prev, f.prev.next = e);
  31938. d = f;
  31939. null != d.wrap && (d.wrap.zpp_inner._inuse = !1, d.wrap.dispose(), d.wrap = null);
  31940. d.prev = d.next = null;
  31941. d.next = c.geom.ZPP_GeomVert.zpp_pool;
  31942. c.geom.ZPP_GeomVert.zpp_pool = d
  31943. },
  31944. linkup: function (a, b) {
  31945. return a
  31946. },
  31947. linkdown: function (a, b) {
  31948. return 0 == (b & 128) ? a.prev : a.prev.prev
  31949. },
  31950. linkleft: function (a, b) {
  31951. return 0 == (b & 1) ? a.prev :
  31952. a
  31953. },
  31954. linkright: function (a, b) {
  31955. var d = b & 7;
  31956. return 0 == d ? a : 3 == d ? a.next.next : a.next
  31957. },
  31958. output: function (a, b) {
  31959. if (null == b || b.next == b || b.next == b.prev || function (a) {
  31960. a = 0;
  31961. var d = b,
  31962. c = b;
  31963. if (null != d) {
  31964. do {
  31965. var l = d;
  31966. a += l.x * (l.next.y - l.prev.y);
  31967. d = d.next
  31968. } while (d != c)
  31969. }
  31970. a *= 0.5;
  31971. return a * a < h.Config.epsilon * h.Config.epsilon
  31972. }(this))
  31973. for (; null != b;) {
  31974. var d;
  31975. d = null != b && b.prev == b ? b = b.next = b.prev = null : function (a) {
  31976. a = b.next;
  31977. b.prev.next = b.next;
  31978. b.next.prev = b.prev;
  31979. b = b.next = b.prev = null;
  31980. return a
  31981. }(this);
  31982. b = d
  31983. } else d = h.geom.GeomPoly.get(), d.zpp_inner.vertices =
  31984. b, a.zpp_inner.reverse_flag ? a.push(d) : a.unshift(d)
  31985. },
  31986. __class__: c.geom.ZPP_MarchingSquares
  31987. };
  31988. c.geom.ZPP_Mat23 = function () {
  31989. this._invalidate = this.next = null;
  31990. this.a = this.b = this.c = this.d = this.tx = this.ty = 0;
  31991. this.outer = null
  31992. };
  31993. s["zpp_nape.geom.ZPP_Mat23"] = c.geom.ZPP_Mat23;
  31994. c.geom.ZPP_Mat23.__name__ = ["zpp_nape", "geom", "ZPP_Mat23"];
  31995. c.geom.ZPP_Mat23.get = function () {
  31996. var a;
  31997. null == c.geom.ZPP_Mat23.zpp_pool ? a = new c.geom.ZPP_Mat23 : (a = c.geom.ZPP_Mat23.zpp_pool, c.geom.ZPP_Mat23.zpp_pool = a.next, a.next = null);
  31998. null;
  31999. return a
  32000. };
  32001. c.geom.ZPP_Mat23.identity =
  32002. function () {
  32003. var a = c.geom.ZPP_Mat23.get();
  32004. a.setas(1, 0, 0, 1, 0, 0);
  32005. return a
  32006. };
  32007. c.geom.ZPP_Mat23.prototype = {
  32008. alloc: function () {},
  32009. free: function () {},
  32010. setas: function (a, b, d, c, e, f) {
  32011. this.tx = e;
  32012. this.ty = f;
  32013. this.a = a;
  32014. this.b = b;
  32015. this.c = d;
  32016. this.d = c
  32017. },
  32018. set: function (a) {
  32019. this.setas(a.a, a.b, a.c, a.d, a.tx, a.ty)
  32020. },
  32021. invalidate: function () {
  32022. null != this._invalidate && this._invalidate()
  32023. },
  32024. wrapper: function () {
  32025. if (null == this.outer) {
  32026. this.outer = new h.geom.Mat23;
  32027. var a = this.outer.zpp_inner;
  32028. a.next = c.geom.ZPP_Mat23.zpp_pool;
  32029. c.geom.ZPP_Mat23.zpp_pool = a;
  32030. this.outer.zpp_inner =
  32031. this
  32032. }
  32033. return this.outer
  32034. },
  32035. __class__: c.geom.ZPP_Mat23
  32036. };
  32037. c.geom.ZPP_MatMN = function (a, b) {
  32038. this.x = null;
  32039. this.m = this.n = 0;
  32040. this.outer = null;
  32041. this.m = a;
  32042. this.n = b;
  32043. this.x = [];
  32044. for (var d = 0, c = a * b; d < c;) d++, this.x.push(0)
  32045. };
  32046. s["zpp_nape.geom.ZPP_MatMN"] = c.geom.ZPP_MatMN;
  32047. c.geom.ZPP_MatMN.__name__ = ["zpp_nape", "geom", "ZPP_MatMN"];
  32048. c.geom.ZPP_MatMN.prototype = {
  32049. __class__: c.geom.ZPP_MatMN
  32050. };
  32051. c.geom.ZPP_Monotone = function () {};
  32052. s["zpp_nape.geom.ZPP_Monotone"] = c.geom.ZPP_Monotone;
  32053. c.geom.ZPP_Monotone.__name__ = ["zpp_nape", "geom", "ZPP_Monotone"];
  32054. c.geom.ZPP_Monotone.bisector = function (a) {
  32055. var b = a.prev,
  32056. d = a.next,
  32057. g = 0,
  32058. e = 0,
  32059. g = a.x - b.x,
  32060. e = a.y - b.y,
  32061. f = b = 0,
  32062. b = d.x - a.x,
  32063. f = d.y - a.y;
  32064. a = c.geom.ZPP_Vec2.get(-e - f, g + b, null);
  32065. d = 1 / Math.sqrt(a.x * a.x + a.y * a.y);
  32066. a.x *= d;
  32067. a.y *= d;
  32068. 0 > f * g - b * e && (a.x = -a.x, a.y = -a.y);
  32069. return a
  32070. };
  32071. c.geom.ZPP_Monotone.below = function (a, b) {
  32072. if (a.y < b.y) return !0;
  32073. if (a.y > b.y) return !1;
  32074. if (a.x < b.x) return !0;
  32075. if (a.x > b.x) return !1;
  32076. var d = c.geom.ZPP_Monotone.bisector(a),
  32077. g = c.geom.ZPP_Monotone.bisector(b),
  32078. e = 1;
  32079. d.x += a.x * e;
  32080. d.y += a.y * e;
  32081. e = 1;
  32082. g.x += b.x * e;
  32083. g.y += b.y * e;
  32084. e = d.x < g.x || d.x == g.x &&
  32085. d.y < g.y;
  32086. null != d.outer && (d.outer.zpp_inner = null, d.outer = null);
  32087. d._isimmutable = null;
  32088. d._validate = null;
  32089. d._invalidate = null;
  32090. d.next = c.geom.ZPP_Vec2.zpp_pool;
  32091. c.geom.ZPP_Vec2.zpp_pool = d;
  32092. d = g;
  32093. null != d.outer && (d.outer.zpp_inner = null, d.outer = null);
  32094. d._isimmutable = null;
  32095. d._validate = null;
  32096. d._invalidate = null;
  32097. d.next = c.geom.ZPP_Vec2.zpp_pool;
  32098. c.geom.ZPP_Vec2.zpp_pool = d;
  32099. return e
  32100. };
  32101. c.geom.ZPP_Monotone.above = function (a, b) {
  32102. return c.geom.ZPP_Monotone.below(b, a)
  32103. };
  32104. c.geom.ZPP_Monotone.left_vertex = function (a) {
  32105. var b = a.prev;
  32106. return b.y >
  32107. a.y || b.y == a.y && a.next.y < a.y
  32108. };
  32109. c.geom.ZPP_Monotone.isMonotone = function (a) {
  32110. var b = a,
  32111. d = a,
  32112. c = a.next;
  32113. if (null != c) {
  32114. do {
  32115. var e = c;
  32116. e.y < b.y && (b = e);
  32117. e.y > d.y && (d = e);
  32118. c = c.next
  32119. } while (c != a)
  32120. }
  32121. var f = !0,
  32122. l = b;
  32123. if (d != b.next && (c = b.next, a = d, null != c)) {
  32124. do {
  32125. e = c;
  32126. if (e.y < l.y) {
  32127. f = !1;
  32128. break
  32129. }
  32130. l = e;
  32131. c = c.next
  32132. } while (c != a)
  32133. }
  32134. if (!f) return !1;
  32135. l = b;
  32136. if (d != b.prev && (c = b.prev, a = d, null != c)) {
  32137. do {
  32138. e = c;
  32139. if (e.y < l.y) {
  32140. f = !1;
  32141. break
  32142. }
  32143. l = e;
  32144. c = c.prev
  32145. } while (c != a)
  32146. }
  32147. return f
  32148. };
  32149. c.geom.ZPP_Monotone.getShared = function () {
  32150. null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly =
  32151. new c.geom.ZPP_PartitionedPoly);
  32152. return c.geom.ZPP_Monotone.sharedPPoly
  32153. };
  32154. c.geom.ZPP_Monotone.decompose = function (a, b) {
  32155. null == b ? b = new c.geom.ZPP_PartitionedPoly(a) : b.init(a);
  32156. if (null == b.vertices) return b;
  32157. null == c.geom.ZPP_Monotone.queue && (c.geom.ZPP_Monotone.queue = new c.util.ZNPList_ZPP_PartitionVertex);
  32158. var d = b.vertices,
  32159. g = b.vertices;
  32160. if (null != d) {
  32161. do {
  32162. var e = d;
  32163. c.geom.ZPP_Monotone.queue.add(e);
  32164. var f = 0,
  32165. l = 0,
  32166. f = e.next.x - e.x,
  32167. l = e.next.y - e.y,
  32168. h = 0,
  32169. k = 0,
  32170. h = e.prev.x - e.x,
  32171. k = e.prev.y - e.y,
  32172. f = 0 < k * f - h * l;
  32173. e.type = c.geom.ZPP_Monotone.below(e.prev,
  32174. e) ? c.geom.ZPP_Monotone.below(e.next, e) ? f ? 0 : 3 : 4 : c.geom.ZPP_Monotone.below(e, e.next) ? f ? 1 : 2 : 4;
  32175. d = d.next
  32176. } while (d != g)
  32177. }
  32178. g = c.geom.ZPP_Monotone.queue;
  32179. if (null != g.head && null != g.head.next) {
  32180. var d = g.head,
  32181. h = l = f = e = null,
  32182. k = 1,
  32183. p, n, r;
  32184. do {
  32185. p = 0;
  32186. f = d;
  32187. for (e = d = null; null != f;) {
  32188. p++;
  32189. l = f;
  32190. n = 0;
  32191. for (r = k; null != l && n < k;) n++, l = l.next;
  32192. for (; 0 < n || 0 < r && null != l;) 0 == n ? (h = l, l = l.next, r--) : 0 == r || null == l ? (h = f, f = f.next, n--) : c.geom.ZPP_Monotone.above(f.elt, l.elt) ? (h = f, f = f.next, n--) : (h = l, l = l.next, r--), null != e ? e.next = h : d = h, e = h;
  32193. f = l
  32194. }
  32195. e.next = null;
  32196. k <<= 1
  32197. } while (1 <
  32198. p);
  32199. g.head = d;
  32200. g.modified = !0;
  32201. g.pushmod = !0
  32202. }
  32203. null == c.geom.ZPP_Monotone.edges && (null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? c.geom.ZPP_Monotone.edges = new c.util.ZPP_Set_ZPP_PartitionVertex : (c.geom.ZPP_Monotone.edges = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = c.geom.ZPP_Monotone.edges.next, c.geom.ZPP_Monotone.edges.next = null), null, c.geom.ZPP_Monotone.edges.lt = c.geom.ZPP_PartitionVertex.edge_lt, c.geom.ZPP_Monotone.edges.swapped = c.geom.ZPP_PartitionVertex.edge_swap);
  32204. for (; null != c.geom.ZPP_Monotone.queue.head;) {
  32205. var q = c.geom.ZPP_Monotone.queue.pop_unsafe();
  32206. switch (q.type) {
  32207. case 0:
  32208. q.helper = q;
  32209. q.node = c.geom.ZPP_Monotone.edges.insert(q);
  32210. break;
  32211. case 1:
  32212. g = q.prev;
  32213. if (null == g.helper) throw "Fatal error (1): Polygon is not weakly-simple and clockwise";
  32214. 2 == g.helper.type && b.add_diagonal(q, g.helper);
  32215. c.geom.ZPP_Monotone.edges.remove_node(g.node);
  32216. g.helper = null;
  32217. break;
  32218. case 3:
  32219. g = function (a) {
  32220. a = null;
  32221. if (!c.geom.ZPP_Monotone.edges.empty()) {
  32222. for (var b = c.geom.ZPP_Monotone.edges.parent; null != b.prev;) b =
  32223. b.prev;
  32224. for (; null != b;) {
  32225. var d = b.data;
  32226. if (!c.geom.ZPP_PartitionVertex.vert_lt(d, q)) {
  32227. a = d;
  32228. break
  32229. }
  32230. if (null != b.next)
  32231. for (b = b.next; null != b.prev;) b = b.prev;
  32232. else {
  32233. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  32234. b = b.parent
  32235. }
  32236. }
  32237. }
  32238. return a
  32239. }(this);
  32240. if (null != g) {
  32241. if (null == g.helper) throw "Fatal error (2): Polygon is not weakly-simple and clockwise";
  32242. b.add_diagonal(q, g.helper);
  32243. g.helper = q
  32244. }
  32245. q.node = c.geom.ZPP_Monotone.edges.insert(q);
  32246. q.helper = q;
  32247. break;
  32248. case 2:
  32249. g = q.prev;
  32250. if (null == g.helper) throw "Fatal error (3): Polygon is not weakly-simple and clockwise";
  32251. 2 == g.helper.type && b.add_diagonal(q, g.helper);
  32252. c.geom.ZPP_Monotone.edges.remove_node(g.node);
  32253. g.helper = null;
  32254. g = function (a) {
  32255. a = null;
  32256. if (!c.geom.ZPP_Monotone.edges.empty()) {
  32257. for (var b = c.geom.ZPP_Monotone.edges.parent; null != b.prev;) b = b.prev;
  32258. for (; null != b;) {
  32259. var d = b.data;
  32260. if (!c.geom.ZPP_PartitionVertex.vert_lt(d, q)) {
  32261. a = d;
  32262. break
  32263. }
  32264. if (null != b.next)
  32265. for (b = b.next; null != b.prev;) b = b.prev;
  32266. else {
  32267. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  32268. b = b.parent
  32269. }
  32270. }
  32271. }
  32272. return a
  32273. }(this);
  32274. if (null != g) {
  32275. if (null == g.helper) throw "Fatal error (4): Polygon is not weakly-simple and clockwise";
  32276. 2 == g.helper.type && b.add_diagonal(q, g.helper);
  32277. g.helper = q
  32278. }
  32279. break;
  32280. case 4:
  32281. if (g = q.prev, c.geom.ZPP_Monotone.left_vertex(q)) {
  32282. if (null == g.helper) throw "Fatal error (5): Polygon is not weakly-simple and clockwise";
  32283. 2 == g.helper.type && b.add_diagonal(q, g.helper);
  32284. c.geom.ZPP_Monotone.edges.remove_node(g.node);
  32285. g.helper = null;
  32286. q.node = c.geom.ZPP_Monotone.edges.insert(q);
  32287. q.helper = q
  32288. } else {
  32289. g = function (a) {
  32290. a = null;
  32291. if (!c.geom.ZPP_Monotone.edges.empty()) {
  32292. for (var b = c.geom.ZPP_Monotone.edges.parent; null != b.prev;) b = b.prev;
  32293. for (; null !=
  32294. b;) {
  32295. var d = b.data;
  32296. if (!c.geom.ZPP_PartitionVertex.vert_lt(d, q)) {
  32297. a = d;
  32298. break
  32299. }
  32300. if (null != b.next)
  32301. for (b = b.next; null != b.prev;) b = b.prev;
  32302. else {
  32303. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  32304. b = b.parent
  32305. }
  32306. }
  32307. }
  32308. return a
  32309. }(this);
  32310. if (null == g || null == g.helper) throw "Fatal error (6): Polygon is not weakly-simple and clockwise";
  32311. 2 == g.helper.type && b.add_diagonal(q, g.helper);
  32312. g.helper = q
  32313. }
  32314. }
  32315. }
  32316. return b
  32317. };
  32318. c.geom.ZPP_PartitionVertex = function () {
  32319. this.next = this.prev = this.node = null;
  32320. this.rightchain = !1;
  32321. this.helper = null;
  32322. this.type = 0;
  32323. this.diagonals =
  32324. null;
  32325. this.forced = !1;
  32326. this.id = this.mag = this.x = this.y = 0;
  32327. this.id = c.geom.ZPP_PartitionVertex.nextId++;
  32328. this.diagonals = new c.util.ZNPList_ZPP_PartitionVertex
  32329. };
  32330. s["zpp_nape.geom.ZPP_PartitionVertex"] = c.geom.ZPP_PartitionVertex;
  32331. c.geom.ZPP_PartitionVertex.__name__ = ["zpp_nape", "geom", "ZPP_PartitionVertex"];
  32332. c.geom.ZPP_PartitionVertex.get = function (a) {
  32333. var b;
  32334. null == c.geom.ZPP_PartitionVertex.zpp_pool ? b = new c.geom.ZPP_PartitionVertex : (b = c.geom.ZPP_PartitionVertex.zpp_pool, c.geom.ZPP_PartitionVertex.zpp_pool = b.next,
  32335. b.next = null);
  32336. null;
  32337. b.x = a.x;
  32338. b.y = a.y;
  32339. return b
  32340. };
  32341. c.geom.ZPP_PartitionVertex.rightdistance = function (a, b) {
  32342. var d = a.next.y > a.y,
  32343. c = 0,
  32344. e = 0,
  32345. c = a.next.x - a.x,
  32346. e = a.next.y - a.y,
  32347. f = 0,
  32348. l = 0,
  32349. f = b.x - a.x,
  32350. l = b.y - a.y;
  32351. return (d ? -1 : 1) * (l * c - f * e)
  32352. };
  32353. c.geom.ZPP_PartitionVertex.vert_lt = function (a, b) {
  32354. var d;
  32355. if (b == a || b == a.next) d = !0;
  32356. else if (a.y == a.next.y) {
  32357. d = a.x;
  32358. var g = a.next.x;
  32359. d = (d < g ? d : g) <= b.x
  32360. } else d = 0 >= c.geom.ZPP_PartitionVertex.rightdistance(a, b);
  32361. return d
  32362. };
  32363. c.geom.ZPP_PartitionVertex.edge_swap = function (a, b) {
  32364. var d = a.node;
  32365. a.node = b.node;
  32366. b.node =
  32367. d
  32368. };
  32369. c.geom.ZPP_PartitionVertex.edge_lt = function (a, b) {
  32370. if (a == b && a.next == b.next) return !1;
  32371. if (a == b.next) return !c.geom.ZPP_PartitionVertex.vert_lt(a, b);
  32372. if (b == a.next) return c.geom.ZPP_PartitionVertex.vert_lt(b, a);
  32373. if (a.y == a.next.y) return b.y == b.next.y ? function (b) {
  32374. b = a.x;
  32375. var d = a.next.x;
  32376. return b > d ? b : d
  32377. }(this) > function (a) {
  32378. a = b.x;
  32379. var d = b.next.x;
  32380. return a > d ? a : d
  32381. }(this) : 0 < c.geom.ZPP_PartitionVertex.rightdistance(b, a) || 0 < c.geom.ZPP_PartitionVertex.rightdistance(b, a.next);
  32382. var d = c.geom.ZPP_PartitionVertex.rightdistance(a,
  32383. b),
  32384. g = c.geom.ZPP_PartitionVertex.rightdistance(a, b.next);
  32385. if (0 == d && 0 == g) return function (b) {
  32386. b = a.x;
  32387. var d = a.next.x;
  32388. return b > d ? b : d
  32389. }(this) > function (a) {
  32390. a = b.x;
  32391. var d = b.next.x;
  32392. return a > d ? a : d
  32393. }(this);
  32394. if (0 <= d * g) return 0 > d || 0 > g;
  32395. d = c.geom.ZPP_PartitionVertex.rightdistance(b, a);
  32396. g = c.geom.ZPP_PartitionVertex.rightdistance(b, a.next);
  32397. return 0 <= d * g ? 0 < d || 0 < g : !1
  32398. };
  32399. c.geom.ZPP_PartitionVertex.prototype = {
  32400. sort: function () {
  32401. var a = 0,
  32402. b = 0,
  32403. d = 0,
  32404. c = 0,
  32405. e = function (e) {
  32406. a = e.prev.x - e.x;
  32407. b = e.prev.y - e.y;
  32408. d = e.next.x - e.x;
  32409. c = e.next.y - e.y;
  32410. e = c * a - d * b;
  32411. return 0 <
  32412. e ? -1 : 0 == e ? 0 : 1
  32413. }(this),
  32414. f = this.diagonals;
  32415. if (null != f.head && null != f.head.next) {
  32416. var l = f.head,
  32417. h = null,
  32418. k = null,
  32419. p = null,
  32420. n = null,
  32421. r = 1,
  32422. q, w, t;
  32423. do {
  32424. q = 0;
  32425. k = l;
  32426. for (h = l = null; null != k;) {
  32427. q++;
  32428. p = k;
  32429. w = 0;
  32430. for (t = r; null != p && w < r;) w++, p = p.next;
  32431. for (; 0 < w || 0 < t && null != p;) 0 == w ? (n = p, p = p.next, t--) : 0 == t || null == p ? (n = k, k = k.next, w--) : (1 == e ? 1 == function (e) {
  32432. a = k.elt.x - e.x;
  32433. b = k.elt.y - e.y;
  32434. d = p.elt.x - e.x;
  32435. c = p.elt.y - e.y;
  32436. e = c * a - d * b;
  32437. return 0 < e ? -1 : 0 == e ? 0 : 1
  32438. }(this) : function (e) {
  32439. var f = function (e) {
  32440. a = e.prev.x - e.x;
  32441. b = e.prev.y - e.y;
  32442. d = k.elt.x - e.x;
  32443. c = k.elt.y - e.y;
  32444. e = c * a - d * b;
  32445. return 0 < e ? -1 : 0 == e ? 0 : 1
  32446. }(e),
  32447. l = function (e) {
  32448. a = e.prev.x - e.x;
  32449. b = e.prev.y - e.y;
  32450. d = p.elt.x - e.x;
  32451. c = p.elt.y - e.y;
  32452. e = c * a - d * b;
  32453. return 0 < e ? -1 : 0 == e ? 0 : 1
  32454. }(e);
  32455. return 1 == f * l || 0 == f * l && (1 == f || 1 == l) ? 1 == function (e) {
  32456. a = k.elt.x - e.x;
  32457. b = k.elt.y - e.y;
  32458. d = p.elt.x - e.x;
  32459. c = p.elt.y - e.y;
  32460. e = c * a - d * b;
  32461. return 0 < e ? -1 : 0 == e ? 0 : 1
  32462. }(e) : -1 == f || -1 == l ? -1 == l : 0 == f && 0 == l ? function (e) {
  32463. a = e.x - e.prev.x;
  32464. b = e.y - e.prev.y;
  32465. d = k.elt.x - e.x;
  32466. c = k.elt.y - e.y;
  32467. var f = a * d + b * c;
  32468. d = p.elt.x - e.x;
  32469. c = p.elt.y - e.y;
  32470. e = a * d + b * c;
  32471. return 0 > f && 0 < e ? !0 : 0 > e && 0 < f ? !1 : !0
  32472. }(e) : !0
  32473. }(this)) ? (n = k, k = k.next, w--) : (n =
  32474. p, p = p.next, t--), null != h ? h.next = n : l = n, h = n;
  32475. k = p
  32476. }
  32477. h.next = null;
  32478. r <<= 1
  32479. } while (1 < q);
  32480. f.head = l;
  32481. f.modified = !0;
  32482. f.pushmod = !0
  32483. }
  32484. },
  32485. copy: function () {
  32486. var a;
  32487. null == c.geom.ZPP_PartitionVertex.zpp_pool ? a = new c.geom.ZPP_PartitionVertex : (a = c.geom.ZPP_PartitionVertex.zpp_pool, c.geom.ZPP_PartitionVertex.zpp_pool = a.next, a.next = null);
  32488. null;
  32489. a.x = this.x;
  32490. a.y = this.y;
  32491. a.forced = this.forced;
  32492. return a
  32493. },
  32494. free: function () {
  32495. this.helper = null
  32496. },
  32497. alloc: function () {},
  32498. __class__: c.geom.ZPP_PartitionVertex
  32499. };
  32500. c.geom.ZPP_PartitionedPoly = function (a) {
  32501. this.vertices =
  32502. this.next = null;
  32503. this.init(a)
  32504. };
  32505. s["zpp_nape.geom.ZPP_PartitionedPoly"] = c.geom.ZPP_PartitionedPoly;
  32506. c.geom.ZPP_PartitionedPoly.__name__ = ["zpp_nape", "geom", "ZPP_PartitionedPoly"];
  32507. c.geom.ZPP_PartitionedPoly.getSharedPP = function () {
  32508. null == c.geom.ZPP_PartitionedPoly.sharedPPList && (c.geom.ZPP_PartitionedPoly.sharedPPList = new c.util.ZNPList_ZPP_PartitionedPoly);
  32509. return c.geom.ZPP_PartitionedPoly.sharedPPList
  32510. };
  32511. c.geom.ZPP_PartitionedPoly.getShared = function () {
  32512. null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList =
  32513. new c.util.ZNPList_ZPP_GeomVert);
  32514. return c.geom.ZPP_PartitionedPoly.sharedGVList
  32515. };
  32516. c.geom.ZPP_PartitionedPoly.prototype = {
  32517. pull: function (a, b) {
  32518. var d = null,
  32519. g = a;
  32520. do
  32521. if (d = function (a) {
  32522. a = c.geom.ZPP_GeomVert.get(g.x, g.y);
  32523. null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
  32524. return a
  32525. }(this), d.forced = g.forced, null != g.diagonals.head)
  32526. if (g.diagonals.inlined_pop_unsafe() == a) break;
  32527. else g = this.pull(g, b);
  32528. else g = g.next; while (g != a);
  32529. var e = function (a) {
  32530. a = 0;
  32531. var b = d,
  32532. c = d;
  32533. if (null != b) {
  32534. do {
  32535. var e = b;
  32536. a += e.x * (e.next.y -
  32537. e.prev.y);
  32538. b = b.next
  32539. } while (b != c)
  32540. }
  32541. return 0.5 * a
  32542. }(this);
  32543. e * e >= h.Config.epsilon * h.Config.epsilon && (function (a) {
  32544. for (var b = d, e = !0; e || b != d;)
  32545. if (e = !1, c.geom.ZPP_VecMath.vec_dsq(b.x, b.y, b.next.x, b.next.y) < h.Config.epsilon * h.Config.epsilon) {
  32546. b == d && (d = b.next, e = !0);
  32547. b.forced && (b.next.forced = !0);
  32548. var g;
  32549. g = null != b && b.prev == b ? b = b.next = b.prev = null : function (a) {
  32550. a = b.next;
  32551. b.prev.next = b.next;
  32552. b.next.prev = b.prev;
  32553. b = b.next = b.prev = null;
  32554. return a
  32555. }(a);
  32556. b = g;
  32557. if (null == b) {
  32558. d = null;
  32559. break
  32560. }
  32561. } else b = b.next;
  32562. if (null != d) {
  32563. do
  32564. for (g = !1, b = d, e = !0; e || b !=
  32565. d;) {
  32566. var e = !1,
  32567. k = b.prev,
  32568. n = 0,
  32569. r = 0,
  32570. n = b.x - k.x,
  32571. r = b.y - k.y,
  32572. q = k = 0,
  32573. k = b.next.x - b.x,
  32574. q = b.next.y - b.y,
  32575. n = q * n - k * r;
  32576. if (n * n >= h.Config.epsilon * h.Config.epsilon) b = b.next;
  32577. else if (b == d && (d = b.next, e = !0), g = null != b && b.prev == b ? b = b.next = b.prev = null : function (a) {
  32578. a = b.next;
  32579. b.prev.next = b.next;
  32580. b.next.prev = b.prev;
  32581. b = b.next = b.prev = null;
  32582. return a
  32583. }(a), b = g, g = !0, null == b) {
  32584. g = !1;
  32585. d = null;
  32586. break
  32587. }
  32588. }
  32589. while (g)
  32590. }
  32591. return null == d
  32592. }(this) || b.add(d));
  32593. return g
  32594. },
  32595. extract: function (a) {
  32596. null == a && (a = new c.util.ZNPList_ZPP_GeomVert);
  32597. if (null != this.vertices) {
  32598. var b = this.vertices,
  32599. d = this.vertices;
  32600. if (null != b) {
  32601. do b.sort(), b = b.next; while (b != d)
  32602. }
  32603. for (this.pull(this.vertices, a); null != this.vertices;) this.vertices = null != this.vertices && this.vertices.prev == this.vertices ? function (a) {
  32604. a.vertices.next = a.vertices.prev = null;
  32605. var b = a.vertices;
  32606. b.helper = null;
  32607. null;
  32608. b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32609. c.geom.ZPP_PartitionVertex.zpp_pool = b;
  32610. return a.vertices = null
  32611. }(this) : function (a) {
  32612. var b = a.vertices.next;
  32613. a.vertices.prev.next = a.vertices.next;
  32614. a.vertices.next.prev = a.vertices.prev;
  32615. a.vertices.next =
  32616. a.vertices.prev = null;
  32617. var d = a.vertices;
  32618. d.helper = null;
  32619. null;
  32620. d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32621. c.geom.ZPP_PartitionVertex.zpp_pool = d;
  32622. a.vertices = null;
  32623. return b
  32624. }(this)
  32625. }
  32626. return a
  32627. },
  32628. pull_partitions: function (a, b) {
  32629. var d;
  32630. null == c.geom.ZPP_PartitionedPoly.zpp_pool ? d = new c.geom.ZPP_PartitionedPoly : (d = c.geom.ZPP_PartitionedPoly.zpp_pool, c.geom.ZPP_PartitionedPoly.zpp_pool = d.next, d.next = null);
  32631. null;
  32632. var g = a;
  32633. do
  32634. if (d.vertices = function (a) {
  32635. a = g.copy();
  32636. null == d.vertices ? d.vertices = a.prev = a.next = a : (a.prev = d.vertices,
  32637. a.next = d.vertices.next, d.vertices.next.prev = a, d.vertices.next = a);
  32638. return a
  32639. }(this), d.vertices.forced = g.forced, null != g.diagonals.head)
  32640. if (g.diagonals.inlined_pop_unsafe() == a) break;
  32641. else g = this.pull_partitions(g, b);
  32642. else g = g.next; while (g != a);
  32643. 0 != function (a) {
  32644. a = 0;
  32645. var b = d.vertices,
  32646. c = d.vertices;
  32647. if (null != b) {
  32648. do {
  32649. var g = b;
  32650. a += g.x * (g.next.y - g.prev.y);
  32651. b = b.next
  32652. } while (b != c)
  32653. }
  32654. return 0.5 * a
  32655. }(this) && b.add(d);
  32656. return g
  32657. },
  32658. extract_partitions: function (a) {
  32659. null == a && (a = new c.util.ZNPList_ZPP_PartitionedPoly);
  32660. if (null != this.vertices) {
  32661. var b =
  32662. this.vertices,
  32663. d = this.vertices;
  32664. if (null != b) {
  32665. do b.sort(), b = b.next; while (b != d)
  32666. }
  32667. for (this.pull_partitions(this.vertices, a); null != this.vertices;) this.vertices = null != this.vertices && this.vertices.prev == this.vertices ? function (a) {
  32668. a.vertices.next = a.vertices.prev = null;
  32669. var b = a.vertices;
  32670. b.helper = null;
  32671. null;
  32672. b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32673. c.geom.ZPP_PartitionVertex.zpp_pool = b;
  32674. return a.vertices = null
  32675. }(this) : function (a) {
  32676. var b = a.vertices.next;
  32677. a.vertices.prev.next = a.vertices.next;
  32678. a.vertices.next.prev = a.vertices.prev;
  32679. a.vertices.next = a.vertices.prev = null;
  32680. var d = a.vertices;
  32681. d.helper = null;
  32682. null;
  32683. d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32684. c.geom.ZPP_PartitionVertex.zpp_pool = d;
  32685. a.vertices = null;
  32686. return b
  32687. }(this);
  32688. d = null;
  32689. for (b = a.head; null != b;) b.elt.remove_collinear_vertices() ? a.erase(d) : (d = b, b = b.next)
  32690. }
  32691. return a
  32692. },
  32693. add_diagonal: function (a, b) {
  32694. a.diagonals.add(b);
  32695. b.diagonals.add(a);
  32696. a.forced = b.forced = !0
  32697. },
  32698. remove_collinear_vertices: function () {
  32699. for (var a = this.vertices, b = !0; b || a != this.vertices;)
  32700. if (b = !1, this.eq(a, a.next)) {
  32701. if (a == this.vertices &&
  32702. (this.vertices = a.next, b = !0), a.forced && (a.next.forced = !0), a = null != a && a.prev == a ? function (b) {
  32703. a.next = a.prev = null;
  32704. b = a;
  32705. b.helper = null;
  32706. null;
  32707. b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32708. c.geom.ZPP_PartitionVertex.zpp_pool = b;
  32709. return a = null
  32710. }(this) : function (b) {
  32711. b = a.next;
  32712. a.prev.next = a.next;
  32713. a.next.prev = a.prev;
  32714. a.next = a.prev = null;
  32715. var d = a;
  32716. d.helper = null;
  32717. null;
  32718. d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32719. c.geom.ZPP_PartitionVertex.zpp_pool = d;
  32720. a = null;
  32721. return b
  32722. }(this), null == a) {
  32723. this.vertices = null;
  32724. break
  32725. }
  32726. } else a = a.next;
  32727. if (null ==
  32728. this.vertices) return !0;
  32729. var d;
  32730. do
  32731. for (d = !1, a = this.vertices, b = !0; b || a != this.vertices;) {
  32732. var b = !1,
  32733. g = a.prev,
  32734. e = 0,
  32735. f = 0,
  32736. e = a.x - g.x,
  32737. f = a.y - g.y,
  32738. l = g = 0,
  32739. g = a.next.x - a.x,
  32740. l = a.next.y - a.y,
  32741. e = l * e - g * f;
  32742. if (e * e >= h.Config.epsilon * h.Config.epsilon) a = a.next;
  32743. else if (a == this.vertices && (this.vertices = a.next, b = !0), a = null != a && a.prev == a ? function (b) {
  32744. a.next = a.prev = null;
  32745. b = a;
  32746. b.helper = null;
  32747. null;
  32748. b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32749. c.geom.ZPP_PartitionVertex.zpp_pool = b;
  32750. return a = null
  32751. }(this) : function (b) {
  32752. b = a.next;
  32753. a.prev.next = a.next;
  32754. a.next.prev =
  32755. a.prev;
  32756. a.next = a.prev = null;
  32757. var d = a;
  32758. d.helper = null;
  32759. null;
  32760. d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
  32761. c.geom.ZPP_PartitionVertex.zpp_pool = d;
  32762. a = null;
  32763. return b
  32764. }(this), d = !0, null == a) {
  32765. d = !1;
  32766. this.vertices = null;
  32767. break
  32768. }
  32769. }
  32770. while (d);
  32771. return null == this.vertices
  32772. },
  32773. init: function (a) {
  32774. if (null != a) {
  32775. var b = 0 < function (b) {
  32776. b = 0;
  32777. if (null != a) {
  32778. var d = a;
  32779. do {
  32780. var c = d;
  32781. b += c.x * (c.next.y - c.prev.y);
  32782. d = d.next
  32783. } while (d != a)
  32784. }
  32785. return 0.5 * b
  32786. }(this),
  32787. d = a;
  32788. do this.vertices = b ? function (a) {
  32789. var b = c.geom.ZPP_PartitionVertex.get(d);
  32790. null == a.vertices ? a.vertices = b.prev =
  32791. b.next = b : (b.prev = a.vertices, b.next = a.vertices.next, a.vertices.next.prev = b, a.vertices.next = b);
  32792. return b
  32793. }(this) : function (a) {
  32794. var b = c.geom.ZPP_PartitionVertex.get(d);
  32795. null == a.vertices ? a.vertices = b.prev = b.next = b : (b.next = a.vertices, b.prev = a.vertices.prev, a.vertices.prev.next = b, a.vertices.prev = b);
  32796. return b
  32797. }(this), this.vertices.forced = d.forced, d = d.next; while (d != a);
  32798. this.remove_collinear_vertices()
  32799. }
  32800. },
  32801. free: function () {},
  32802. alloc: function () {},
  32803. eq: function (a, b) {
  32804. return c.geom.ZPP_VecMath.vec_dsq(a.x, a.y, b.x, b.y) < h.Config.epsilon *
  32805. h.Config.epsilon
  32806. },
  32807. __class__: c.geom.ZPP_PartitionedPoly
  32808. };
  32809. c.geom.ZPP_Ray = function () {
  32810. this.zip_dir = !1;
  32811. this.originx = this.originy = this.dirx = this.diry = this.idirx = this.idiry = this.normalx = this.normaly = this.absnormalx = this.absnormaly = 0;
  32812. this.userData = null;
  32813. this.maxdist = 0;
  32814. this.origin = this.direction = null;
  32815. this.origin = h.geom.Vec2.get(null, null, null);
  32816. this.origin.zpp_inner._invalidate = A(this, this.origin_invalidate);
  32817. this.direction = h.geom.Vec2.get(null, null, null);
  32818. this.direction.zpp_inner._invalidate = A(this, this.direction_invalidate);
  32819. this.diry = this.dirx = this.originy = this.originx = 0;
  32820. this.zip_dir = !1
  32821. };
  32822. s["zpp_nape.geom.ZPP_Ray"] = c.geom.ZPP_Ray;
  32823. c.geom.ZPP_Ray.__name__ = ["zpp_nape", "geom", "ZPP_Ray"];
  32824. c.geom.ZPP_Ray.prototype = {
  32825. polysect2: function (a, b, d) {
  32826. for (var g = Math.POSITIVE_INFINITY, e = -1, f = null, l = null, m = a.edges.head, k = a.gverts.next, p = k, k = k.next; null != k;) {
  32827. var n = k,
  32828. r = m.elt;
  32829. if (b || 0 > r.gnormx * this.dirx + r.gnormy * this.diry) {
  32830. var q = 0,
  32831. w = 0,
  32832. q = n.x - p.x,
  32833. w = n.y - p.y,
  32834. t = r = 0,
  32835. r = p.x - this.originx,
  32836. t = p.y - this.originy,
  32837. p = w * this.dirx - q * this.diry;
  32838. p * p > h.Config.epsilon &&
  32839. (p = 1 / p, q = (w * r - q * t) * p, 0 < q && q <= this.maxdist && (q < g || q > e) && (p *= this.diry * r - this.dirx * t, p > -h.Config.epsilon && p < 1 + h.Config.epsilon && (q < g && (g = q, f = m.elt), q > e && (e = q, l = m.elt))))
  32840. }
  32841. m = m.next;
  32842. p = n;
  32843. k = k.next
  32844. }
  32845. n = k = a.gverts.next;
  32846. r = m.elt;
  32847. if (b || 0 > r.gnormx * this.dirx + r.gnormy * this.diry) q = n.x - p.x, w = n.y - p.y, r = p.x - this.originx, t = p.y - this.originy, p = w * this.dirx - q * this.diry, p * p > h.Config.epsilon && (p = 1 / p, q = (w * r - q * t) * p, 0 < q && q <= this.maxdist && (q < g || q > e) && (p *= this.diry * r - this.dirx * t, p > -h.Config.epsilon && p < 1 + h.Config.epsilon && (q < g && (g =
  32848. q, f = m.elt), q > e && (e = q, l = m.elt))));
  32849. if (null != f) {
  32850. m = b = 0;
  32851. b = f.gnormx;
  32852. m = f.gnormy;
  32853. if (k = 0 < b * this.dirx + m * this.diry) b = -b, m = -m;
  32854. g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, m, null), g, k, a.outer);
  32855. b = null;
  32856. for (m = d.zpp_inner.inner.head; null != m;) {
  32857. k = m.elt;
  32858. if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32859. n = g.zpp_inner.toiDistance;
  32860. if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32861. if (n < k.zpp_inner.toiDistance) break;
  32862. b = m;
  32863. m = m.next
  32864. }
  32865. d.zpp_inner.inner.inlined_insert(b,
  32866. g)
  32867. }
  32868. if (null != l && f != l) {
  32869. b = l.gnormx;
  32870. m = l.gnormy;
  32871. if (k = 0 < b * this.dirx + m * this.diry) b = -b, m = -m;
  32872. g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, m, null), e, k, a.outer);
  32873. b = null;
  32874. for (m = d.zpp_inner.inner.head; null != m;) {
  32875. k = m.elt;
  32876. if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32877. a = g.zpp_inner.toiDistance;
  32878. if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32879. if (a < k.zpp_inner.toiDistance) break;
  32880. b = m;
  32881. m = m.next
  32882. }
  32883. d.zpp_inner.inner.inlined_insert(b,
  32884. g)
  32885. }
  32886. },
  32887. polysect: function (a, b, d) {
  32888. for (var g = null, e = a.edges.head, f = a.gverts.next, l = f, f = f.next; null != f;) {
  32889. var m = f,
  32890. k = e.elt;
  32891. if (b || 0 > k.gnormx * this.dirx + k.gnormy * this.diry) {
  32892. var p = 0,
  32893. n = 0,
  32894. p = m.x - l.x,
  32895. n = m.y - l.y,
  32896. r = k = 0,
  32897. k = l.x - this.originx,
  32898. r = l.y - this.originy,
  32899. l = n * this.dirx - p * this.diry;
  32900. l * l > h.Config.epsilon && (l = 1 / l, p = (n * k - p * r) * l, 0 < p && p < d && p <= this.maxdist && (l *= this.diry * k - this.dirx * r, l > -h.Config.epsilon && l < 1 + h.Config.epsilon && (d = p, g = e.elt)))
  32901. }
  32902. e = e.next;
  32903. l = m;
  32904. f = f.next
  32905. }
  32906. m = f = a.gverts.next;
  32907. k = e.elt;
  32908. if (b || 0 > k.gnormx * this.dirx + k.gnormy *
  32909. this.diry) p = m.x - l.x, n = m.y - l.y, k = l.x - this.originx, r = l.y - this.originy, l = n * this.dirx - p * this.diry, l * l > h.Config.epsilon && (l = 1 / l, p = (n * k - p * r) * l, 0 < p && p < d && p <= this.maxdist && (l *= this.diry * k - this.dirx * r, l > -h.Config.epsilon && l < 1 + h.Config.epsilon && (d = p, g = e.elt)));
  32910. if (null != g) {
  32911. e = b = 0;
  32912. b = g.gnormx;
  32913. e = g.gnormy;
  32914. if (g = 0 < b * this.dirx + e * this.diry) b = -b, e = -e;
  32915. return c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, e, null), d, g, a.outer)
  32916. }
  32917. return null
  32918. },
  32919. circlesect2: function (a, b, d) {
  32920. a.zip_worldCOM && null != a.body && (a.zip_worldCOM = !1,
  32921. a.zip_localCOM && (a.zip_localCOM = !1, a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.__validate_localCOM(), null != a.wrap_localCOM && (a.wrap_localCOM.zpp_inner.x = a.localCOMx, a.wrap_localCOM.zpp_inner.y = a.localCOMy)), a.body.validate_axis(), a.worldCOMx = a.body.posx + (a.body.axisy * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy));
  32922. var g = 0,
  32923. e = 0,
  32924. g = this.originx - a.worldCOMx,
  32925. e = this.originy - a.worldCOMy,
  32926. f = this.dirx * this.dirx + this.diry * this.diry,
  32927. l = 2 * (g * this.dirx + e * this.diry),
  32928. g = g * g + e * e - a.radius * a.radius,
  32929. e = l * l - 4 * f * g;
  32930. if (0 == e) {
  32931. var m = -l / 2 * f;
  32932. if ((!b || 0 < g) && 0 < m && m <= this.maxdist) {
  32933. var e = l = 0,
  32934. l = this.originx,
  32935. e = this.originy,
  32936. f = m,
  32937. l = l + this.dirx * f,
  32938. e = e + this.diry * f,
  32939. f = 1,
  32940. l = l - a.worldCOMx * f,
  32941. e = e - a.worldCOMy * f,
  32942. k = 1 / Math.sqrt(l * l + e * e),
  32943. f = k,
  32944. l = l * f,
  32945. e = e * f;
  32946. 0 >= g && (l = -l, e = -e);
  32947. g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(l, e, null), m, 0 >= g, a.outer);
  32948. l = null;
  32949. for (e = d.zpp_inner.inner.head; null != e;) {
  32950. m = e.elt;
  32951. if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32952. a = g.zpp_inner.toiDistance;
  32953. if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32954. if (a < m.zpp_inner.toiDistance) break;
  32955. l = e;
  32956. e = e.next
  32957. }
  32958. d.zpp_inner.inner.inlined_insert(l, g)
  32959. }
  32960. } else {
  32961. e = Math.sqrt(e);
  32962. f = 1 / (2 * f);
  32963. g = (-l - e) * f;
  32964. f *= -l + e;
  32965. if (0 < g && g <= this.maxdist) {
  32966. l = this.originx;
  32967. e = this.originy;
  32968. m = g;
  32969. l += this.dirx * m;
  32970. e += this.diry * m;
  32971. m = 1;
  32972. l -= a.worldCOMx * m;
  32973. e -= a.worldCOMy * m;
  32974. m = k = 1 / Math.sqrt(l * l + e * e);
  32975. g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(l * m, e * m, null), g, !1, a.outer);
  32976. l = null;
  32977. for (e = d.zpp_inner.inner.head; null !=
  32978. e;) {
  32979. m = e.elt;
  32980. if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32981. k = g.zpp_inner.toiDistance;
  32982. if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  32983. if (k < m.zpp_inner.toiDistance) break;
  32984. l = e;
  32985. e = e.next
  32986. }
  32987. d.zpp_inner.inner.inlined_insert(l, g)
  32988. }
  32989. if (0 < f && f <= this.maxdist && b) {
  32990. l = this.originx;
  32991. e = this.originy;
  32992. m = f;
  32993. l += this.dirx * m;
  32994. e += this.diry * m;
  32995. m = 1;
  32996. l -= a.worldCOMx * m;
  32997. e -= a.worldCOMy * m;
  32998. b = l * l + e * e;
  32999. m = k = 1 / Math.sqrt(b);
  33000. l *= m;
  33001. e *= m;
  33002. l = -l;
  33003. e = -e;
  33004. g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(l,
  33005. e, null), f, !0, a.outer);
  33006. l = null;
  33007. for (e = d.zpp_inner.inner.head; null != e;) {
  33008. m = e.elt;
  33009. if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  33010. a = g.zpp_inner.toiDistance;
  33011. if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  33012. if (a < m.zpp_inner.toiDistance) break;
  33013. l = e;
  33014. e = e.next
  33015. }
  33016. d.zpp_inner.inner.inlined_insert(l, g)
  33017. }
  33018. }
  33019. },
  33020. circlesect: function (a, b, d) {
  33021. a.zip_worldCOM && null != a.body && (a.zip_worldCOM = !1, a.zip_localCOM && (a.zip_localCOM = !1, a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON &&
  33022. a.polygon.__validate_localCOM(), null != a.wrap_localCOM && (a.wrap_localCOM.zpp_inner.x = a.localCOMx, a.wrap_localCOM.zpp_inner.y = a.localCOMy)), a.body.validate_axis(), a.worldCOMx = a.body.posx + (a.body.axisy * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy));
  33023. var g = 0,
  33024. e = 0,
  33025. g = this.originx - a.worldCOMx,
  33026. e = this.originy - a.worldCOMy,
  33027. f = this.dirx * this.dirx + this.diry * this.diry,
  33028. l = 2 * (g * this.dirx + e * this.diry),
  33029. g = g * g + e * e - a.radius * a.radius,
  33030. e = l * l - 4 * f * g;
  33031. if (0 == e) {
  33032. if (l = -l / 2 * f, (!b || 0 < g) && 0 < l && l < d && l <= this.maxdist) return d = b = 0, b = this.originx, d = this.originy, f = l, b += this.dirx * f, d += this.diry * f, f = 1, b -= a.worldCOMx * f, d -= a.worldCOMy * f, f = e = 1 / Math.sqrt(b * b + d * d), b *= f, d *= f, 0 >= g && (b = -b, d = -d), c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, d, null), l, 0 >= g, a.outer)
  33033. } else if (e = Math.sqrt(e), f = 1 / (2 * f), g = (-l - e) * f, f *= -l + e, 0 < g) {
  33034. if (g < d && g <= this.maxdist) return b = this.originx, d = this.originy, l = g, b += this.dirx * l, d += this.diry * l, l = 1, b -= a.worldCOMx * l, d -= a.worldCOMy * l, l = e = 1 / Math.sqrt(b * b + d * d),
  33035. c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b * l, d * l, null), g, !1, a.outer)
  33036. } else if (0 < f && b && f < d && f <= this.maxdist) return b = this.originx, d = this.originy, l = f, b += this.dirx * l, d += this.diry * l, l = 1, b -= a.worldCOMx * l, d -= a.worldCOMy * l, g = b * b + d * d, l = e = 1 / Math.sqrt(g), b *= l, d *= l, b = -b, d = -d, c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, d, null), f, !0, a.outer);
  33037. return null
  33038. },
  33039. aabbsect: function (a) {
  33040. var b = this.originy >= a.miny && this.originy <= a.maxy;
  33041. if (this.originx >= a.minx && this.originx <= a.maxx && b) return 0;
  33042. b = -1;
  33043. do
  33044. if (!(0 <=
  33045. this.dirx && this.originx >= a.maxx || 0 >= this.dirx && this.originx <= a.minx || 0 <= this.diry && this.originy >= a.maxy || 0 >= this.diry && this.originy <= a.miny)) {
  33046. if (0 < this.dirx) {
  33047. var d = (a.minx - this.originx) * this.idirx;
  33048. if (0 <= d && d <= this.maxdist) {
  33049. var c = this.originy + d * this.diry;
  33050. if (c >= a.miny && c <= a.maxy) {
  33051. b = d;
  33052. break
  33053. }
  33054. }
  33055. } else if (0 > this.dirx && (d = (a.maxx - this.originx) * this.idirx, 0 <= d && d <= this.maxdist && (c = this.originy + d * this.diry, c >= a.miny && c <= a.maxy))) {
  33056. b = d;
  33057. break
  33058. }
  33059. 0 < this.diry ? (d = (a.miny - this.originy) * this.idiry, 0 <= d && d <= this.maxdist &&
  33060. (c = this.originx + d * this.dirx, c >= a.minx && c <= a.maxx && (b = d))) : 0 > this.diry && (d = (a.maxy - this.originy) * this.idiry, 0 <= d && d <= this.maxdist && (c = this.originx + d * this.dirx, c >= a.minx && c <= a.maxx && (b = d)))
  33061. }
  33062. while (0);
  33063. return b
  33064. },
  33065. aabbtest: function (a) {
  33066. var b = this.normalx * (this.originx - 0.5 * (a.minx + a.maxx)) + this.normaly * (this.originy - 0.5 * (a.miny + a.maxy));
  33067. return (0 > b ? -b : b) < 0.5 * this.absnormalx * (a.maxx - a.minx) + 0.5 * this.absnormaly * (a.maxy - a.miny)
  33068. },
  33069. rayAABB: function () {
  33070. var a = this.originx,
  33071. b = a,
  33072. d = this.originy,
  33073. g = d;
  33074. this.maxdist >= Math.POSITIVE_INFINITY ?
  33075. (0 < this.dirx ? b = Math.POSITIVE_INFINITY : 0 > this.dirx && (b = Math.NEGATIVE_INFINITY), 0 < this.diry ? g = Math.POSITIVE_INFINITY : 0 > this.diry && (g = Math.NEGATIVE_INFINITY)) : (b += this.maxdist * this.dirx, g += this.maxdist * this.diry);
  33076. if (b < a) var e = a,
  33077. a = b,
  33078. b = e;
  33079. g < d && (e = d, d = g, g = e);
  33080. return c.geom.ZPP_AABB.get(a, d, b, g)
  33081. },
  33082. validate_dir: function () {
  33083. if (this.zip_dir) {
  33084. this.zip_dir = !1;
  33085. if (this.dirx * this.dirx + this.diry * this.diry < h.Config.epsilon) throw "Error: Ray::direction is degenerate";
  33086. var a = 1 / Math.sqrt(this.dirx * this.dirx + this.diry * this.diry);
  33087. this.dirx *= a;
  33088. this.diry *= a;
  33089. this.idirx = 1 / this.dirx;
  33090. this.idiry = 1 / this.diry;
  33091. this.normalx = -this.diry;
  33092. this.normaly = this.dirx;
  33093. this.absnormalx = function (a) {
  33094. a = a.normalx;
  33095. return 0 > a ? -a : a
  33096. }(this);
  33097. this.absnormaly = function (a) {
  33098. a = a.normaly;
  33099. return 0 > a ? -a : a
  33100. }(this)
  33101. }
  33102. },
  33103. invalidate_dir: function () {
  33104. this.zip_dir = !0
  33105. },
  33106. direction_invalidate: function (a) {
  33107. this.dirx = a.x;
  33108. this.diry = a.y;
  33109. this.zip_dir = !0
  33110. },
  33111. origin_invalidate: function (a) {
  33112. this.originx = a.x;
  33113. this.originy = a.y
  33114. },
  33115. __class__: c.geom.ZPP_Ray
  33116. };
  33117. c.geom.ZPP_SimpleVert = function () {
  33118. this.next =
  33119. this.node = null;
  33120. this.id = 0;
  33121. this.links = null;
  33122. this.x = this.y = 0;
  33123. this.forced = !1;
  33124. this.id = c.ZPP_ID.ZPP_SimpleVert();
  33125. null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? this.links = new c.util.ZPP_Set_ZPP_SimpleVert : (this.links = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = this.links.next, this.links.next = null);
  33126. null;
  33127. this.links.lt = c.geom.ZPP_SimpleVert.less_xy
  33128. };
  33129. s["zpp_nape.geom.ZPP_SimpleVert"] = c.geom.ZPP_SimpleVert;
  33130. c.geom.ZPP_SimpleVert.__name__ = ["zpp_nape", "geom", "ZPP_SimpleVert"];
  33131. c.geom.ZPP_SimpleVert.less_xy =
  33132. function (a, b) {
  33133. return a.y < b.y || a.y == b.y && a.x < b.x
  33134. };
  33135. c.geom.ZPP_SimpleVert.swap_nodes = function (a, b) {
  33136. var d = a.node;
  33137. a.node = b.node;
  33138. b.node = d
  33139. };
  33140. c.geom.ZPP_SimpleVert.get = function (a, b) {
  33141. var d;
  33142. null == c.geom.ZPP_SimpleVert.zpp_pool ? d = new c.geom.ZPP_SimpleVert : (d = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = d.next, d.next = null);
  33143. null;
  33144. d.x = a;
  33145. d.y = b;
  33146. return d
  33147. };
  33148. c.geom.ZPP_SimpleVert.prototype = {
  33149. alloc: function () {},
  33150. free: function () {
  33151. this.links.clear();
  33152. this.node = null;
  33153. this.forced = !1
  33154. },
  33155. __class__: c.geom.ZPP_SimpleVert
  33156. };
  33157. c.geom.ZPP_SimpleSeg = function () {
  33158. this.next = this.prev = this.node = null;
  33159. this.id = 0;
  33160. this.left = this.right = this.vertices = null;
  33161. this.id = c.ZPP_ID.ZPP_SimpleSeg();
  33162. null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? this.vertices = new c.util.ZPP_Set_ZPP_SimpleVert : (this.vertices = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = this.vertices.next, this.vertices.next = null);
  33163. null;
  33164. this.vertices.lt = A(this, this.less_xy)
  33165. };
  33166. s["zpp_nape.geom.ZPP_SimpleSeg"] = c.geom.ZPP_SimpleSeg;
  33167. c.geom.ZPP_SimpleSeg.__name__ = ["zpp_nape", "geom", "ZPP_SimpleSeg"];
  33168. c.geom.ZPP_SimpleSeg.get = function (a, b) {
  33169. var d;
  33170. null == c.geom.ZPP_SimpleSeg.zpp_pool ? d = new c.geom.ZPP_SimpleSeg : (d = c.geom.ZPP_SimpleSeg.zpp_pool, c.geom.ZPP_SimpleSeg.zpp_pool = d.next, d.next = null);
  33171. null;
  33172. d.left = a;
  33173. d.right = b;
  33174. d.vertices.insert(a);
  33175. d.vertices.insert(b);
  33176. return d
  33177. };
  33178. c.geom.ZPP_SimpleSeg.prototype = {
  33179. less_xy: function (a, b) {
  33180. return a.x < b.x || a.x == b.x && a.y < b.y
  33181. },
  33182. alloc: function () {},
  33183. free: function () {
  33184. this.node = this.prev = this.left = this.right = null;
  33185. this.vertices.clear()
  33186. },
  33187. __class__: c.geom.ZPP_SimpleSeg
  33188. };
  33189. c.geom.ZPP_SimpleEvent = function () {
  33190. this.vertex = this.segment = this.segment2 = this.node = this.next = null;
  33191. this.type = 0
  33192. };
  33193. s["zpp_nape.geom.ZPP_SimpleEvent"] = c.geom.ZPP_SimpleEvent;
  33194. c.geom.ZPP_SimpleEvent.__name__ = ["zpp_nape", "geom", "ZPP_SimpleEvent"];
  33195. c.geom.ZPP_SimpleEvent.swap_nodes = function (a, b) {
  33196. var d = a.node;
  33197. a.node = b.node;
  33198. b.node = d
  33199. };
  33200. c.geom.ZPP_SimpleEvent.less_xy = function (a, b) {
  33201. return a.vertex.x < b.vertex.x ? !0 : a.vertex.x > b.vertex.x ? !1 : a.vertex.y < b.vertex.y ? !0 : a.vertex.y > b.vertex.y ? !1 : a.type < b.type
  33202. };
  33203. c.geom.ZPP_SimpleEvent.get =
  33204. function (a) {
  33205. var b;
  33206. null == c.geom.ZPP_SimpleEvent.zpp_pool ? b = new c.geom.ZPP_SimpleEvent : (b = c.geom.ZPP_SimpleEvent.zpp_pool, c.geom.ZPP_SimpleEvent.zpp_pool = b.next, b.next = null);
  33207. null;
  33208. b.vertex = a;
  33209. return b
  33210. };
  33211. c.geom.ZPP_SimpleEvent.prototype = {
  33212. alloc: function () {},
  33213. free: function () {
  33214. this.node = this.segment = this.segment2 = this.vertex = null
  33215. },
  33216. __class__: c.geom.ZPP_SimpleEvent
  33217. };
  33218. c.geom.ZPP_SimpleSweep = function () {
  33219. this.tree = null;
  33220. this.sweepx = 0;
  33221. null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? this.tree = new c.util.ZPP_Set_ZPP_SimpleSeg :
  33222. (this.tree = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = this.tree.next, this.tree.next = null);
  33223. null;
  33224. this.tree.lt = A(this, this.edge_lt);
  33225. this.tree.swapped = A(this, this.swap_nodes)
  33226. };
  33227. s["zpp_nape.geom.ZPP_SimpleSweep"] = c.geom.ZPP_SimpleSweep;
  33228. c.geom.ZPP_SimpleSweep.__name__ = ["zpp_nape", "geom", "ZPP_SimpleSweep"];
  33229. c.geom.ZPP_SimpleSweep.prototype = {
  33230. intersection: function (a, b) {
  33231. if (null == a || null == b || a.left == b.left || a.left == b.right || a.right == b.left || a.right == b.right) return null;
  33232. var d = 0,
  33233. g = 0,
  33234. d = a.right.x - a.left.x,
  33235. g = a.right.y - a.left.y,
  33236. e = 0,
  33237. f = 0,
  33238. e = b.right.x - b.left.x,
  33239. f = b.right.y - b.left.y,
  33240. l = f * d - e * g;
  33241. if (0 == l) return null;
  33242. var l = 1 / l,
  33243. h = 0,
  33244. k = 0,
  33245. h = b.left.x - a.left.x,
  33246. k = b.left.y - a.left.y,
  33247. p = (f * h - e * k) * l;
  33248. if (0 > p || 1 < p) return null;
  33249. l *= g * h - d * k;
  33250. if (0 > l || 1 < l) return null;
  33251. if (0 == l || 1 == l || 0 == p || 1 == p) {
  33252. d = 0 == l;
  33253. if (1 == l && d) throw "corner case 1a";
  33254. 1 == l && (d = !0);
  33255. if (0 == p && d) throw "corner case 1b";
  33256. 0 == p && (d = !0);
  33257. if (1 == p && d) throw "corner case 1c";
  33258. p = 0 == l ? b.left : 1 == l ? b.right : 0 == p ? a.left : a.right
  33259. } else p = c.geom.ZPP_SimpleVert.get(0.5 * (a.left.x +
  33260. d * p + b.left.x + e * l), 0.5 * (a.left.y + g * p + b.left.y + f * l));
  33261. p = c.geom.ZPP_SimpleEvent.get(p);
  33262. p.type = 0;
  33263. p.segment = a;
  33264. p.segment2 = b;
  33265. return p
  33266. },
  33267. intersect: function (a, b) {
  33268. return null == a || null == b || a.left == b.left || a.left == b.right || a.right == b.left || a.right == b.right || 0 < ((b.left.x - a.left.x) * (a.right.y - a.left.y) - (a.right.x - a.left.x) * (b.left.y - a.left.y)) * ((b.right.x - a.left.x) * (a.right.y - a.left.y) - (a.right.x - a.left.x) * (b.right.y - a.left.y)) ? !1 : 0 < ((a.left.x - b.left.x) * (b.right.y - b.left.y) - (b.right.x - b.left.x) * (a.left.y - b.left.y)) *
  33269. ((a.right.x - b.left.x) * (b.right.y - b.left.y) - (b.right.x - b.left.x) * (a.right.y - b.left.y)) ? !1 : !0
  33270. },
  33271. remove: function (a) {
  33272. var b = this.tree.successor_node(a.node),
  33273. d = this.tree.predecessor_node(a.node);
  33274. null != b && (b.data.prev = a.prev);
  33275. null != d && (d.data.next = a.next);
  33276. this.tree.remove_node(a.node);
  33277. a.node = null
  33278. },
  33279. add: function (a) {
  33280. a.node = this.tree.insert(a);
  33281. var b = this.tree.successor_node(a.node),
  33282. d = this.tree.predecessor_node(a.node);
  33283. null != b && (a.next = b.data, b.data.prev = a);
  33284. null != d && (a.prev = d.data, d.data.next = a);
  33285. return a
  33286. },
  33287. clear: function () {
  33288. this.tree.clear()
  33289. },
  33290. edge_lt: function (a, b) {
  33291. var d = 0,
  33292. c = 0,
  33293. e = 0,
  33294. f = 0,
  33295. l;
  33296. if (a.left == b.left && a.right == b.right) return !1;
  33297. if (a.left == b.right) return a.left.x == a.right.x ? d = a.left.y < a.right.y ? a.left.y > b.left.y : a.right.y > b.left.y : (l = a.right.x < a.left.x, d = a.right.x - a.left.x, c = a.right.y - a.left.y, e = b.left.x - a.left.x, f = b.left.y - a.left.y, d = 0 > (l ? c * e - d * f : f * d - e * c)), d;
  33298. if (a.right == b.left) return b.left.x == b.right.x ? d = b.left.y < b.right.y ? b.left.y > a.left.y : b.right.y > a.left.y : (l = b.right.x < b.left.x, d = b.right.x - b.left.x, c = b.right.y - b.left.y, e = a.left.x -
  33299. b.left.x, f = a.left.y - b.left.y, d = 0 > (l ? c * e - d * f : f * d - e * c)), !d;
  33300. if (a.left == b.left) return a.left.x == a.right.x ? d = a.left.y < a.right.y ? a.left.y > b.right.y : a.right.y > b.right.y : (l = a.right.x < a.left.x, d = a.right.x - a.left.x, c = a.right.y - a.left.y, e = b.right.x - a.left.x, f = b.right.y - a.left.y, d = 0 > (l ? c * e - d * f : f * d - e * c)), d;
  33301. if (a.right == b.right) return a.left.x == a.right.x ? d = a.left.y < a.right.y ? a.left.y > b.left.y : a.right.y > b.left.y : (l = a.right.x < a.left.x, d = a.right.x - a.left.x, c = a.right.y - a.left.y, e = b.left.x - a.left.x, f = b.left.y - a.left.y,
  33302. d = 0 > (l ? c * e - d * f : f * d - e * c)), d;
  33303. if (a.left.x == a.right.x) {
  33304. if (b.left.x == b.right.x) return (a.left.y < a.right.y ? a.right : a.left).y > (b.left.y < b.right.y ? b.right : b.left).y;
  33305. var h;
  33306. l = b.right.x < b.left.x;
  33307. d = b.right.x - b.left.x;
  33308. c = b.right.y - b.left.y;
  33309. e = a.left.x - b.left.x;
  33310. f = a.left.y - b.left.y;
  33311. h = l ? c * e - d * f : f * d - e * c;
  33312. l = b.right.x < b.left.x;
  33313. d = b.right.x - b.left.x;
  33314. c = b.right.y - b.left.y;
  33315. e = a.right.x - b.left.x;
  33316. f = a.right.y - b.left.y;
  33317. return 0 <= h * (l ? c * e - d * f : f * d - e * c) ? 0 <= h : this.sweepx >= a.left.x
  33318. }
  33319. if (b.left.x == b.right.x) return l = a.right.x < a.left.x, d =
  33320. a.right.x - a.left.x, c = a.right.y - a.left.y, e = b.left.x - a.left.x, f = b.left.y - a.left.y, h = l ? c * e - d * f : f * d - e * c, l = a.right.x < a.left.x, d = a.right.x - a.left.x, c = a.right.y - a.left.y, e = b.right.x - a.left.x, f = b.right.y - a.left.y, 0 <= h * (l ? c * e - d * f : f * d - e * c) ? 0 > h : this.sweepx < b.left.x;
  33321. l = a.right.x < a.left.x;
  33322. d = a.right.x - a.left.x;
  33323. c = a.right.y - a.left.y;
  33324. e = b.left.x - a.left.x;
  33325. f = b.left.y - a.left.y;
  33326. h = 0 > (l ? c * e - d * f : f * d - e * c);
  33327. l = a.right.x < a.left.x;
  33328. d = a.right.x - a.left.x;
  33329. c = a.right.y - a.left.y;
  33330. e = b.right.x - a.left.x;
  33331. f = b.right.y - a.left.y;
  33332. if (h == 0 > (l ? c * e -
  33333. d * f : f * d - e * c)) return h;
  33334. l = b.right.x < b.left.x;
  33335. d = b.right.x - b.left.x;
  33336. c = b.right.y - b.left.y;
  33337. e = a.left.x - b.left.x;
  33338. f = a.left.y - b.left.y;
  33339. h = 0 <= (l ? c * e - d * f : f * d - e * c);
  33340. l = b.right.x < b.left.x;
  33341. d = b.right.x - b.left.x;
  33342. c = b.right.y - b.left.y;
  33343. e = a.right.x - b.left.x;
  33344. f = a.right.y - b.left.y;
  33345. return h == 0 <= (l ? c * e - d * f : f * d - e * c) ? h : (this.sweepx - a.left.x) / (a.right.x - a.left.x) * (a.right.y - a.left.y) + a.left.y > (this.sweepx - b.left.x) / (b.right.x - b.left.x) * (b.right.y - b.left.y) + b.left.y
  33346. },
  33347. swap_nodes: function (a, b) {
  33348. var d = a.node;
  33349. a.node = b.node;
  33350. b.node = d
  33351. },
  33352. __class__: c.geom.ZPP_SimpleSweep
  33353. };
  33354. c.geom.ZPP_Simple = function () {};
  33355. s["zpp_nape.geom.ZPP_Simple"] = c.geom.ZPP_Simple;
  33356. c.geom.ZPP_Simple.__name__ = ["zpp_nape", "geom", "ZPP_Simple"];
  33357. c.geom.ZPP_Simple.decompose = function (a, b) {
  33358. null == c.geom.ZPP_Simple.sweep && (c.geom.ZPP_Simple.sweep = new c.geom.ZPP_SimpleSweep, c.geom.ZPP_Simple.inthash = new c.util.FastHash2_Hashable2_Boolfalse);
  33359. null == c.geom.ZPP_Simple.vertices && (null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? c.geom.ZPP_Simple.vertices = new c.util.ZPP_Set_ZPP_SimpleVert :
  33360. (c.geom.ZPP_Simple.vertices = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = c.geom.ZPP_Simple.vertices.next, c.geom.ZPP_Simple.vertices.next = null), null, c.geom.ZPP_Simple.vertices.lt = c.geom.ZPP_SimpleVert.less_xy, c.geom.ZPP_Simple.vertices.swapped = c.geom.ZPP_SimpleVert.swap_nodes);
  33361. null == c.geom.ZPP_Simple.queue && (null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? c.geom.ZPP_Simple.queue = new c.util.ZPP_Set_ZPP_SimpleEvent : (c.geom.ZPP_Simple.queue = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool,
  33362. c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = c.geom.ZPP_Simple.queue.next, c.geom.ZPP_Simple.queue.next = null), null, c.geom.ZPP_Simple.queue.lt = c.geom.ZPP_SimpleEvent.less_xy, c.geom.ZPP_Simple.queue.swapped = c.geom.ZPP_SimpleEvent.swap_nodes);
  33363. var d = null,
  33364. g = null;
  33365. if (null != a) {
  33366. var e = a;
  33367. do {
  33368. var f = e,
  33369. l = c.geom.ZPP_SimpleVert.get(f.x, f.y),
  33370. h = function (a) {
  33371. for (a = c.geom.ZPP_Simple.vertices.parent; null != a;)
  33372. if (c.geom.ZPP_Simple.vertices.lt(l, a.data)) a = a.prev;
  33373. else if (c.geom.ZPP_Simple.vertices.lt(a.data, l)) a = a.next;
  33374. else break;
  33375. return a
  33376. }(this);
  33377. null != h ? (f = l, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, l = h.data) : l.node = c.geom.ZPP_Simple.vertices.insert(l);
  33378. if (null != g) {
  33379. var f = c.geom.ZPP_SimpleEvent.get(g),
  33380. h = c.geom.ZPP_SimpleEvent.get(l),
  33381. k;
  33382. c.geom.ZPP_SimpleEvent.less_xy(f, h) ? (f.type = 1, h.type = 2, k = c.geom.ZPP_SimpleSeg.get(g, l)) : (f.type = 2, h.type = 1, k = c.geom.ZPP_SimpleSeg.get(l, g));
  33383. f.segment = h.segment = k;
  33384. c.geom.ZPP_Simple.queue.insert(f);
  33385. c.geom.ZPP_Simple.queue.insert(h);
  33386. g.links.insert(l);
  33387. l.links.insert(g)
  33388. }
  33389. g = l;
  33390. null == d && (d = l);
  33391. e = e.next
  33392. } while (e != a)
  33393. }
  33394. f = c.geom.ZPP_SimpleEvent.get(g);
  33395. h = c.geom.ZPP_SimpleEvent.get(d);
  33396. c.geom.ZPP_SimpleEvent.less_xy(f, h) ? (f.type = 1, h.type = 2, k = c.geom.ZPP_SimpleSeg.get(g, d)) : (f.type = 2, h.type = 1, k = c.geom.ZPP_SimpleSeg.get(d, g));
  33397. f.segment = h.segment = k;
  33398. c.geom.ZPP_Simple.queue.insert(f);
  33399. c.geom.ZPP_Simple.queue.insert(h);
  33400. g.links.insert(d);
  33401. d.links.insert(g);
  33402. null == c.geom.ZPP_Simple.ints && (null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? c.geom.ZPP_Simple.ints =
  33403. new c.util.ZPP_Set_ZPP_SimpleEvent : (c.geom.ZPP_Simple.ints = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = c.geom.ZPP_Simple.ints.next, c.geom.ZPP_Simple.ints.next = null), null, c.geom.ZPP_Simple.ints.lt = c.geom.ZPP_SimpleEvent.less_xy);
  33404. for (; !c.geom.ZPP_Simple.queue.empty();) {
  33405. d = c.geom.ZPP_Simple.queue.pop_front();
  33406. c.geom.ZPP_Simple.sweep.sweepx = d.vertex.x;
  33407. if (1 == d.type) {
  33408. g = d.segment;
  33409. c.geom.ZPP_Simple.sweep.add(g);
  33410. if (null != g.next && null != g && (g.next.id < g.id ? !c.geom.ZPP_Simple.inthash.has(g.next.id,
  33411. g.id) : !c.geom.ZPP_Simple.inthash.has(g.id, g.next.id))) {
  33412. var p = c.geom.ZPP_Simple.sweep.intersection(g.next, g);
  33413. if (null != p)
  33414. if (p.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
  33415. if (f = function (a) {
  33416. for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
  33417. if (c.geom.ZPP_Simple.queue.lt(p, a.data)) a = a.prev;
  33418. else if (c.geom.ZPP_Simple.queue.lt(a.data, p)) a = a.next;
  33419. else break;
  33420. return a
  33421. }(this), null == f) h = function (a) {
  33422. for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
  33423. if (c.geom.ZPP_Simple.ints.lt(p, a.data)) a = a.prev;
  33424. else if (c.geom.ZPP_Simple.ints.lt(a.data,
  33425. p)) a = a.next;
  33426. else break;
  33427. return a
  33428. }(this), null != h ? (f = p.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, p.vertex = h.data.vertex, h.data = p, c.geom.ZPP_Simple.queue.insert(p)) : (c.geom.ZPP_Simple.queue.insert(p), c.geom.ZPP_Simple.ints.insert(p)), g.next.id < g.id ? c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(g.next.id, g.id, !0)) : c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(g.id, g.next.id, !0));
  33429. else {
  33430. f = f.data;
  33431. if (f.segment !=
  33432. p.segment || p.segment2 != f.segment2) throw "corner case 2, shiiiit.";
  33433. f = p.vertex;
  33434. f.links.clear();
  33435. f.node = null;
  33436. f.forced = !1;
  33437. f.next = c.geom.ZPP_SimpleVert.zpp_pool;
  33438. c.geom.ZPP_SimpleVert.zpp_pool = f;
  33439. f = p;
  33440. f.vertex = null;
  33441. f.segment = f.segment2 = null;
  33442. f.node = null;
  33443. f.next = c.geom.ZPP_SimpleEvent.zpp_pool;
  33444. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33445. } else f = p.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, f = p, f.vertex = null, f.segment = f.segment2 = null, f.node = null, f.next =
  33446. c.geom.ZPP_SimpleEvent.zpp_pool, c.geom.ZPP_SimpleEvent.zpp_pool = f
  33447. }
  33448. if (null != g && null != g.prev && (g.id < g.prev.id ? !c.geom.ZPP_Simple.inthash.has(g.id, g.prev.id) : !c.geom.ZPP_Simple.inthash.has(g.prev.id, g.id)) && (p = c.geom.ZPP_Simple.sweep.intersection(g, g.prev), null != p))
  33449. if (p.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
  33450. if (f = function (a) {
  33451. for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
  33452. if (c.geom.ZPP_Simple.queue.lt(p, a.data)) a = a.prev;
  33453. else if (c.geom.ZPP_Simple.queue.lt(a.data, p)) a = a.next;
  33454. else break;
  33455. return a
  33456. }(this),
  33457. null == f) h = function (a) {
  33458. for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
  33459. if (c.geom.ZPP_Simple.ints.lt(p, a.data)) a = a.prev;
  33460. else if (c.geom.ZPP_Simple.ints.lt(a.data, p)) a = a.next;
  33461. else break;
  33462. return a
  33463. }(this), null != h ? (f = p.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, p.vertex = h.data.vertex, h.data = p, c.geom.ZPP_Simple.queue.insert(p)) : (c.geom.ZPP_Simple.queue.insert(p), c.geom.ZPP_Simple.ints.insert(p)), g.id < g.prev.id ? c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(g.id,
  33464. g.prev.id, !0)) : c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(g.prev.id, g.id, !0));
  33465. else {
  33466. f = f.data;
  33467. if (f.segment != p.segment || p.segment2 != f.segment2) throw "corner case 2, shiiiit.";
  33468. f = p.vertex;
  33469. f.links.clear();
  33470. f.node = null;
  33471. f.forced = !1;
  33472. f.next = c.geom.ZPP_SimpleVert.zpp_pool;
  33473. c.geom.ZPP_SimpleVert.zpp_pool = f;
  33474. f = p;
  33475. f.vertex = null;
  33476. f.segment = f.segment2 = null;
  33477. f.node = null;
  33478. f.next = c.geom.ZPP_SimpleEvent.zpp_pool;
  33479. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33480. } else f = p.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next =
  33481. c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, f = p, f.vertex = null, f.segment = f.segment2 = null, f.node = null, f.next = c.geom.ZPP_SimpleEvent.zpp_pool, c.geom.ZPP_SimpleEvent.zpp_pool = f
  33482. } else if (2 == d.type) {
  33483. if (g = d.segment, null != g.node && (e = g.next, k = g.prev, c.geom.ZPP_Simple.sweep.remove(g), f = g, f.left = f.right = null, f.prev = null, f.node = null, f.vertices.clear(), f.next = c.geom.ZPP_SimpleSeg.zpp_pool, c.geom.ZPP_SimpleSeg.zpp_pool = f, null != e && null != k && (e.id < k.id ? !c.geom.ZPP_Simple.inthash.has(e.id, k.id) :
  33484. !c.geom.ZPP_Simple.inthash.has(k.id, e.id)) && (p = c.geom.ZPP_Simple.sweep.intersection(e, k), null != p)))
  33485. if (p.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
  33486. if (f = function (a) {
  33487. for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
  33488. if (c.geom.ZPP_Simple.queue.lt(p, a.data)) a = a.prev;
  33489. else if (c.geom.ZPP_Simple.queue.lt(a.data, p)) a = a.next;
  33490. else break;
  33491. return a
  33492. }(this), null == f) h = function (a) {
  33493. for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
  33494. if (c.geom.ZPP_Simple.ints.lt(p, a.data)) a = a.prev;
  33495. else if (c.geom.ZPP_Simple.ints.lt(a.data, p)) a = a.next;
  33496. else break;
  33497. return a
  33498. }(this), null != h ? (f = p.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, p.vertex = h.data.vertex, h.data = p, c.geom.ZPP_Simple.queue.insert(p)) : (c.geom.ZPP_Simple.queue.insert(p), c.geom.ZPP_Simple.ints.insert(p)), e.id < k.id ? c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(e.id, k.id, !0)) : c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(k.id, e.id, !0));
  33499. else {
  33500. f = f.data;
  33501. if (f.segment != p.segment || p.segment2 !=
  33502. f.segment2) throw "corner case 2, shiiiit.";
  33503. f = p.vertex;
  33504. f.links.clear();
  33505. f.node = null;
  33506. f.forced = !1;
  33507. f.next = c.geom.ZPP_SimpleVert.zpp_pool;
  33508. c.geom.ZPP_SimpleVert.zpp_pool = f;
  33509. f = p;
  33510. f.vertex = null;
  33511. f.segment = f.segment2 = null;
  33512. f.node = null;
  33513. f.next = c.geom.ZPP_SimpleEvent.zpp_pool;
  33514. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33515. } else f = p.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, f = p, f.vertex = null, f.segment = f.segment2 = null, f.node = null, f.next = c.geom.ZPP_SimpleEvent.zpp_pool,
  33516. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33517. } else {
  33518. var p = d.vertex,
  33519. f = null == p.node,
  33520. n = d.segment,
  33521. r = d.segment2;
  33522. r.next != n && (g = n, n = r, r = g);
  33523. e = null == function (a) {
  33524. for (a = n.vertices.parent; null != a;)
  33525. if (n.vertices.lt(p, a.data)) a = a.prev;
  33526. else if (n.vertices.lt(a.data, p)) a = a.next;
  33527. else break;
  33528. return a
  33529. }(this);
  33530. g = null == function (a) {
  33531. for (a = r.vertices.parent; null != a;)
  33532. if (r.vertices.lt(p, a.data)) a = a.prev;
  33533. else if (r.vertices.lt(a.data, p)) a = a.next;
  33534. else break;
  33535. return a
  33536. }(this);
  33537. e && (h = n.vertices.insert(p), e = p == n.left ? p : n.vertices.predecessor_node(h).data,
  33538. h = p == n.right ? p : n.vertices.successor_node(h).data, e.links.remove(h), p != e && e.links.insert(p), h.links.remove(e), p != h && h.links.insert(p), p != e && p.links.insert(e), p != h && p.links.insert(h));
  33539. g && (e = r.vertices.insert(p), g = p == r.left ? p : r.vertices.predecessor_node(e).data, e = p == r.right ? p : r.vertices.successor_node(e).data, g.links.remove(e), p != g && g.links.insert(p), e.links.remove(g), p != e && e.links.insert(p), p != g && p.links.insert(g), p != e && p.links.insert(e));
  33540. f && (p.node = c.geom.ZPP_Simple.vertices.insert(p));
  33541. p.forced = !0;
  33542. f && (f = n.node, g = r.node, f.data = r, g.data = n, n.node = g, r.node = f, r.next = n.next, n.next = r, n.prev = r.prev, r.prev = n, null != n.prev && (n.prev.next = n), null != r.next && (r.next.prev = r));
  33543. if (null != r.next && null != r && (r.next.id < r.id ? !c.geom.ZPP_Simple.inthash.has(r.next.id, r.id) : !c.geom.ZPP_Simple.inthash.has(r.id, r.next.id))) {
  33544. var q = c.geom.ZPP_Simple.sweep.intersection(r.next, r);
  33545. if (null != q)
  33546. if (q.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
  33547. if (f = function (a) {
  33548. for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
  33549. if (c.geom.ZPP_Simple.queue.lt(q,
  33550. a.data)) a = a.prev;
  33551. else if (c.geom.ZPP_Simple.queue.lt(a.data, q)) a = a.next;
  33552. else break;
  33553. return a
  33554. }(this), null == f) h = function (a) {
  33555. for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
  33556. if (c.geom.ZPP_Simple.ints.lt(q, a.data)) a = a.prev;
  33557. else if (c.geom.ZPP_Simple.ints.lt(a.data, q)) a = a.next;
  33558. else break;
  33559. return a
  33560. }(this), null != h ? (f = q.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, q.vertex = h.data.vertex, h.data = q, c.geom.ZPP_Simple.queue.insert(q)) : (c.geom.ZPP_Simple.queue.insert(q),
  33561. c.geom.ZPP_Simple.ints.insert(q)), r.next.id < r.id ? c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(r.next.id, r.id, !0)) : c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(r.id, r.next.id, !0));
  33562. else {
  33563. f = f.data;
  33564. if (f.segment != q.segment || q.segment2 != f.segment2) throw "corner case 2, shiiiit.";
  33565. f = q.vertex;
  33566. f.links.clear();
  33567. f.node = null;
  33568. f.forced = !1;
  33569. f.next = c.geom.ZPP_SimpleVert.zpp_pool;
  33570. c.geom.ZPP_SimpleVert.zpp_pool = f;
  33571. f = q;
  33572. f.vertex = null;
  33573. f.segment = f.segment2 = null;
  33574. f.node = null;
  33575. f.next = c.geom.ZPP_SimpleEvent.zpp_pool;
  33576. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33577. } else f = q.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, f = q, f.vertex = null, f.segment = f.segment2 = null, f.node = null, f.next = c.geom.ZPP_SimpleEvent.zpp_pool, c.geom.ZPP_SimpleEvent.zpp_pool = f
  33578. }
  33579. if (null != n && null != n.prev && (n.id < n.prev.id ? !c.geom.ZPP_Simple.inthash.has(n.id, n.prev.id) : !c.geom.ZPP_Simple.inthash.has(n.prev.id, n.id)) && (q = c.geom.ZPP_Simple.sweep.intersection(n, n.prev), null != q))
  33580. if (q.vertex.x >=
  33581. c.geom.ZPP_Simple.sweep.sweepx)
  33582. if (f = function (a) {
  33583. for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
  33584. if (c.geom.ZPP_Simple.queue.lt(q, a.data)) a = a.prev;
  33585. else if (c.geom.ZPP_Simple.queue.lt(a.data, q)) a = a.next;
  33586. else break;
  33587. return a
  33588. }(this), null == f) h = function (a) {
  33589. for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
  33590. if (c.geom.ZPP_Simple.ints.lt(q, a.data)) a = a.prev;
  33591. else if (c.geom.ZPP_Simple.ints.lt(a.data, q)) a = a.next;
  33592. else break;
  33593. return a
  33594. }(this), null != h ? (f = q.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool,
  33595. c.geom.ZPP_SimpleVert.zpp_pool = f, q.vertex = h.data.vertex, h.data = q, c.geom.ZPP_Simple.queue.insert(q)) : (c.geom.ZPP_Simple.queue.insert(q), c.geom.ZPP_Simple.ints.insert(q)), n.id < n.prev.id ? c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(n.id, n.prev.id, !0)) : c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(n.prev.id, n.id, !0));
  33596. else {
  33597. f = f.data;
  33598. if (f.segment != q.segment || q.segment2 != f.segment2) throw "corner case 2, shiiiit.";
  33599. f = q.vertex;
  33600. f.links.clear();
  33601. f.node = null;
  33602. f.forced = !1;
  33603. f.next = c.geom.ZPP_SimpleVert.zpp_pool;
  33604. c.geom.ZPP_SimpleVert.zpp_pool = f;
  33605. f = q;
  33606. f.vertex = null;
  33607. f.segment = f.segment2 = null;
  33608. f.node = null;
  33609. f.next = c.geom.ZPP_SimpleEvent.zpp_pool;
  33610. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33611. } else f = q.vertex, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f, f = q, f.vertex = null, f.segment = f.segment2 = null, f.node = null, f.next = c.geom.ZPP_SimpleEvent.zpp_pool, c.geom.ZPP_SimpleEvent.zpp_pool = f;
  33612. c.geom.ZPP_Simple.ints.remove(d)
  33613. }
  33614. f = d;
  33615. f.vertex = null;
  33616. f.segment = f.segment2 = null;
  33617. f.node =
  33618. null;
  33619. f.next = c.geom.ZPP_SimpleEvent.zpp_pool;
  33620. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33621. }
  33622. d = 0;
  33623. for (e = c.geom.ZPP_Simple.inthash.table.length; d < e;)
  33624. if (h = d++, f = c.geom.ZPP_Simple.inthash.table[h], null != f) {
  33625. for (; null != f;) g = f.hnext, f.hnext = null, f.next = c.util.Hashable2_Boolfalse.zpp_pool, c.util.Hashable2_Boolfalse.zpp_pool = f, f = g;
  33626. c.geom.ZPP_Simple.inthash.table[h] = null
  33627. }
  33628. for (null == b && (b = new c.util.ZNPList_ZPP_GeomVert); !c.geom.ZPP_Simple.vertices.empty();) c.geom.ZPP_Simple.clip_polygon(c.geom.ZPP_Simple.vertices, b);
  33629. return b
  33630. };
  33631. c.geom.ZPP_Simple.clip_polygon = function (a, b) {
  33632. var d = null,
  33633. g = a.first(),
  33634. e = g,
  33635. f = g.links.parent,
  33636. l = f.data,
  33637. h = (null == f.prev ? f.next : f.prev).data;
  33638. 0 > function (a) {
  33639. var b = a = 0;
  33640. a = g.x - l.x;
  33641. var b = g.y - l.y,
  33642. d = 0,
  33643. c = 0,
  33644. d = h.x - g.x,
  33645. c = h.y - g.y;
  33646. return c * a - d * b
  33647. }(this) && (h = l);
  33648. d = function (a) {
  33649. a = c.geom.ZPP_GeomVert.get(g.x, g.y);
  33650. null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
  33651. return a
  33652. }(this);
  33653. for (d.forced = g.forced;;) {
  33654. g.links.remove(h);
  33655. h.links.remove(g);
  33656. if (h == e) {
  33657. g.links.empty() && (a.remove(g), f = g, f.links.clear(), f.node =
  33658. null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f);
  33659. break
  33660. }
  33661. d = function (a) {
  33662. a = c.geom.ZPP_GeomVert.get(h.x, h.y);
  33663. null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
  33664. return a
  33665. }(this);
  33666. d.forced = h.forced;
  33667. if (h.links.singular()) g.links.empty() && (a.remove(g), f = g, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f), g = h, h = h.links.parent.data;
  33668. else {
  33669. var k = null,
  33670. f = 0;
  33671. if (!h.links.empty()) {
  33672. for (var p = h.links.parent; null !=
  33673. p.prev;) p = p.prev;
  33674. for (; null != p;) {
  33675. var n = p.data;
  33676. if (null == k) k = n, f = function (a) {
  33677. var b = a = 0;
  33678. a = h.x - g.x;
  33679. var b = h.y - g.y,
  33680. d = 0,
  33681. c = 0,
  33682. d = n.x - h.x,
  33683. c = n.y - h.y;
  33684. return c * a - d * b
  33685. }(this);
  33686. else {
  33687. var r = function (a) {
  33688. var b = a = 0;
  33689. a = h.x - g.x;
  33690. var b = h.y - g.y,
  33691. d = 0,
  33692. c = 0,
  33693. d = n.x - h.x,
  33694. c = n.y - h.y;
  33695. return c * a - d * b
  33696. }(this);
  33697. 0 < r && 0 >= f ? (k = n, f = r) : 0 <= f * r && 0 < function (a) {
  33698. var b = a = 0;
  33699. a = h.x - n.x;
  33700. var b = h.y - n.y,
  33701. d = 0,
  33702. c = 0,
  33703. d = k.x - h.x,
  33704. c = k.y - h.y;
  33705. return c * a - d * b
  33706. }(this) && (k = n, f = r)
  33707. } if (null != p.next)
  33708. for (p = p.next; null != p.prev;) p = p.prev;
  33709. else {
  33710. for (; null != p.parent && p == p.parent.next;) p = p.parent;
  33711. p = p.parent
  33712. }
  33713. }
  33714. }
  33715. g.links.empty() && (a.remove(g), f = g, f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f);
  33716. g = h;
  33717. h = k
  33718. }
  33719. }
  33720. a.remove(e);
  33721. f = e;
  33722. f.links.clear();
  33723. f.node = null;
  33724. f.forced = !1;
  33725. f.next = c.geom.ZPP_SimpleVert.zpp_pool;
  33726. c.geom.ZPP_SimpleVert.zpp_pool = f;
  33727. b.add(d)
  33728. };
  33729. c.geom.ZPP_Simple.isSimple = function (a) {
  33730. null == c.geom.ZPP_Simple.sweep && (c.geom.ZPP_Simple.sweep = new c.geom.ZPP_SimpleSweep, c.geom.ZPP_Simple.inthash = new c.util.FastHash2_Hashable2_Boolfalse);
  33731. var b =
  33732. c.geom.ZPP_Simple.list_vertices;
  33733. null == b && (b = c.geom.ZPP_Simple.list_vertices = new c.util.ZNPList_ZPP_SimpleVert);
  33734. if (null != a) {
  33735. var d = a;
  33736. do {
  33737. var g = d;
  33738. b.add(c.geom.ZPP_SimpleVert.get(g.x, g.y));
  33739. d = d.next
  33740. } while (d != a)
  33741. }
  33742. a = c.geom.ZPP_Simple.list_queue;
  33743. null == a && (a = c.geom.ZPP_Simple.list_queue = new c.util.ZNPList_ZPP_SimpleEvent);
  33744. for (var e = b.head, d = e.elt, e = e.next; null != e;) {
  33745. var g = e.elt,
  33746. f = a.add(c.geom.ZPP_SimpleEvent.get(d)),
  33747. l = a.add(c.geom.ZPP_SimpleEvent.get(g)),
  33748. h = f,
  33749. k = l;
  33750. c.geom.ZPP_SimpleEvent.less_xy(f, l) ? (f.type = 1,
  33751. l.type = 2, d = c.geom.ZPP_SimpleSeg.get(d, g)) : (f.type = 2, l.type = 1, d = c.geom.ZPP_SimpleSeg.get(g, d));
  33752. h.segment = k.segment = d;
  33753. d = g;
  33754. e = e.next
  33755. }
  33756. g = b.head.elt;
  33757. f = a.add(c.geom.ZPP_SimpleEvent.get(d));
  33758. l = a.add(c.geom.ZPP_SimpleEvent.get(g));
  33759. e = f;
  33760. h = l;
  33761. c.geom.ZPP_SimpleEvent.less_xy(f, l) ? (f.type = 1, l.type = 2, g = c.geom.ZPP_SimpleSeg.get(d, g)) : (f.type = 2, l.type = 1, g = c.geom.ZPP_SimpleSeg.get(g, d));
  33762. e.segment = h.segment = g;
  33763. g = a;
  33764. if (null != g.head && null != g.head.next) {
  33765. var d = g.head,
  33766. h = e = l = f = null,
  33767. k = 1,
  33768. p, n, r;
  33769. do {
  33770. p = 0;
  33771. l = d;
  33772. for (f = d = null; null != l;) {
  33773. p++;
  33774. e = l;
  33775. n = 0;
  33776. for (r = k; null != e && n < k;) n++, e = e.next;
  33777. for (; 0 < n || 0 < r && null != e;) 0 == n ? (h = e, e = e.next, r--) : 0 == r || null == e ? (h = l, l = l.next, n--) : c.geom.ZPP_SimpleEvent.less_xy(l.elt, e.elt) ? (h = l, l = l.next, n--) : (h = e, e = e.next, r--), null != f ? f.next = h : d = h, f = h;
  33778. l = e
  33779. }
  33780. f.next = null;
  33781. k <<= 1
  33782. } while (1 < p);
  33783. g.head = d;
  33784. g.modified = !0;
  33785. g.pushmod = !0
  33786. }
  33787. for (g = !0; null != a.head;) {
  33788. d = a.pop_unsafe();
  33789. f = d.segment;
  33790. if (1 == d.type) {
  33791. if (c.geom.ZPP_Simple.sweep.add(f), c.geom.ZPP_Simple.sweep.intersect(f, f.next) || c.geom.ZPP_Simple.sweep.intersect(f, f.prev)) {
  33792. g = !1;
  33793. break
  33794. }
  33795. } else if (2 ==
  33796. d.type) {
  33797. if (c.geom.ZPP_Simple.sweep.intersect(f.prev, f.next)) {
  33798. g = !1;
  33799. break
  33800. }
  33801. c.geom.ZPP_Simple.sweep.remove(f);
  33802. f.left = f.right = null;
  33803. f.prev = null;
  33804. f.node = null;
  33805. f.vertices.clear();
  33806. f.next = c.geom.ZPP_SimpleSeg.zpp_pool;
  33807. c.geom.ZPP_SimpleSeg.zpp_pool = f
  33808. }
  33809. f = d;
  33810. f.vertex = null;
  33811. f.segment = f.segment2 = null;
  33812. f.node = null;
  33813. f.next = c.geom.ZPP_SimpleEvent.zpp_pool;
  33814. c.geom.ZPP_SimpleEvent.zpp_pool = f
  33815. }
  33816. for (; null != a.head;) d = a.pop_unsafe(), 2 == d.type && (f = d.segment, f.left = f.right = null, f.prev = null, f.node = null, f.vertices.clear(), f.next = c.geom.ZPP_SimpleSeg.zpp_pool,
  33817. c.geom.ZPP_SimpleSeg.zpp_pool = f), f = d, f.vertex = null, f.segment = f.segment2 = null, f.node = null, f.next = c.geom.ZPP_SimpleEvent.zpp_pool, c.geom.ZPP_SimpleEvent.zpp_pool = f;
  33818. for (c.geom.ZPP_Simple.sweep.clear(); null != b.head;) f = b.pop_unsafe(), f.links.clear(), f.node = null, f.forced = !1, f.next = c.geom.ZPP_SimpleVert.zpp_pool, c.geom.ZPP_SimpleVert.zpp_pool = f;
  33819. return g
  33820. };
  33821. c.geom.ZPP_SimplifyV = function () {
  33822. this.flag = this.forced = !1;
  33823. this.next = this.prev = null;
  33824. this.x = this.y = 0
  33825. };
  33826. s["zpp_nape.geom.ZPP_SimplifyV"] = c.geom.ZPP_SimplifyV;
  33827. c.geom.ZPP_SimplifyV.__name__ = ["zpp_nape", "geom", "ZPP_SimplifyV"];
  33828. c.geom.ZPP_SimplifyV.get = function (a) {
  33829. var b;
  33830. null == c.geom.ZPP_SimplifyV.zpp_pool ? b = new c.geom.ZPP_SimplifyV : (b = c.geom.ZPP_SimplifyV.zpp_pool, c.geom.ZPP_SimplifyV.zpp_pool = b.next, b.next = null);
  33831. null;
  33832. b.x = a.x;
  33833. b.y = a.y;
  33834. b.flag = !1;
  33835. return b
  33836. };
  33837. c.geom.ZPP_SimplifyV.prototype = {
  33838. alloc: function () {},
  33839. free: function () {},
  33840. __class__: c.geom.ZPP_SimplifyV
  33841. };
  33842. c.geom.ZPP_SimplifyP = function () {
  33843. this.next = this.min = this.max = null
  33844. };
  33845. s["zpp_nape.geom.ZPP_SimplifyP"] = c.geom.ZPP_SimplifyP;
  33846. c.geom.ZPP_SimplifyP.__name__ = ["zpp_nape", "geom", "ZPP_SimplifyP"];
  33847. c.geom.ZPP_SimplifyP.get = function (a, b) {
  33848. var d;
  33849. null == c.geom.ZPP_SimplifyP.zpp_pool ? d = new c.geom.ZPP_SimplifyP : (d = c.geom.ZPP_SimplifyP.zpp_pool, c.geom.ZPP_SimplifyP.zpp_pool = d.next, d.next = null);
  33850. null;
  33851. d.min = a;
  33852. d.max = b;
  33853. return d
  33854. };
  33855. c.geom.ZPP_SimplifyP.prototype = {
  33856. alloc: function () {},
  33857. free: function () {
  33858. this.min = this.max = null
  33859. },
  33860. __class__: c.geom.ZPP_SimplifyP
  33861. };
  33862. c.geom.ZPP_Simplify = function () {};
  33863. s["zpp_nape.geom.ZPP_Simplify"] = c.geom.ZPP_Simplify;
  33864. c.geom.ZPP_Simplify.__name__ = ["zpp_nape", "geom", "ZPP_Simplify"];
  33865. c.geom.ZPP_Simplify.lessval = function (a, b) {
  33866. return a.x - b.x + (a.y - b.y)
  33867. };
  33868. c.geom.ZPP_Simplify.less = function (a, b) {
  33869. return 0 > a.x - b.x + (a.y - b.y)
  33870. };
  33871. c.geom.ZPP_Simplify.distance = function (a, b, d) {
  33872. var g = 0,
  33873. e = 0,
  33874. g = d.x - b.x,
  33875. e = d.y - b.y,
  33876. f = 0,
  33877. l = 0,
  33878. f = a.x - b.x,
  33879. l = a.y - b.y;
  33880. if (0 == g * g + e * e) return f * f + l * l;
  33881. b = (f * g + l * e) / (g * g + e * e);
  33882. if (0 >= b) return f * f + l * l;
  33883. if (1 <= b) return c.geom.ZPP_VecMath.vec_dsq(a.x, a.y, d.x, d.y);
  33884. f -= g * b;
  33885. l -= e * b;
  33886. return f * f + l * l
  33887. };
  33888. c.geom.ZPP_Simplify.simplify = function (a, b) {
  33889. var d = null,
  33890. g = null,
  33891. e =
  33892. null;
  33893. b *= b;
  33894. null == c.geom.ZPP_Simplify.stack && (c.geom.ZPP_Simplify.stack = new c.util.ZNPList_ZPP_SimplifyP);
  33895. var f = null,
  33896. l = null,
  33897. h = a;
  33898. do {
  33899. var k = c.geom.ZPP_SimplifyV.get(h);
  33900. k.forced = h.forced;
  33901. k.forced && (k.flag = !0, null != f ? c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(f, k)) : l = k, f = k);
  33902. d = function (a) {
  33903. a = k;
  33904. null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
  33905. return a
  33906. }(this);
  33907. null == g ? e = g = d : (0 > d.x - g.x + (d.y - g.y) && (g = d), 0 > e.x - d.x + (e.y - d.y) && (e = d));
  33908. h = h.next
  33909. } while (h != a);
  33910. null == c.geom.ZPP_Simplify.stack.head ?
  33911. null == l ? (g.flag = e.flag = !0, c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(g, e)), c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(e, g))) : (f = g.x - l.x + (g.y - l.y), 0 > f && (f = -f), h = e.x - l.x + (e.y - l.y), 0 > h && (h = -h), f > h ? (g.flag = l.flag = !0, c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(g, l)), c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(l, g))) : (e.flag = l.flag = !0, c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(e, l)), c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(l, e)))) :
  33912. c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(f, l));
  33913. for (; null != c.geom.ZPP_Simplify.stack.head;) {
  33914. l = c.geom.ZPP_Simplify.stack.pop_unsafe();
  33915. g = l.min;
  33916. e = l.max;
  33917. l.min = l.max = null;
  33918. l.next = c.geom.ZPP_SimplifyP.zpp_pool;
  33919. c.geom.ZPP_SimplifyP.zpp_pool = l;
  33920. l = b;
  33921. f = null;
  33922. for (h = g.next; h != e;) {
  33923. var p = c.geom.ZPP_Simplify.distance(h, g, e);
  33924. p > l && (l = p, f = h);
  33925. h = h.next
  33926. }
  33927. null != f && (f.flag = !0, c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(g, f)), c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(f, e)))
  33928. }
  33929. for (var n = null; null !=
  33930. d;) d.flag && (n = function (a) {
  33931. a = c.geom.ZPP_GeomVert.get(d.x, d.y);
  33932. null == n ? n = a.prev = a.next = a : (a.prev = n, a.next = n.next, n.next.prev = a, n.next = a);
  33933. return a
  33934. }(this), n.forced = d.forced), d = null != d && d.prev == d ? function (a) {
  33935. d.next = d.prev = null;
  33936. a = d;
  33937. a.next = c.geom.ZPP_SimplifyV.zpp_pool;
  33938. c.geom.ZPP_SimplifyV.zpp_pool = a;
  33939. return d = null
  33940. }(this) : function (a) {
  33941. a = d.next;
  33942. d.prev.next = d.next;
  33943. d.next.prev = d.prev;
  33944. d.next = d.prev = null;
  33945. var b = d;
  33946. b.next = c.geom.ZPP_SimplifyV.zpp_pool;
  33947. c.geom.ZPP_SimplifyV.zpp_pool = b;
  33948. d = null;
  33949. return a
  33950. }(this);
  33951. return n
  33952. };
  33953. c.geom.ZPP_ToiEvent = function () {
  33954. this.slipped = this.failed = this.kinematic = !1;
  33955. this.c1 = this.c2 = this.axis = null;
  33956. this.frozen1 = this.frozen2 = !1;
  33957. this.s1 = this.s2 = this.arbiter = null;
  33958. this.toi = 0;
  33959. this.next = null;
  33960. this.c1 = new c.geom.ZPP_Vec2;
  33961. this.c2 = new c.geom.ZPP_Vec2;
  33962. this.axis = new c.geom.ZPP_Vec2
  33963. };
  33964. s["zpp_nape.geom.ZPP_ToiEvent"] = c.geom.ZPP_ToiEvent;
  33965. c.geom.ZPP_ToiEvent.__name__ = ["zpp_nape", "geom", "ZPP_ToiEvent"];
  33966. c.geom.ZPP_ToiEvent.prototype = {
  33967. free: function () {},
  33968. alloc: function () {
  33969. this.failed = !1;
  33970. this.arbiter = this.s1 = this.s2 =
  33971. null
  33972. },
  33973. __class__: c.geom.ZPP_ToiEvent
  33974. };
  33975. c.geom.ZPP_SweepDistance = function () {};
  33976. s["zpp_nape.geom.ZPP_SweepDistance"] = c.geom.ZPP_SweepDistance;
  33977. c.geom.ZPP_SweepDistance.__name__ = ["zpp_nape", "geom", "ZPP_SweepDistance"];
  33978. c.geom.ZPP_SweepDistance.dynamicSweep = function (a, b, d, g, e) {
  33979. null == e && (e = !1);
  33980. var f = a.s1,
  33981. l = a.s2,
  33982. m = f.body,
  33983. k = l.body,
  33984. p = 0,
  33985. n = 0,
  33986. p = k.velx - m.velx,
  33987. n = k.vely - m.vely,
  33988. r = m.angvel;
  33989. 0 > r && (r = -r);
  33990. var q = k.angvel;
  33991. 0 > q && (q = -q);
  33992. var w = f.sweepCoef * r + l.sweepCoef * q;
  33993. if (!e && !a.kinematic && p * p + n * n < h.Config.dynamicSweepLinearThreshold *
  33994. h.Config.dynamicSweepLinearThreshold && w < h.Config.dynamicSweepAngularThreshold) a.toi = -1, a.failed = !0;
  33995. else {
  33996. for (var r = a.c1, q = a.c2, t = a.axis, s = 0;;) {
  33997. m.sweepIntegrate(d * b);
  33998. m.sweepValidate(f);
  33999. k.sweepIntegrate(d * b);
  34000. k.sweepValidate(l);
  34001. var y = c.geom.ZPP_SweepDistance.distance(f, l, r, q, t, null) + g,
  34002. A = p * t.x + n * t.y;
  34003. if (y < h.Config.distanceThresholdCCD) {
  34004. if (e) break;
  34005. var z = 0,
  34006. x = 0,
  34007. z = r.x - m.posx,
  34008. x = r.y - m.posy,
  34009. B = 0,
  34010. v = 0,
  34011. B = q.x - k.posx,
  34012. v = q.y - k.posy,
  34013. z = A - m.sweep_angvel * (t.y * z - t.x * x) + k.sweep_angvel * (t.y * B - t.x * v);
  34014. 0 < z && (a.slipped = !0);
  34015. if (0 >=
  34016. z || y < 0.5 * h.Config.distanceThresholdCCD) break
  34017. }
  34018. z = (w - A) * b;
  34019. if (0 >= z) {
  34020. d = -1;
  34021. break
  34022. }
  34023. z = y / z;
  34024. 1E-6 > z && (z = 1E-6);
  34025. d += z;
  34026. if (1 <= d) {
  34027. d = 1;
  34028. m.sweepIntegrate(d * b);
  34029. m.sweepValidate(f);
  34030. k.sweepIntegrate(d * b);
  34031. k.sweepValidate(l);
  34032. b = c.geom.ZPP_SweepDistance.distance(f, l, r, q, t, null) + g;
  34033. p = p * t.x + n * t.y;
  34034. if (b < h.Config.distanceThresholdCCD) {
  34035. if (e) break;
  34036. z = r.x - m.posx;
  34037. x = r.y - m.posy;
  34038. B = q.x - k.posx;
  34039. v = q.y - k.posy;
  34040. z = p - m.sweep_angvel * (t.y * z - t.x * x) + k.sweep_angvel * (t.y * B - t.x * v);
  34041. 0 < z && (a.slipped = !0);
  34042. if (0 >= z || b < 0.5 * h.Config.distanceThresholdCCD) break
  34043. }
  34044. d = -1;
  34045. break
  34046. }
  34047. if (40 <= ++s) {
  34048. y > g && (a.failed = !0);
  34049. break
  34050. }
  34051. }
  34052. a.toi = d
  34053. }
  34054. };
  34055. c.geom.ZPP_SweepDistance.staticSweep = function (a, b, d, g) {
  34056. var e = a.s1,
  34057. f = a.s2,
  34058. l = e.body,
  34059. m = 0,
  34060. k = 0,
  34061. m = -l.velx,
  34062. k = -l.vely,
  34063. p = l.sweep_angvel;
  34064. 0 > p && (p = -p);
  34065. for (var n = e.sweepCoef * p, p = a.c1, r = a.c2, q = a.axis, w = 0;;) {
  34066. l.sweepIntegrate(d * b);
  34067. l.sweepValidate(e);
  34068. var t = c.geom.ZPP_SweepDistance.distance(e, f, p, r, q, null) + g,
  34069. s = m * q.x + k * q.y;
  34070. if (t < h.Config.distanceThresholdCCD) {
  34071. var y = 0,
  34072. A = 0,
  34073. y = p.x - l.posx,
  34074. A = p.y - l.posy,
  34075. y = s - l.sweep_angvel * (q.y * y - q.x * A);
  34076. 0 < y && (a.slipped = !0);
  34077. if (0 >= y || t < 0.5 *
  34078. h.Config.distanceThresholdCCD) break
  34079. }
  34080. y = (n - s) * b;
  34081. if (0 >= y) {
  34082. d = -1;
  34083. break
  34084. }
  34085. y = t / y;
  34086. 1E-6 > y && (y = 1E-6);
  34087. d += y;
  34088. if (1 <= d) {
  34089. d = 1;
  34090. l.sweepIntegrate(d * b);
  34091. l.sweepValidate(e);
  34092. b = c.geom.ZPP_SweepDistance.distance(e, f, p, r, q, null) + g;
  34093. m = m * q.x + k * q.y;
  34094. if (b < h.Config.distanceThresholdCCD && (y = p.x - l.posx, A = p.y - l.posy, y = m - l.sweep_angvel * (q.y * y - q.x * A), 0 < y && (a.slipped = !0), 0 >= y || b < 0.5 * h.Config.distanceThresholdCCD)) break;
  34095. d = -1;
  34096. break
  34097. }
  34098. if (40 <= ++w) {
  34099. t > g && (a.failed = !0);
  34100. break
  34101. }
  34102. }
  34103. a.toi = d
  34104. };
  34105. c.geom.ZPP_SweepDistance.distanceBody = function (a, b, d, g) {
  34106. var e;
  34107. null == c.geom.ZPP_Vec2.zpp_pool ? e = new c.geom.ZPP_Vec2 : (e = c.geom.ZPP_Vec2.zpp_pool, c.geom.ZPP_Vec2.zpp_pool = e.next, e.next = null);
  34108. e.weak = !1;
  34109. var f;
  34110. null == c.geom.ZPP_Vec2.zpp_pool ? f = new c.geom.ZPP_Vec2 : (f = c.geom.ZPP_Vec2.zpp_pool, c.geom.ZPP_Vec2.zpp_pool = f.next, f.next = null);
  34111. f.weak = !1;
  34112. var l;
  34113. null == c.geom.ZPP_Vec2.zpp_pool ? l = new c.geom.ZPP_Vec2 : (l = c.geom.ZPP_Vec2.zpp_pool, c.geom.ZPP_Vec2.zpp_pool = l.next, l.next = null);
  34114. l.weak = !1;
  34115. var h = 1E100;
  34116. for (a = a.shapes.head; null != a;) {
  34117. for (var k = a.elt, p = b.shapes.head; null != p;) {
  34118. var n =
  34119. c.geom.ZPP_SweepDistance.distance(k, p.elt, e, f, l, h);
  34120. n < h && (h = n, d.x = e.x, d.y = e.y, g.x = f.x, g.y = f.y);
  34121. p = p.next
  34122. }
  34123. a = a.next
  34124. }
  34125. b = e;
  34126. null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
  34127. b._isimmutable = null;
  34128. b._validate = null;
  34129. b._invalidate = null;
  34130. b.next = c.geom.ZPP_Vec2.zpp_pool;
  34131. c.geom.ZPP_Vec2.zpp_pool = b;
  34132. b = f;
  34133. null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
  34134. b._isimmutable = null;
  34135. b._validate = null;
  34136. b._invalidate = null;
  34137. b.next = c.geom.ZPP_Vec2.zpp_pool;
  34138. c.geom.ZPP_Vec2.zpp_pool = b;
  34139. b = l;
  34140. null != b.outer && (b.outer.zpp_inner = null, b.outer =
  34141. null);
  34142. b._isimmutable = null;
  34143. b._validate = null;
  34144. b._invalidate = null;
  34145. b.next = c.geom.ZPP_Vec2.zpp_pool;
  34146. c.geom.ZPP_Vec2.zpp_pool = b;
  34147. return h
  34148. };
  34149. c.geom.ZPP_SweepDistance.distance = function (a, b, d, g, e, f) {
  34150. null == f && (f = 1E100);
  34151. if (a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE && b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
  34152. var l = a.circle;
  34153. a = b.circle;
  34154. var m, k = 0,
  34155. p = 0,
  34156. k = a.worldCOMx - l.worldCOMx,
  34157. p = a.worldCOMy - l.worldCOMy,
  34158. n = Math.sqrt(k * k + p * p);
  34159. m = n - (l.radius + a.radius);
  34160. m < f && (0 == n ? (k = 1, p = 0) : (f = 1 / n, k *= f, p *= f), f = l.radius, d.x = l.worldCOMx +
  34161. k * f, d.y = l.worldCOMy + p * f, f = -a.radius, g.x = a.worldCOMx + k * f, g.y = a.worldCOMy + p * f, e.x = k, e.y = p);
  34162. return m
  34163. }
  34164. l = !1;
  34165. a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE && b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && (k = a, a = b, b = k, l = d, d = g, g = l, l = !0);
  34166. if (a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
  34167. var r = b.circle;
  34168. b = -1E100;
  34169. p = null;
  34170. for (a = a.polygon.edges.head; null != a;) {
  34171. k = a.elt;
  34172. m = k.gnormx * r.worldCOMx + k.gnormy * r.worldCOMy - k.gprojection - r.radius;
  34173. if (m > f) {
  34174. b = m;
  34175. break
  34176. }
  34177. 0 < m ? m > b && (b = m, p = k) :
  34178. 0 > b && m > b && (b = m, p = k);
  34179. a = a.next
  34180. }
  34181. b < f && (a = p.gp0, m = p.gp1, k = r.worldCOMy * p.gnormx - r.worldCOMx * p.gnormy, k <= a.y * p.gnormx - a.x * p.gnormy ? (k = r.worldCOMx - a.x, p = r.worldCOMy - a.y, n = Math.sqrt(k * k + p * p), b = n - r.radius, b < f && (0 == n ? (k = 1, p = 0) : (f = 1 / n, k *= f, p *= f), f = 0, d.x = a.x + k * f, d.y = a.y + p * f, f = -r.radius, g.x = r.worldCOMx + k * f, g.y = r.worldCOMy + p * f, e.x = k, e.y = p)) : k >= m.y * p.gnormx - m.x * p.gnormy ? (k = r.worldCOMx - m.x, p = r.worldCOMy - m.y, n = Math.sqrt(k * k + p * p), b = n - r.radius, b < f && (0 == n ? (k = 1, p = 0) : (f = 1 / n, k *= f, p *= f), f = 0, d.x = m.x + k * f, d.y = m.y + p * f, f = -r.radius,
  34182. g.x = r.worldCOMx + k * f, g.y = r.worldCOMy + p * f, e.x = k, e.y = p)) : (f = -r.radius, g.x = r.worldCOMx + p.gnormx * f, g.y = r.worldCOMy + p.gnormy * f, f = -b, d.x = g.x + p.gnormx * f, d.y = g.y + p.gnormy * f, e.x = p.gnormx, e.y = p.gnormy));
  34183. l && (e.x = -e.x, e.y = -e.y);
  34184. return b
  34185. }
  34186. m = a.polygon;
  34187. var q = b.polygon;
  34188. b = -1E100;
  34189. var n = p = null,
  34190. w = 0;
  34191. for (a = m.edges.head; null != a;) {
  34192. for (var k = a.elt, r = 1E100, t = q.gverts.next; null != t;) {
  34193. var s = t,
  34194. s = k.gnormx * s.x + k.gnormy * s.y;
  34195. s < r && (r = s);
  34196. t = t.next
  34197. }
  34198. r -= k.gprojection;
  34199. if (r > f) {
  34200. b = r;
  34201. break
  34202. }
  34203. 0 < r ? r > b && (b = r, p = k, w = 1) : 0 > b && r > b && (b = r, p = k, w = 1);
  34204. a = a.next
  34205. }
  34206. if (b <
  34207. f) {
  34208. for (a = q.edges.head; null != a;) {
  34209. k = a.elt;
  34210. r = 1E100;
  34211. for (t = m.gverts.next; null != t;) s = t, s = k.gnormx * s.x + k.gnormy * s.y, s < r && (r = s), t = t.next;
  34212. r -= k.gprojection;
  34213. if (r > f) {
  34214. b = r;
  34215. break
  34216. }
  34217. 0 < r ? r > b && (b = r, n = k, w = 2) : 0 > b && r > b && (b = r, n = k, w = 2);
  34218. a = a.next
  34219. }
  34220. if (b < f) {
  34221. 1 == w ? (a = q, m = p) : (a = m, m = n, k = d, d = g, g = k, l = !l);
  34222. f = null;
  34223. r = 1E100;
  34224. for (a = a.edges.head; null != a;) k = a.elt, s = m.gnormx * k.gnormx + m.gnormy * k.gnormy, s < r && (r = s, f = k), a = a.next;
  34225. l ? (e.x = -m.gnormx, e.y = -m.gnormy) : (e.x = m.gnormx, e.y = m.gnormy);
  34226. if (0 <= b) {
  34227. a = m.gp0;
  34228. m = m.gp1;
  34229. var k = f.gp0,
  34230. r = f.gp1,
  34231. y = t = w = 0,
  34232. A = 0,
  34233. w =
  34234. m.x - a.x,
  34235. t = m.y - a.y,
  34236. y = r.x - k.x,
  34237. A = r.y - k.y;
  34238. b = 1 / (w * w + t * t);
  34239. p = 1 / (y * y + A * A);
  34240. f = -(w * (a.x - k.x) + t * (a.y - k.y)) * b;
  34241. b *= -(w * (a.x - r.x) + t * (a.y - r.y));
  34242. var z = -(y * (k.x - a.x) + A * (k.y - a.y)) * p,
  34243. x = -(y * (k.x - m.x) + A * (k.y - m.y)) * p;
  34244. 0 > f ? f = 0 : 1 < f && (f = 1);
  34245. 0 > b ? b = 0 : 1 < b && (b = 1);
  34246. 0 > z ? z = 0 : 1 < z && (z = 1);
  34247. 0 > x ? x = 0 : 1 < x && (x = 1);
  34248. n = p = 0;
  34249. p = a.x + w * f;
  34250. n = a.y + t * f;
  34251. q = s = 0;
  34252. f = b;
  34253. s = a.x + w * f;
  34254. q = a.y + t * f;
  34255. t = w = 0;
  34256. f = z;
  34257. w = k.x + y * f;
  34258. t = k.y + A * f;
  34259. f = z = 0;
  34260. f = x;
  34261. z = k.x + y * f;
  34262. f = k.y + A * f;
  34263. b = c.geom.ZPP_VecMath.vec_dsq(p, n, k.x, k.y);
  34264. var B = c.geom.ZPP_VecMath.vec_dsq(s, q, r.x, r.y),
  34265. y = c.geom.ZPP_VecMath.vec_dsq(w,
  34266. t, a.x, a.y),
  34267. A = c.geom.ZPP_VecMath.vec_dsq(z, f, m.x, m.y),
  34268. v = x = 0,
  34269. H = null;
  34270. b < B ? (x = p, v = n, H = k) : (x = s, v = q, H = r, b = B);
  34271. r = k = 0;
  34272. p = null;
  34273. y < A ? (k = w, r = t, p = a) : (k = z, r = f, p = m, y = A);
  34274. b < y ? (d.x = x, d.y = v, g.x = H.x, g.y = H.y, b = Math.sqrt(b)) : (g.x = k, g.y = r, d.x = p.x, d.y = p.y, b = Math.sqrt(y));
  34275. 0 != b && (e.x = g.x - d.x, e.y = g.y - d.y, f = 1 / b, e.x *= f, e.y *= f, l && (e.x = -e.x, e.y = -e.y));
  34276. return b
  34277. }
  34278. l = e = 0;
  34279. e = f.gp0.x;
  34280. l = f.gp0.y;
  34281. k = a = 0;
  34282. a = f.gp1.x;
  34283. k = f.gp1.y;
  34284. p = r = 0;
  34285. r = a - e;
  34286. p = k - l;
  34287. f = m.gnormy * e - m.gnormx * l;
  34288. b = m.gnormy * a - m.gnormx * k;
  34289. n = 1 / (b - f);
  34290. f = (-m.tp1 - f) * n;
  34291. f > h.Config.epsilon && (e += r * f, l +=
  34292. p * f);
  34293. f = (-m.tp0 - b) * n;
  34294. f < -h.Config.epsilon && (b = f, a += r * b, k += p * b);
  34295. f = e * m.gnormx + l * m.gnormy - m.gprojection;
  34296. r = a * m.gnormx + k * m.gnormy - m.gprojection;
  34297. if (f < r) return g.x = e, g.y = l, b = -f, d.x = g.x + m.gnormx * b, d.y = g.y + m.gnormy * b, f;
  34298. g.x = a;
  34299. g.y = k;
  34300. b = -r;
  34301. d.x = g.x + m.gnormx * b;
  34302. d.y = g.y + m.gnormy * b;
  34303. return r
  34304. }
  34305. }
  34306. return f
  34307. };
  34308. c.geom.ZPP_PartitionPair = function () {
  34309. this.node = null;
  34310. this.id = this.di = 0;
  34311. this.a = this.b = null;
  34312. this.length = 0;
  34313. this._inuse = this.modified = this.pushmod = !1;
  34314. this.next = null
  34315. };
  34316. s["zpp_nape.geom.ZPP_PartitionPair"] = c.geom.ZPP_PartitionPair;
  34317. c.geom.ZPP_PartitionPair.__name__ = ["zpp_nape", "geom", "ZPP_PartitionPair"];
  34318. c.geom.ZPP_PartitionPair.get = function (a, b) {
  34319. var d;
  34320. null == c.geom.ZPP_PartitionPair.zpp_pool ? d = new c.geom.ZPP_PartitionPair : (d = c.geom.ZPP_PartitionPair.zpp_pool, c.geom.ZPP_PartitionPair.zpp_pool = d.next, d.next = null);
  34321. null;
  34322. d.a = a;
  34323. d.b = b;
  34324. a.id < b.id ? (d.id = a.id, d.di = b.id) : (d.id = b.id, d.di = a.id);
  34325. return d
  34326. };
  34327. c.geom.ZPP_PartitionPair.edge_swap = function (a, b) {
  34328. var d = a.node;
  34329. a.node = b.node;
  34330. b.node = d
  34331. };
  34332. c.geom.ZPP_PartitionPair.edge_lt = function (a, b) {
  34333. return a.id <
  34334. b.id || a.id == b.id && a.di < b.di
  34335. };
  34336. c.geom.ZPP_PartitionPair.prototype = {
  34337. alloc: function () {},
  34338. free: function () {
  34339. this.node = this.a = this.b = null
  34340. },
  34341. at: function (a) {
  34342. a = this.iterator_at(a);
  34343. return null != a ? a : null
  34344. },
  34345. iterator_at: function (a) {
  34346. for (var b = this.next; 0 < a-- && null != b;) b = b.next;
  34347. return b
  34348. },
  34349. back: function () {
  34350. for (var a = this.next, b = a; null != b;) a = b, b = b.next;
  34351. return a
  34352. },
  34353. front: function () {
  34354. return this.next
  34355. },
  34356. inlined_has: function (a) {
  34357. var b;
  34358. b = !1;
  34359. for (var d = this.next; null != d;) {
  34360. if (d == a) {
  34361. b = !0;
  34362. break
  34363. }
  34364. d = d.next
  34365. }
  34366. return b
  34367. },
  34368. has: function (a) {
  34369. return this.inlined_has(a)
  34370. },
  34371. size: function () {
  34372. return this.length
  34373. },
  34374. empty: function () {
  34375. return null == this.next
  34376. },
  34377. reverse: function () {
  34378. for (var a = this.next, b = null; null != a;) {
  34379. var d = a.next;
  34380. a.next = b;
  34381. b = this.next = a;
  34382. a = d
  34383. }
  34384. this.pushmod = this.modified = !0
  34385. },
  34386. inlined_clear: function () {},
  34387. clear: function () {},
  34388. splice: function (a, b) {
  34389. for (; 0 < b-- && null != a.next;) this.erase(a);
  34390. return a.next
  34391. },
  34392. inlined_erase: function (a) {
  34393. var b, d;
  34394. null == a ? (b = this.next, this.next = d = b.next, null == this.next && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  34395. b._inuse = !1;
  34396. this.modified = !0;
  34397. this.length--;
  34398. this.pushmod = !0;
  34399. return d
  34400. },
  34401. erase: function (a) {
  34402. return this.inlined_erase(a)
  34403. },
  34404. inlined_try_remove: function (a) {
  34405. for (var b = null, d = this.next, c = !1; null != d;) {
  34406. if (d == a) {
  34407. this.inlined_erase(b);
  34408. c = !0;
  34409. break
  34410. }
  34411. b = d;
  34412. d = d.next
  34413. }
  34414. return c
  34415. },
  34416. inlined_remove: function (a) {
  34417. this.inlined_try_remove(a)
  34418. },
  34419. try_remove: function (a) {
  34420. for (var b = null, d = this.next, c = !1; null != d;) {
  34421. if (d == a) {
  34422. this.erase(b);
  34423. c = !0;
  34424. break
  34425. }
  34426. b = d;
  34427. d = d.next
  34428. }
  34429. return c
  34430. },
  34431. remove: function (a) {
  34432. this.inlined_try_remove(a)
  34433. },
  34434. inlined_pop_unsafe: function () {
  34435. var a =
  34436. this.next;
  34437. this.pop();
  34438. return a
  34439. },
  34440. pop_unsafe: function () {
  34441. return this.inlined_pop_unsafe()
  34442. },
  34443. inlined_pop: function () {
  34444. var a = this.next;
  34445. this.next = a.next;
  34446. a._inuse = !1;
  34447. null == this.next && (this.pushmod = !0);
  34448. this.modified = !0;
  34449. this.length--
  34450. },
  34451. pop: function () {
  34452. this.inlined_pop()
  34453. },
  34454. inlined_insert: function (a, b) {
  34455. b._inuse = !0;
  34456. null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
  34457. this.pushmod = this.modified = !0;
  34458. this.length++;
  34459. return b
  34460. },
  34461. insert: function (a, b) {
  34462. return this.inlined_insert(a, b)
  34463. },
  34464. addAll: function (a) {
  34465. for (a = a.next; null !=
  34466. a;) this.add(a), a = a.next
  34467. },
  34468. inlined_add: function (a) {
  34469. a._inuse = !0;
  34470. a.next = this.next;
  34471. this.next = a;
  34472. this.modified = !0;
  34473. this.length++;
  34474. return a
  34475. },
  34476. add: function (a) {
  34477. return this.inlined_add(a)
  34478. },
  34479. setbegin: function (a) {
  34480. this.next = a;
  34481. this.pushmod = this.modified = !0
  34482. },
  34483. begin: function () {
  34484. return this.next
  34485. },
  34486. elem: function () {
  34487. return this
  34488. },
  34489. __class__: c.geom.ZPP_PartitionPair
  34490. };
  34491. c.geom.ZPP_Triangular = function () {};
  34492. s["zpp_nape.geom.ZPP_Triangular"] = c.geom.ZPP_Triangular;
  34493. c.geom.ZPP_Triangular.__name__ = ["zpp_nape", "geom", "ZPP_Triangular"];
  34494. c.geom.ZPP_Triangular.lt =
  34495. function (a, b) {
  34496. return a.y < b.y || a.y == b.y && a.x < b.x
  34497. };
  34498. c.geom.ZPP_Triangular.right_turn = function (a, b, d) {
  34499. var c = 0,
  34500. e = 0,
  34501. c = d.x - b.x,
  34502. e = d.y - b.y,
  34503. f = d = 0;
  34504. d = b.x - a.x;
  34505. f = b.y - a.y;
  34506. return f * c - d * e
  34507. };
  34508. c.geom.ZPP_Triangular.delaunay = function (a, b, d, c) {
  34509. var e = 0,
  34510. f = 0,
  34511. l = 0,
  34512. h = 0,
  34513. e = d.x - b.x,
  34514. f = d.y - b.y,
  34515. l = b.x - a.x,
  34516. h = b.y - a.y;
  34517. (e = 0 <= h * e - l * f) || (e = c.x - d.x, f = c.y - d.y, l = d.x - b.x, h = d.y - b.y, (e = 0 <= h * e - l * f) || (e = a.x - c.x, f = a.y - c.y, l = c.x - d.x, h = c.y - d.y, (e = 0 <= h * e - l * f) || (e = b.x - a.x, f = b.y - a.y, l = a.x - c.x, h = a.y - c.y, e = 0 <= h * e - l * f)));
  34518. return e ? !0 : 0 < b.x * (d.y * c.mag - d.mag *
  34519. c.y) - d.x * (b.y * c.mag - b.mag * c.y) + c.x * (b.y * d.mag - b.mag * d.y) - (a.x * (d.y * c.mag - d.mag * c.y) - d.x * (a.y * c.mag - a.mag * c.y) + c.x * (a.y * d.mag - a.mag * d.y)) + (a.x * (b.y * c.mag - b.mag * c.y) - b.x * (a.y * c.mag - a.mag * c.y) + c.x * (a.y * b.mag - a.mag * b.y)) - (a.x * (b.y * d.mag - b.mag * d.y) - b.x * (a.y * d.mag - a.mag * d.y) + d.x * (a.y * b.mag - a.mag * b.y))
  34520. };
  34521. c.geom.ZPP_Triangular.optimise = function (a) {
  34522. var b = a.vertices,
  34523. d = a.vertices;
  34524. if (null != b) {
  34525. var g = b;
  34526. do b = g, b.sort(), b.mag = b.x * b.x + b.y * b.y, g = g.next; while (g != d)
  34527. }
  34528. null == c.geom.ZPP_Triangular.edgeSet && (null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ?
  34529. c.geom.ZPP_Triangular.edgeSet = new c.util.ZPP_Set_ZPP_PartitionPair : (c.geom.ZPP_Triangular.edgeSet = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = c.geom.ZPP_Triangular.edgeSet.next, c.geom.ZPP_Triangular.edgeSet.next = null), null, c.geom.ZPP_Triangular.edgeSet.lt = c.geom.ZPP_PartitionPair.edge_lt, c.geom.ZPP_Triangular.edgeSet.swapped = c.geom.ZPP_PartitionPair.edge_swap);
  34530. var e;
  34531. null == c.geom.ZPP_PartitionPair.zpp_pool ? e = new c.geom.ZPP_PartitionPair : (e = c.geom.ZPP_PartitionPair.zpp_pool,
  34532. c.geom.ZPP_PartitionPair.zpp_pool = e.next, e.next = null);
  34533. null;
  34534. d = b = a.vertices;
  34535. if (null != b) {
  34536. g = b;
  34537. do {
  34538. var b = g,
  34539. f = b.next;
  34540. b.diagonals.reverse();
  34541. for (a = b.diagonals.head; null != a;) {
  34542. var l = a.elt;
  34543. l.id < b.id || c.geom.ZPP_Triangular.delaunay(b, f, l, null == a.next ? b.prev : a.next.elt) || (f = c.geom.ZPP_PartitionPair.get(b, l), e.add(f), f.node = c.geom.ZPP_Triangular.edgeSet.insert(f));
  34544. f = l;
  34545. a = a.next
  34546. }
  34547. g = g.next
  34548. } while (g != d)
  34549. }
  34550. for (; null != e.next;) {
  34551. var f = e.pop_unsafe(),
  34552. d = f.a,
  34553. g = f.b,
  34554. l = d.next,
  34555. h = null;
  34556. for (a = d.diagonals.head; null != a;) {
  34557. b = a.elt;
  34558. if (b ==
  34559. g) {
  34560. a = a.next;
  34561. h = null == a ? d.prev : a.elt;
  34562. break
  34563. }
  34564. l = b;
  34565. a = a.next
  34566. }
  34567. d.diagonals.remove(g);
  34568. g.diagonals.remove(d);
  34569. if (g == l.next) l.diagonals.add(h);
  34570. else
  34571. for (a = l.diagonals.head; null != a;) {
  34572. b = a.elt;
  34573. if (b == g) {
  34574. l.diagonals.insert(a, h);
  34575. break
  34576. }
  34577. a = a.next
  34578. }
  34579. if (d == h.next) h.diagonals.add(l);
  34580. else
  34581. for (a = h.diagonals.head; null != a;) {
  34582. b = a.elt;
  34583. if (b == d) {
  34584. h.diagonals.insert(a, l);
  34585. break
  34586. }
  34587. a = a.next
  34588. }
  34589. c.geom.ZPP_Triangular.edgeSet.remove_node(f.node);
  34590. b = f;
  34591. b.a = b.b = null;
  34592. b.node = null;
  34593. b.next = c.geom.ZPP_PartitionPair.zpp_pool;
  34594. c.geom.ZPP_PartitionPair.zpp_pool =
  34595. b
  34596. }
  34597. b = e;
  34598. b.a = b.b = null;
  34599. b.node = null;
  34600. b.next = c.geom.ZPP_PartitionPair.zpp_pool;
  34601. c.geom.ZPP_PartitionPair.zpp_pool = b
  34602. };
  34603. c.geom.ZPP_Triangular.triangulate = function (a) {
  34604. var b = a.vertices,
  34605. d = a.vertices,
  34606. g = a.vertices.next,
  34607. e = a.vertices;
  34608. if (null != g) {
  34609. var f = g;
  34610. do {
  34611. g = f;
  34612. if (g.y < b.y || g.y == b.y && g.x < b.x) b = g;
  34613. if (d.y < g.y || d.y == g.y && d.x < g.x) d = g;
  34614. f = f.next
  34615. } while (f != e)
  34616. }
  34617. null == c.geom.ZPP_Triangular.queue && (c.geom.ZPP_Triangular.queue = new c.util.ZNPList_ZPP_PartitionVertex);
  34618. g = d.prev;
  34619. e = d.next;
  34620. for (c.geom.ZPP_Triangular.queue.add(d); g != b || e !=
  34621. b;) g == b || e != b && (g.y < e.y || g.y == e.y && g.x < e.x) ? (c.geom.ZPP_Triangular.queue.add(e), e.rightchain = !1, e = e.next) : (c.geom.ZPP_Triangular.queue.add(g), g.rightchain = !0, g = g.prev);
  34622. c.geom.ZPP_Triangular.queue.add(b);
  34623. null == c.geom.ZPP_Triangular.stack && (c.geom.ZPP_Triangular.stack = new c.util.ZNPList_ZPP_PartitionVertex);
  34624. c.geom.ZPP_Triangular.stack.add(c.geom.ZPP_Triangular.queue.pop_unsafe());
  34625. e = c.geom.ZPP_Triangular.queue.pop_unsafe();
  34626. for (c.geom.ZPP_Triangular.stack.add(e);;) {
  34627. g = c.geom.ZPP_Triangular.queue.pop_unsafe();
  34628. if (null == c.geom.ZPP_Triangular.queue.head) break;
  34629. if (g.rightchain != c.geom.ZPP_Triangular.stack.head.elt.rightchain)
  34630. for (;;) {
  34631. b = c.geom.ZPP_Triangular.stack.pop_unsafe();
  34632. if (null == c.geom.ZPP_Triangular.stack.head) break;
  34633. a.add_diagonal(b, g)
  34634. } else
  34635. for (e = c.geom.ZPP_Triangular.stack.pop_unsafe(); null != c.geom.ZPP_Triangular.stack.head;) {
  34636. b = c.geom.ZPP_Triangular.stack.head.elt;
  34637. f = c.geom.ZPP_Triangular.right_turn(b, e, g);
  34638. if (g.rightchain && 0 <= f || !g.rightchain && 0 >= f) break;
  34639. a.add_diagonal(b, g);
  34640. e = b;
  34641. c.geom.ZPP_Triangular.stack.pop()
  34642. }
  34643. c.geom.ZPP_Triangular.stack.add(e);
  34644. c.geom.ZPP_Triangular.stack.add(g);
  34645. e = g
  34646. }
  34647. if (null != c.geom.ZPP_Triangular.stack.head)
  34648. for (c.geom.ZPP_Triangular.stack.pop(); null != c.geom.ZPP_Triangular.stack.head;) {
  34649. b = c.geom.ZPP_Triangular.stack.pop_unsafe();
  34650. if (null == c.geom.ZPP_Triangular.stack.head) break;
  34651. a.add_diagonal(d, b)
  34652. }
  34653. return a
  34654. };
  34655. c.geom.ZPP_Vec2 = function () {
  34656. this.length = this.x = this.y = 0;
  34657. this._inuse = this.modified = this.pushmod = !1;
  34658. this.next = null;
  34659. this.weak = !1;
  34660. this._isimmutable = this.outer = null;
  34661. this._immutable = !1;
  34662. this._invalidate = this._validate = null
  34663. };
  34664. s["zpp_nape.geom.ZPP_Vec2"] =
  34665. c.geom.ZPP_Vec2;
  34666. c.geom.ZPP_Vec2.__name__ = ["zpp_nape", "geom", "ZPP_Vec2"];
  34667. c.geom.ZPP_Vec2.get = function (a, b, d) {
  34668. null == d && (d = !1);
  34669. var g;
  34670. null == c.geom.ZPP_Vec2.zpp_pool ? g = new c.geom.ZPP_Vec2 : (g = c.geom.ZPP_Vec2.zpp_pool, c.geom.ZPP_Vec2.zpp_pool = g.next, g.next = null);
  34671. g.weak = !1;
  34672. g._immutable = d;
  34673. g.x = a;
  34674. g.y = b;
  34675. return g
  34676. };
  34677. c.geom.ZPP_Vec2.prototype = {
  34678. toString: function () {
  34679. return "{ x: " + this.x + " y: " + this.y + " }"
  34680. },
  34681. copy: function () {
  34682. return c.geom.ZPP_Vec2.get(this.x, this.y, null)
  34683. },
  34684. at: function (a) {
  34685. a = this.iterator_at(a);
  34686. return null !=
  34687. a ? a : null
  34688. },
  34689. iterator_at: function (a) {
  34690. for (var b = this.next; 0 < a-- && null != b;) b = b.next;
  34691. return b
  34692. },
  34693. back: function () {
  34694. for (var a = this.next, b = a; null != b;) a = b, b = b.next;
  34695. return a
  34696. },
  34697. front: function () {
  34698. return this.next
  34699. },
  34700. inlined_has: function (a) {
  34701. var b;
  34702. b = !1;
  34703. for (var d = this.next; null != d;) {
  34704. if (d == a) {
  34705. b = !0;
  34706. break
  34707. }
  34708. d = d.next
  34709. }
  34710. return b
  34711. },
  34712. has: function (a) {
  34713. return this.inlined_has(a)
  34714. },
  34715. size: function () {
  34716. return this.length
  34717. },
  34718. empty: function () {
  34719. return null == this.next
  34720. },
  34721. reverse: function () {
  34722. for (var a = this.next, b = null; null != a;) {
  34723. var d = a.next;
  34724. a.next = b;
  34725. b =
  34726. this.next = a;
  34727. a = d
  34728. }
  34729. this.pushmod = this.modified = !0
  34730. },
  34731. inlined_clear: function () {},
  34732. clear: function () {},
  34733. splice: function (a, b) {
  34734. for (; 0 < b-- && null != a.next;) this.erase(a);
  34735. return a.next
  34736. },
  34737. inlined_erase: function (a) {
  34738. var b, d;
  34739. null == a ? (b = this.next, this.next = d = b.next, null == this.next && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  34740. b._inuse = !1;
  34741. this.modified = !0;
  34742. this.length--;
  34743. this.pushmod = !0;
  34744. return d
  34745. },
  34746. erase: function (a) {
  34747. return this.inlined_erase(a)
  34748. },
  34749. inlined_try_remove: function (a) {
  34750. for (var b = null, d = this.next,
  34751. c = !1; null != d;) {
  34752. if (d == a) {
  34753. this.inlined_erase(b);
  34754. c = !0;
  34755. break
  34756. }
  34757. b = d;
  34758. d = d.next
  34759. }
  34760. return c
  34761. },
  34762. inlined_remove: function (a) {
  34763. this.inlined_try_remove(a)
  34764. },
  34765. try_remove: function (a) {
  34766. for (var b = null, d = this.next, c = !1; null != d;) {
  34767. if (d == a) {
  34768. this.erase(b);
  34769. c = !0;
  34770. break
  34771. }
  34772. b = d;
  34773. d = d.next
  34774. }
  34775. return c
  34776. },
  34777. remove: function (a) {
  34778. this.inlined_try_remove(a)
  34779. },
  34780. inlined_pop_unsafe: function () {
  34781. var a = this.next;
  34782. this.pop();
  34783. return a
  34784. },
  34785. pop_unsafe: function () {
  34786. return this.inlined_pop_unsafe()
  34787. },
  34788. inlined_pop: function () {
  34789. var a = this.next;
  34790. this.next = a.next;
  34791. a._inuse = !1;
  34792. null ==
  34793. this.next && (this.pushmod = !0);
  34794. this.modified = !0;
  34795. this.length--
  34796. },
  34797. pop: function () {
  34798. this.inlined_pop()
  34799. },
  34800. inlined_insert: function (a, b) {
  34801. b._inuse = !0;
  34802. null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
  34803. this.pushmod = this.modified = !0;
  34804. this.length++;
  34805. return b
  34806. },
  34807. insert: function (a, b) {
  34808. return this.inlined_insert(a, b)
  34809. },
  34810. addAll: function (a) {
  34811. for (a = a.next; null != a;) this.add(a), a = a.next
  34812. },
  34813. inlined_add: function (a) {
  34814. a._inuse = !0;
  34815. a.next = this.next;
  34816. this.next = a;
  34817. this.modified = !0;
  34818. this.length++;
  34819. return a
  34820. },
  34821. add: function (a) {
  34822. return this.inlined_add(a)
  34823. },
  34824. setbegin: function (a) {
  34825. this.next = a;
  34826. this.pushmod = this.modified = !0
  34827. },
  34828. begin: function () {
  34829. return this.next
  34830. },
  34831. elem: function () {
  34832. return this
  34833. },
  34834. alloc: function () {
  34835. this.weak = !1
  34836. },
  34837. free: function () {
  34838. null != this.outer && (this.outer = this.outer.zpp_inner = null);
  34839. this._invalidate = this._validate = this._isimmutable = null
  34840. },
  34841. wrapper: function () {
  34842. if (null == this.outer) {
  34843. this.outer = new h.geom.Vec2;
  34844. var a = this.outer.zpp_inner;
  34845. null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
  34846. a._isimmutable = null;
  34847. a._validate = null;
  34848. a._invalidate = null;
  34849. a.next = c.geom.ZPP_Vec2.zpp_pool;
  34850. c.geom.ZPP_Vec2.zpp_pool = a;
  34851. this.outer.zpp_inner = this
  34852. }
  34853. return this.outer
  34854. },
  34855. immutable: function () {
  34856. if (this._immutable) throw "Error: Vec2 is immutable";
  34857. null != this._isimmutable && this._isimmutable()
  34858. },
  34859. invalidate: function () {
  34860. null != this._invalidate && this._invalidate(this)
  34861. },
  34862. validate: function () {
  34863. null != this._validate && this._validate()
  34864. },
  34865. __class__: c.geom.ZPP_Vec2
  34866. };
  34867. c.geom.ZPP_Vec3 = function () {
  34868. this._validate = null;
  34869. this.immutable = !1;
  34870. this.x = this.y = this.z = 0;
  34871. this.outer = null;
  34872. this.immutable = !1;
  34873. this._validate = null
  34874. };
  34875. s["zpp_nape.geom.ZPP_Vec3"] =
  34876. c.geom.ZPP_Vec3;
  34877. c.geom.ZPP_Vec3.__name__ = ["zpp_nape", "geom", "ZPP_Vec3"];
  34878. c.geom.ZPP_Vec3.prototype = {
  34879. validate: function () {
  34880. null != this._validate && this._validate()
  34881. },
  34882. __class__: c.geom.ZPP_Vec3
  34883. };
  34884. c.geom.ZPP_VecMath = function () {};
  34885. s["zpp_nape.geom.ZPP_VecMath"] = c.geom.ZPP_VecMath;
  34886. c.geom.ZPP_VecMath.__name__ = ["zpp_nape", "geom", "ZPP_VecMath"];
  34887. c.geom.ZPP_VecMath.vec_dsq = function (a, b, d, c) {
  34888. var e = 0,
  34889. f = 0,
  34890. e = a - d,
  34891. f = b - c;
  34892. return e * e + f * f
  34893. };
  34894. c.geom.ZPP_VecMath.vec_distance = function (a, b, d, c) {
  34895. var e = 0,
  34896. f = 0,
  34897. e = a - d,
  34898. f = b - c;
  34899. return Math.sqrt(e *
  34900. e + f * f)
  34901. };
  34902. c.phys = {};
  34903. c.phys.ZPP_Interactor = function () {
  34904. this.userData = this.ishape = this.ibody = this.icompound = this.cbsets = this.group = this.cbTypes = this.cbSet = this.wrap_cbTypes = null;
  34905. this.id = 0;
  34906. this.outer_i = null;
  34907. this.id = c.ZPP_ID.Interactor();
  34908. this.cbsets = new c.util.ZNPList_ZPP_CallbackSet;
  34909. this.cbTypes = new c.util.ZNPList_ZPP_CbType
  34910. };
  34911. s["zpp_nape.phys.ZPP_Interactor"] = c.phys.ZPP_Interactor;
  34912. c.phys.ZPP_Interactor.__name__ = ["zpp_nape", "phys", "ZPP_Interactor"];
  34913. c.phys.ZPP_Interactor.get = function (a, b) {
  34914. for (var d = a.id <
  34915. b.id ? a.id : b.id, c = a.id < b.id ? b.id : a.id, e = null, f = (a.cbsets.length < b.cbsets.length ? a.cbsets : b.cbsets).head; null != f;) {
  34916. var l = f.elt;
  34917. if (l.id == d && l.di == c) {
  34918. e = l;
  34919. break
  34920. }
  34921. f = f.next
  34922. }
  34923. return e
  34924. };
  34925. c.phys.ZPP_Interactor.int_callback = function (a, b, d) {
  34926. var c = a.int1;
  34927. a = a.int2;
  34928. b.options1.compatible(c.cbTypes) && b.options2.compatible(a.cbTypes) ? (d.int1 = c, d.int2 = a) : (d.int1 = a, d.int2 = c)
  34929. };
  34930. c.phys.ZPP_Interactor.prototype = {
  34931. copyto: function (a) {
  34932. a.zpp_inner_i.group = this.group;
  34933. for (var b = this.outer_i.get_cbTypes().iterator(); b.hasNext();) {
  34934. var d =
  34935. b.next(),
  34936. c = void 0;
  34937. null == a.zpp_inner_i.wrap_cbTypes && a.zpp_inner_i.setupcbTypes();
  34938. c = a.zpp_inner_i.wrap_cbTypes;
  34939. c.add(d)
  34940. }
  34941. null != this.userData && (a.zpp_inner_i.userData = W.copy(this.userData))
  34942. },
  34943. lookup_group: function () {
  34944. for (var a = this; null != a && null == a.group;) a = null != a.ishape ? a.ishape.body : null != a.icompound ? a.icompound.compound : a.ibody.compound;
  34945. return null == a ? null : a.group
  34946. },
  34947. immutable_midstep: function (a) {
  34948. null != this.ibody ? this.ibody.__immutable_midstep(a) : null != this.ishape ? this.ishape.__immutable_midstep(a) :
  34949. this.icompound.__imutable_midstep(a)
  34950. },
  34951. setGroup: function (a) {
  34952. if (this.group != a) {
  34953. var b = null != (null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space);
  34954. b && null != this.group && this.group.interactors.remove(this);
  34955. this.group = a;
  34956. b && null != a && a.interactors.add(this);
  34957. b && (null != this.ishape ? this.ishape.body.wake() : null != this.ibody ? this.ibody.wake() : this.icompound.wake())
  34958. }
  34959. },
  34960. dealloc_cbSet: function () {
  34961. var a = null != this.ishape ? null == this.ishape.body ? null :
  34962. this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
  34963. null != this.cbSet && (this.cbSet.interactors.remove(this), a.nullInteractorType(this), 0 == --this.cbSet.count && (a.cbsets.remove(this.cbSet), a = this.cbSet, a.free(), a.next = c.callbacks.ZPP_CbSet.zpp_pool, c.callbacks.ZPP_CbSet.zpp_pool = a), this.cbSet = null)
  34964. },
  34965. alloc_cbSet: function () {
  34966. var a = null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
  34967. null != (this.cbSet = a.cbsets.get(this.cbTypes)) &&
  34968. (this.cbSet.count++, this.cbSet.interactors.add(this), this.cbSet.validate(), a.freshInteractorType(this))
  34969. },
  34970. insert_cbtype: function (a) {
  34971. if (!this.cbTypes.has(a)) {
  34972. var b = null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
  34973. null != b && (this.dealloc_cbSet(), a.interactors.add(this));
  34974. for (var d = null, c = this.cbTypes.head; null != c && !(a.id < c.elt.id);) d = c, c = c.next;
  34975. this.cbTypes.inlined_insert(d, a);
  34976. null != b && (this.alloc_cbSet(), this.wake())
  34977. }
  34978. },
  34979. wrap_cbTypes_adder: function (a) {
  34980. this.insert_cbtype(a.zpp_inner);
  34981. return !1
  34982. },
  34983. wrap_cbTypes_subber: function (a) {
  34984. a = a.zpp_inner;
  34985. if (this.cbTypes.has(a)) {
  34986. var b = null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
  34987. null != b && (this.dealloc_cbSet(), a.interactors.remove(this));
  34988. this.cbTypes.remove(a);
  34989. null != b && (this.alloc_cbSet(), this.wake())
  34990. }
  34991. },
  34992. immutable_cbTypes: function () {
  34993. this.immutable_midstep("Interactor::cbTypes")
  34994. },
  34995. setupcbTypes: function () {
  34996. this.wrap_cbTypes = c.util.ZPP_CbTypeList.get(this.cbTypes);
  34997. this.wrap_cbTypes.zpp_inner.adder =
  34998. A(this, this.wrap_cbTypes_adder);
  34999. this.wrap_cbTypes.zpp_inner.subber = A(this, this.wrap_cbTypes_subber);
  35000. this.wrap_cbTypes.zpp_inner.dontremove = !0;
  35001. this.wrap_cbTypes.zpp_inner._modifiable = A(this, this.immutable_cbTypes)
  35002. },
  35003. getSpace: function () {
  35004. return null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space
  35005. },
  35006. wake: function () {
  35007. if (null != this.ishape) {
  35008. var a = this.ishape.body;
  35009. null != a && null != a.space && a.space.non_inlined_wake(a);
  35010. !0
  35011. } else null != this.ibody ?
  35012. null != this.ibody.space ? this.ibody.space.non_inlined_wake(this.ibody) : !1 : (null != this.icompound.space && this.icompound.space.wakeCompound(this.icompound), !0)
  35013. },
  35014. __iremovedFromSpace: function () {
  35015. null != this.group && this.group.interactors.remove(this);
  35016. for (var a = this.cbTypes.head; null != a;) a.elt.interactors.remove(this), a = a.next;
  35017. this.dealloc_cbSet()
  35018. },
  35019. __iaddedToSpace: function () {
  35020. null != this.group && this.group.interactors.add(this);
  35021. for (var a = this.cbTypes.head; null != a;) a.elt.interactors.add(this), a = a.next;
  35022. this.alloc_cbSet()
  35023. },
  35024. isCompound: function () {
  35025. return null != this.icompound
  35026. },
  35027. isBody: function () {
  35028. return null != this.ibody
  35029. },
  35030. isShape: function () {
  35031. return null != this.ishape
  35032. },
  35033. __class__: c.phys.ZPP_Interactor
  35034. };
  35035. c.phys.ZPP_Body = function () {
  35036. this.wrap_localCOM = this.wrap_worldCOM = null;
  35037. this.zip_worldCOM = !1;
  35038. this.worldCOMx = this.worldCOMy = 0;
  35039. this.zip_localCOM = !1;
  35040. this.localCOMx = this.localCOMy = 0;
  35041. this.zip_aabb = !1;
  35042. this.aabb = null;
  35043. this.norotate = !1;
  35044. this.cinertia = this.iinertia = this.sinertia = 0;
  35045. this.zip_inertia = !1;
  35046. this.inertiaMode = this.inertia = 0;
  35047. this.zip_gravMassScale = !1;
  35048. this.gravMassMode = this.gravMassScale = 0;
  35049. this.zip_gravMass = !1;
  35050. this.gravMass = 0;
  35051. this.nomove = !1;
  35052. this.massMode = this.imass = this.smass = this.cmass = 0;
  35053. this.zip_mass = !1;
  35054. this.mass = 0;
  35055. this.zip_axis = !1;
  35056. this.angvel = this.torque = this.kinangvel = this.pre_rot = this.rot = this.axisx = this.axisy = 0;
  35057. this.wrap_svel = this.wrapcvel = null;
  35058. this.svelx = this.svely = 0;
  35059. this.wrap_kinvel = null;
  35060. this.kinvelx = this.kinvely = 0;
  35061. this.wrap_force = null;
  35062. this.forcex = this.forcey = 0;
  35063. this.wrap_vel = null;
  35064. this.velx = this.vely = 0;
  35065. this.wrap_pos = null;
  35066. this.pre_posx =
  35067. this.pre_posy = this.posx = this.posy = 0;
  35068. this.bullet = this.bulletEnabled = this.disableCCD = !1;
  35069. this.sweepRadius = 0;
  35070. this.sweepFrozen = !1;
  35071. this.graph_depth = this.sweepTime = this.sweep_angvel = 0;
  35072. this.compound = this.shapes = this.wrap_shapes = this.space = this.arbiters = this.wrap_arbiters = this.constraints = this.wrap_constraints = this.component = null;
  35073. this.type = 0;
  35074. this.world = !1;
  35075. this.outer = null;
  35076. c.phys.ZPP_Interactor.call(this);
  35077. this.ibody = this;
  35078. this.bulletEnabled = this.world = !1;
  35079. this.sweep_angvel = this.sweepTime = 0;
  35080. this.disableCCD = this.norotate =
  35081. this.nomove = !1;
  35082. this.axisx = this.rot = this.posy = this.posx = 0;
  35083. this.axisy = 1;
  35084. this.torque = this.angvel = this.kinangvel = this.forcey = this.forcex = this.kinvely = this.kinvelx = this.vely = this.velx = this.svely = this.svelx = 0;
  35085. this.pre_rot = this.pre_posy = this.pre_posx = Math.POSITIVE_INFINITY;
  35086. this.worldCOMy = this.worldCOMx = this.localCOMy = this.localCOMx = 0;
  35087. this.zip_aabb = !0;
  35088. this.aabb = c.geom.ZPP_AABB.get(0, 0, 0, 0);
  35089. this.aabb._immutable = !0;
  35090. this.aabb._validate = A(this, this.aabb_validate);
  35091. this.massMode = c.util.ZPP_Flags.id_MassMode_DEFAULT;
  35092. this.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_DEFAULT;
  35093. this.gravMassScale = 1;
  35094. this.inertiaMode = c.util.ZPP_Flags.id_InertiaMode_DEFAULT;
  35095. this.arbiters = new c.util.ZNPList_ZPP_Arbiter;
  35096. this.constraints = new c.util.ZNPList_ZPP_Constraint;
  35097. this.shapes = new c.util.ZNPList_ZPP_Shape;
  35098. this.wrap_shapes = c.util.ZPP_ShapeList.get(this.shapes);
  35099. this.wrap_shapes.zpp_inner.adder = A(this, this.shapes_adder);
  35100. this.wrap_shapes.zpp_inner.subber = A(this, this.shapes_subber);
  35101. this.wrap_shapes.zpp_inner._invalidate = A(this, this.shapes_invalidate);
  35102. this.wrap_shapes.zpp_inner._modifiable = A(this, this.shapes_modifiable);
  35103. this.kinematicDelaySleep = !1
  35104. };
  35105. s["zpp_nape.phys.ZPP_Body"] = c.phys.ZPP_Body;
  35106. c.phys.ZPP_Body.__name__ = ["zpp_nape", "phys", "ZPP_Body"];
  35107. c.phys.ZPP_Body.bodysetlt = function (a, b) {
  35108. return a.id < b.id
  35109. };
  35110. c.phys.ZPP_Body.__static = function () {
  35111. var a = h.phys.Body;
  35112. null == c.util.ZPP_Flags.BodyType_STATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_STATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  35113. var a = new a(c.util.ZPP_Flags.BodyType_STATIC),
  35114. b = a.zpp_inner;
  35115. b.world = !0;
  35116. b.wrap_shapes.zpp_inner.immutable = !0;
  35117. b.smass = b.imass = b.cmass = b.mass = b.gravMass = 0;
  35118. b.sinertia = b.iinertia = b.cinertia = b.inertia = 0;
  35119. b.cbTypes.clear();
  35120. return a
  35121. };
  35122. c.phys.ZPP_Body.__super__ = c.phys.ZPP_Interactor;
  35123. c.phys.ZPP_Body.prototype = I(c.phys.ZPP_Interactor.prototype, {
  35124. copy: function () {
  35125. var a = (new h.phys.Body).zpp_inner;
  35126. a.type = this.type;
  35127. a.bulletEnabled = this.bulletEnabled;
  35128. a.disableCCD = this.disableCCD;
  35129. for (var b = this.shapes.head; null != b;) a.outer.zpp_inner.wrap_shapes.add(b.elt.outer.copy()),
  35130. b = b.next;
  35131. a.posx = this.posx;
  35132. a.posy = this.posy;
  35133. a.velx = this.velx;
  35134. a.vely = this.vely;
  35135. a.forcex = this.forcex;
  35136. a.forcey = this.forcey;
  35137. a.rot = this.rot;
  35138. a.angvel = this.angvel;
  35139. a.torque = this.torque;
  35140. a.kinvelx = this.kinvelx;
  35141. a.kinvely = this.kinvely;
  35142. a.kinangvel = this.kinangvel;
  35143. a.svelx = this.svelx;
  35144. a.svely = this.svely;
  35145. this.zip_axis ? a.invalidate_rot() : (a.axisx = this.axisx, a.axisy = this.axisy);
  35146. a.rot = this.rot;
  35147. a.massMode = this.massMode;
  35148. a.gravMassMode = this.gravMassMode;
  35149. a.inertiaMode = this.inertiaMode;
  35150. a.norotate = this.norotate;
  35151. a.nomove = this.nomove;
  35152. a.cmass = this.cmass;
  35153. a.cinertia = this.cinertia;
  35154. this.zip_mass ? a.invalidate_mass() : a.mass = this.mass;
  35155. this.zip_gravMass ? a.invalidate_gravMass() : a.gravMass = this.gravMass;
  35156. this.zip_gravMassScale ? a.invalidate_gravMassScale() : a.gravMassScale = this.gravMassScale;
  35157. this.zip_inertia ? a.invalidate_inertia() : a.inertia = this.inertia;
  35158. this.zip_aabb ? a.zip_aabb = !0 : (a.aabb.minx = this.aabb.minx, a.aabb.miny = this.aabb.miny, a.aabb.maxx = this.aabb.maxx, a.aabb.maxy = this.aabb.maxy);
  35159. this.zip_localCOM ? (a.zip_localCOM = !0, a.zip_worldCOM = !0) : (a.localCOMx = this.localCOMx, a.localCOMy = this.localCOMy);
  35160. this.zip_worldCOM ? a.zip_worldCOM = !0 : (a.worldCOMx = this.worldCOMx, a.worldCOMy = this.worldCOMy);
  35161. this.copyto(a.outer);
  35162. return a.outer
  35163. },
  35164. removedFromSpace: function () {
  35165. for (; null != this.arbiters.head;) {
  35166. var a = this.arbiters.pop_unsafe();
  35167. a.cleared = !0;
  35168. a.b2 == this && a.b1.arbiters.inlined_try_remove(a);
  35169. a.b1 == this && a.b2.arbiters.inlined_try_remove(a);
  35170. null != a.pair && (a.pair.arb = null, a.pair = null);
  35171. a.active = !1;
  35172. this.space.f_arbiters.modified = !0
  35173. }
  35174. a = this.component;
  35175. a.body =
  35176. null;
  35177. a.constraint = null;
  35178. null;
  35179. a.next = c.space.ZPP_Component.zpp_pool;
  35180. c.space.ZPP_Component.zpp_pool = a;
  35181. this.component = null;
  35182. this.__iremovedFromSpace()
  35183. },
  35184. addedToSpace: function () {
  35185. null == c.space.ZPP_Component.zpp_pool ? this.component = new c.space.ZPP_Component : (this.component = c.space.ZPP_Component.zpp_pool, c.space.ZPP_Component.zpp_pool = this.component.next, this.component.next = null);
  35186. null;
  35187. this.component.isBody = !0;
  35188. this.component.body = this;
  35189. this.__iaddedToSpace()
  35190. },
  35191. shapes_modifiable: function () {
  35192. this.immutable_midstep("Body::shapes");
  35193. if (this.type == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.space) throw "Error: Cannot modifiy shapes of static object once added to Space";
  35194. },
  35195. shapes_invalidate: function (a) {
  35196. this.invalidate_shapes()
  35197. },
  35198. shapes_subber: function (a) {
  35199. null != this.space && this.space.removed_shape(a.zpp_inner);
  35200. a.zpp_inner.body = null;
  35201. a.zpp_inner.removedFromBody()
  35202. },
  35203. shapes_adder: function (a) {
  35204. return a.zpp_inner.body != this ? (null != a.zpp_inner.body && a.zpp_inner.body.wrap_shapes.remove(a), a.zpp_inner.body = this, a.zpp_inner.addedToBody(),
  35205. null != this.space && this.space.added_shape(a.zpp_inner, null), a.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && (a.zpp_inner.polygon.invalidate_gaxi(), a.zpp_inner.polygon.invalidate_gverts()), !0) : !1
  35206. },
  35207. aabb_validate: function () {
  35208. if (null == this.shapes.head) throw "Error: bounds only makes sense when Body has shapes";
  35209. this.validate_aabb()
  35210. },
  35211. clear: function () {
  35212. if (null != this.space) throw "Error: Cannot clear a Body if it is currently being used by a Space!";
  35213. if (null != this.constraints.head) throw "Error: Cannot clear a Body if it is currently being used by a constraint!";
  35214. for (; null != this.shapes.head;) {
  35215. var a = this.shapes.pop_unsafe();
  35216. a.removedFromBody();
  35217. a.body = null
  35218. }
  35219. this.invalidate_shapes();
  35220. this.angvel = this.torque = this.kinangvel = this.pre_rot = this.rot = this.svely = this.svelx = this.kinvely = this.kinvelx = this.forcey = this.forcex = this.vely = this.velx = this.posy = this.posx = this.pre_posy = this.pre_posx = 0;
  35221. this.invalidate_pos();
  35222. this.invalidate_rot();
  35223. this.axisx = 0;
  35224. this.axisy = 1;
  35225. this.zip_axis = !1;
  35226. this.massMode = c.util.ZPP_Flags.id_MassMode_DEFAULT;
  35227. this.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_DEFAULT;
  35228. this.gravMassScale = 1;
  35229. this.inertiaMode = c.util.ZPP_Flags.id_InertiaMode_DEFAULT;
  35230. this.nomove = this.norotate = !1
  35231. },
  35232. __immutable_midstep: function (a) {
  35233. if (null != this.space && this.space.midstep) throw "Error: " + a + " cannot be set during a space step()";
  35234. },
  35235. getworldCOM: function () {
  35236. if (null == this.shapes.head) throw "Error: worldCOM only makes sense when Body has Shapes";
  35237. this.validate_worldCOM()
  35238. },
  35239. getlocalCOM: function () {
  35240. if (null == this.shapes.head) throw "Error: localCOM only makes sense when Body has Shapes";
  35241. this.validate_localCOM()
  35242. },
  35243. validate_worldCOM: function () {
  35244. this.zip_worldCOM && (this.zip_worldCOM = !1, this.validate_localCOM(), this.zip_axis && (this.zip_axis = !1, this.axisx = Math.sin(this.rot), this.axisy = Math.cos(this.rot), null), this.worldCOMx = this.posx + (this.axisy * this.localCOMx - this.axisx * this.localCOMy), this.worldCOMy = this.posy + (this.localCOMx * this.axisx + this.localCOMy * this.axisy), null != this.wrap_worldCOM && (this.wrap_worldCOM.zpp_inner.x = this.worldCOMx, this.wrap_worldCOM.zpp_inner.y = this.worldCOMy))
  35245. },
  35246. validate_localCOM: function () {
  35247. if (this.zip_localCOM) {
  35248. this.zip_localCOM = !1;
  35249. for (var a = 0, b = 0, d = 0, g = this.shapes.head; null != g;) {
  35250. var e = g.elt;
  35251. e.zip_localCOM && (e.zip_localCOM = !1, e.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && e.polygon.__validate_localCOM(), null != e.wrap_localCOM && (e.wrap_localCOM.zpp_inner.x = e.localCOMx, e.wrap_localCOM.zpp_inner.y = e.localCOMy));
  35252. e.validate_area_inertia();
  35253. var f = e.area * e.material.density,
  35254. a = a + e.localCOMx * f,
  35255. b = b + e.localCOMy * f,
  35256. d = d + e.area * e.material.density,
  35257. g = g.next
  35258. }
  35259. 0 != d && (f = 1 / d, this.localCOMx = a * f, this.localCOMy = b * f);
  35260. null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x =
  35261. this.localCOMx, this.wrap_localCOM.zpp_inner.y = this.localCOMy);
  35262. this.zip_mass && this.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT && (this.zip_mass = !1, this.cmass = d, this.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC ? (this.mass = this.cmass, this.imass = this.smass = 1 / this.mass) : (this.mass = Math.POSITIVE_INFINITY, this.imass = this.smass = 0))
  35263. }
  35264. },
  35265. invalidate_worldCOM: function () {
  35266. this.zip_worldCOM = !0
  35267. },
  35268. invalidate_localCOM: function () {
  35269. this.zip_worldCOM = this.zip_localCOM = !0
  35270. },
  35271. invalidate_aabb: function () {
  35272. this.zip_aabb = !0
  35273. },
  35274. validate_aabb: function () {
  35275. if (null ==
  35276. this.shapes.head) throw "Error: Body bounds only makes sense if it contains shapes";
  35277. if (this.zip_aabb) {
  35278. this.zip_aabb = !1;
  35279. this.aabb.minx = Math.POSITIVE_INFINITY;
  35280. this.aabb.miny = Math.POSITIVE_INFINITY;
  35281. this.aabb.maxx = Math.NEGATIVE_INFINITY;
  35282. this.aabb.maxy = Math.NEGATIVE_INFINITY;
  35283. for (var a = this.shapes.head; null != a;) {
  35284. var b = a.elt;
  35285. b.zip_aabb && null != b.body && (b.zip_aabb = !1, b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? b.circle.__validate_aabb() : b.polygon.__validate_aabb());
  35286. this.aabb.combine(b.aabb);
  35287. a = a.next
  35288. }
  35289. }
  35290. },
  35291. invalidate_wake: function () {
  35292. this.wake()
  35293. },
  35294. validate_inertia: function () {
  35295. if (this.zip_inertia) {
  35296. this.zip_inertia = !1;
  35297. if (this.inertiaMode == c.util.ZPP_Flags.id_InertiaMode_DEFAULT) {
  35298. this.cinertia = 0;
  35299. for (var a = this.shapes.head; null != a;) {
  35300. var b = a.elt;
  35301. b.refmaterial.density = b.material.density;
  35302. b.validate_area_inertia();
  35303. this.cinertia += b.inertia * b.area * b.material.density;
  35304. a = a.next
  35305. }
  35306. }
  35307. this.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || this.norotate ? (this.inertia = Math.POSITIVE_INFINITY, this.sinertia = this.iinertia = 0) : (this.inertia = this.cinertia, this.sinertia = this.iinertia =
  35308. 1 / this.inertia)
  35309. }
  35310. },
  35311. invalidate_inertia: function () {
  35312. this.zip_inertia = !0;
  35313. this.wake()
  35314. },
  35315. validate_gravMassScale: function () {
  35316. this.zip_gravMassScale && (this.zip_gravMassScale = !1, this.gravMassMode == c.util.ZPP_Flags.id_GravMassMode_DEFAULT ? this.gravMassScale = 1 : this.gravMassMode == c.util.ZPP_Flags.id_GravMassMode_FIXED && (this.validate_mass(), this.gravMassScale = this.gravMass / this.cmass))
  35317. },
  35318. invalidate_gravMassScale: function () {
  35319. this.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_SCALED ? this.zip_gravMassScale = !0 : this.invalidate_gravMass()
  35320. },
  35321. validate_gravMass: function () {
  35322. this.zip_gravMass && (this.zip_gravMass = !1, this.validate_mass(), this.gravMassMode == c.util.ZPP_Flags.id_GravMassMode_DEFAULT ? (this.validate_mass(), this.gravMass = this.cmass) : this.gravMassMode == c.util.ZPP_Flags.id_GravMassMode_SCALED && (this.validate_mass(), this.gravMass = this.cmass * this.gravMassScale))
  35323. },
  35324. invalidate_gravMass: function () {
  35325. this.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_FIXED && (this.zip_gravMass = !0);
  35326. this.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_SCALED &&
  35327. (this.zip_gravMassScale = !0);
  35328. this.wake()
  35329. },
  35330. validate_mass: function () {
  35331. if (this.zip_mass) {
  35332. this.zip_mass = !1;
  35333. if (this.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT) {
  35334. this.cmass = 0;
  35335. for (var a = this.shapes.head; null != a;) {
  35336. var b = a.elt;
  35337. b.refmaterial.density = b.material.density;
  35338. b.validate_area_inertia();
  35339. this.cmass += b.area * b.material.density;
  35340. a = a.next
  35341. }
  35342. }
  35343. this.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || this.nomove ? (this.mass = Math.POSITIVE_INFINITY, this.imass = this.smass = 0) : (this.mass = this.cmass, this.imass = this.smass = 1 / this.mass)
  35344. }
  35345. },
  35346. invalidate_mass: function () {
  35347. this.zip_mass = !0;
  35348. this.invalidate_gravMass()
  35349. },
  35350. delta_rot: function (a) {
  35351. this.rot += a;
  35352. if (1E-4 < a * a) this.axisx = Math.sin(this.rot), this.axisy = Math.cos(this.rot), null;
  35353. else {
  35354. var b = a * a,
  35355. d = 1 - 0.5 * b,
  35356. b = 1 - b * b / 8,
  35357. c = (d * this.axisx + a * this.axisy) * b;
  35358. this.axisy = (d * this.axisy - a * this.axisx) * b;
  35359. this.axisx = c
  35360. }
  35361. },
  35362. quick_validate_axis: function () {
  35363. this.axisx = Math.sin(this.rot);
  35364. this.axisy = Math.cos(this.rot)
  35365. },
  35366. validate_axis: function () {
  35367. this.zip_axis && (this.zip_axis = !1, this.axisx = Math.sin(this.rot), this.axisy = Math.cos(this.rot),
  35368. null)
  35369. },
  35370. invalidate_rot: function () {
  35371. this.zip_axis = !0;
  35372. for (var a = this.shapes.head; null != a;) {
  35373. var b = a.elt;
  35374. b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && (b.polygon.invalidate_gverts(), b.polygon.invalidate_gaxi());
  35375. b.invalidate_worldCOM();
  35376. a = a.next
  35377. }
  35378. this.zip_worldCOM = !0
  35379. },
  35380. setup_cvel: function () {
  35381. this.wrapcvel = h.geom.Vec3.get();
  35382. this.wrapcvel.zpp_inner.immutable = !0;
  35383. this.wrapcvel.zpp_inner._validate = A(this, this.cvel_validate)
  35384. },
  35385. cvel_validate: function () {
  35386. this.wrapcvel.zpp_inner.x = this.velx + this.kinvelx;
  35387. this.wrapcvel.zpp_inner.y =
  35388. this.vely + this.kinvely;
  35389. this.wrapcvel.zpp_inner.z = this.angvel + this.kinangvel
  35390. },
  35391. setupForce: function () {
  35392. this.wrap_force = h.geom.Vec2.get(this.forcex, this.forcey, null);
  35393. this.wrap_force.zpp_inner._inuse = !0;
  35394. this.world ? this.wrap_force.zpp_inner._immutable = !0 : (this.wrap_force.zpp_inner._invalidate = A(this, this.force_invalidate), this.wrap_force.zpp_inner._validate = A(this, this.force_validate))
  35395. },
  35396. setupsvel: function () {
  35397. this.wrap_svel = h.geom.Vec2.get(this.svelx, this.svely, null);
  35398. this.wrap_svel.zpp_inner._inuse = !0;
  35399. this.world ?
  35400. this.wrap_svel.zpp_inner._immutable = !0 : (this.wrap_svel.zpp_inner._invalidate = A(this, this.svel_invalidate), this.wrap_svel.zpp_inner._validate = A(this, this.svel_validate))
  35401. },
  35402. setupkinvel: function () {
  35403. this.wrap_kinvel = h.geom.Vec2.get(this.kinvelx, this.kinvely, null);
  35404. this.wrap_kinvel.zpp_inner._inuse = !0;
  35405. this.world ? this.wrap_kinvel.zpp_inner._immutable = !0 : (this.wrap_kinvel.zpp_inner._invalidate = A(this, this.kinvel_invalidate), this.wrap_kinvel.zpp_inner._validate = A(this, this.kinvel_validate))
  35406. },
  35407. setupVelocity: function () {
  35408. this.wrap_vel =
  35409. h.geom.Vec2.get(this.velx, this.vely, null);
  35410. this.wrap_vel.zpp_inner._inuse = !0;
  35411. this.world ? this.wrap_vel.zpp_inner._immutable = !0 : (this.wrap_vel.zpp_inner._invalidate = A(this, this.vel_invalidate), this.wrap_vel.zpp_inner._validate = A(this, this.vel_validate))
  35412. },
  35413. setupPosition: function () {
  35414. this.wrap_pos = h.geom.Vec2.get(this.posx, this.posy, null);
  35415. this.wrap_pos.zpp_inner._inuse = !0;
  35416. this.world ? this.wrap_pos.zpp_inner._immutable = !0 : (this.wrap_pos.zpp_inner._invalidate = A(this, this.pos_invalidate), this.wrap_pos.zpp_inner._validate =
  35417. A(this, this.pos_validate))
  35418. },
  35419. force_validate: function () {
  35420. this.wrap_force.zpp_inner.x = this.forcex;
  35421. this.wrap_force.zpp_inner.y = this.forcey
  35422. },
  35423. force_invalidate: function (a) {
  35424. if (this.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Non-dynamic body cannot have force applied.";
  35425. this.forcex = a.x;
  35426. this.forcey = a.y;
  35427. this.wake()
  35428. },
  35429. svel_validate: function () {
  35430. this.wrap_svel.zpp_inner.x = this.svelx;
  35431. this.wrap_svel.zpp_inner.y = this.svely
  35432. },
  35433. svel_invalidate: function (a) {
  35434. this.svelx = a.x;
  35435. this.svely = a.y;
  35436. this.wake()
  35437. },
  35438. kinvel_validate: function () {
  35439. this.wrap_kinvel.zpp_inner.x =
  35440. this.kinvelx;
  35441. this.wrap_kinvel.zpp_inner.y = this.kinvely
  35442. },
  35443. kinvel_invalidate: function (a) {
  35444. this.kinvelx = a.x;
  35445. this.kinvely = a.y;
  35446. this.wake()
  35447. },
  35448. vel_validate: function () {
  35449. this.wrap_vel.zpp_inner.x = this.velx;
  35450. this.wrap_vel.zpp_inner.y = this.vely
  35451. },
  35452. vel_invalidate: function (a) {
  35453. if (this.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: Static body cannot have its velocity set.";
  35454. this.velx = a.x;
  35455. this.vely = a.y;
  35456. this.wake()
  35457. },
  35458. pos_validate: function () {
  35459. this.wrap_pos.zpp_inner.x = this.posx;
  35460. this.wrap_pos.zpp_inner.y = this.posy
  35461. },
  35462. pos_invalidate: function (a) {
  35463. this.immutable_midstep("Body::position");
  35464. if (this.type == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.space) throw "Error: Cannot move a static object once inside a Space";
  35465. if (this.posx != a.x || this.posy != a.y) this.posx = a.x, this.posy = a.y, this.invalidate_pos(), this.wake()
  35466. },
  35467. invalidate_pos: function () {
  35468. for (var a = this.shapes.head; null != a;) {
  35469. var b = a.elt;
  35470. b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && (b.polygon.invalidate_gverts(), b.polygon.invalidate_gaxi());
  35471. b.invalidate_worldCOM();
  35472. a = a.next
  35473. }
  35474. this.zip_worldCOM = !0
  35475. },
  35476. sweepValidate: function (a) {
  35477. if (a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) a.worldCOMx = this.posx + (this.axisy * a.localCOMx - this.axisx * a.localCOMy), a.worldCOMy = this.posy + (a.localCOMx * this.axisx + a.localCOMy * this.axisy);
  35478. else {
  35479. a = a.polygon;
  35480. for (var b = a.lverts.next, d = a.gverts.next; null != d;) {
  35481. var g = d,
  35482. e = b,
  35483. b = b.next;
  35484. g.x = this.posx + (this.axisy * e.x - this.axisx * e.y);
  35485. g.y = this.posy + (e.x * this.axisx + e.y * this.axisy);
  35486. d = d.next
  35487. }
  35488. b = a.edges.head;
  35489. g = d = a.gverts.next;
  35490. for (d = d.next; null != d;) {
  35491. var e = d,
  35492. f = b.elt,
  35493. b = b.next;
  35494. f.gnormx = this.axisy * f.lnormx - this.axisx * f.lnormy;
  35495. f.gnormy = f.lnormx * this.axisx + f.lnormy * this.axisy;
  35496. f.gprojection = this.posx * f.gnormx + this.posy * f.gnormy + f.lprojection;
  35497. f.tp0 = g.y * f.gnormx - g.x * f.gnormy;
  35498. f.tp1 = e.y * f.gnormx - e.x * f.gnormy;
  35499. g = e;
  35500. d = d.next
  35501. }
  35502. e = a.gverts.next;
  35503. f = b.elt;
  35504. f.gnormx = this.axisy * f.lnormx - this.axisx * f.lnormy;
  35505. f.gnormy = f.lnormx * this.axisx + f.lnormy * this.axisy;
  35506. f.gprojection = this.posx * f.gnormx + this.posy * f.gnormy + f.lprojection;
  35507. f.tp0 = g.y * f.gnormx - g.x * f.gnormy;
  35508. f.tp1 = e.y * f.gnormx - e.x * f.gnormy
  35509. }
  35510. },
  35511. sweepIntegrate: function (a) {
  35512. var b = a - this.sweepTime;
  35513. 0 != b && (this.sweepTime = a, this.posx += this.velx * b, this.posy += this.vely * b, 0 != this.angvel && this.delta_rot(this.sweep_angvel * b))
  35514. },
  35515. refreshArbiters: function () {
  35516. for (var a = this.arbiters.head; null != a;) a.elt.invalidated = !0, a = a.next
  35517. },
  35518. atRest: function (a) {
  35519. if (this.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) return this.component.sleeping;
  35520. var b = h.Config.linearSleepThreshold,
  35521. b = b * b;
  35522. if (this.velx * this.velx + this.vely * this.vely > b) a = 0;
  35523. else if (c.geom.ZPP_VecMath.vec_dsq(this.posx,
  35524. this.posy, this.pre_posx, this.pre_posy) > 0.25 * b * a * a) a = 0;
  35525. else {
  35526. var d = b = 0,
  35527. b = this.aabb.maxx - this.aabb.minx,
  35528. d = this.aabb.maxy - this.aabb.miny,
  35529. b = b * b + d * d,
  35530. d = h.Config.angularSleepThreshold,
  35531. d = d * d;
  35532. if (4 * this.angvel * this.angvel * b > d) a = !1;
  35533. else {
  35534. var g = this.rot - this.pre_rot;
  35535. a = g * g * b > d * a * a ? !1 : !0
  35536. }
  35537. }
  35538. a || (this.component.waket = this.space.stamp);
  35539. return this.component.waket + h.Config.sleepDelay < this.space.stamp
  35540. },
  35541. interactingBodies: function (a, b, d) {
  35542. var g = this;
  35543. null == c.phys.ZPP_Body.bodyset && (c.phys.ZPP_Body.bodyset = new c.util.ZPP_Set_ZPP_Body,
  35544. c.phys.ZPP_Body.bodyset.lt = c.phys.ZPP_Body.bodysetlt, c.phys.ZPP_Body.bodystack = new c.util.ZNPList_ZPP_Body);
  35545. null;
  35546. var e = null == d ? new h.phys.BodyList : d;
  35547. c.phys.ZPP_Body.bodyset.insert(this);
  35548. c.phys.ZPP_Body.bodystack.add(this);
  35549. for (this.graph_depth = 0; null != c.phys.ZPP_Body.bodystack.head;)
  35550. if (d = c.phys.ZPP_Body.bodystack.pop_unsafe(), d.graph_depth != b)
  35551. for (var f = d.arbiters.head; null != f;) {
  35552. var l = f.elt;
  35553. 0 != (l.type & a) && (l = l.b1 == d ? l.b2 : l.b1, c.phys.ZPP_Body.bodyset.try_insert_bool(l) && (c.phys.ZPP_Body.bodystack.add(l),
  35554. l.graph_depth = d.graph_depth + 1));
  35555. f = f.next
  35556. }
  35557. c.phys.ZPP_Body.bodyset.clear_with(function (a) {
  35558. a != g && e.add(a.outer)
  35559. });
  35560. return e
  35561. },
  35562. connectedBodies: function (a, b) {
  35563. var d = this;
  35564. null == c.phys.ZPP_Body.bodyset && (c.phys.ZPP_Body.bodyset = new c.util.ZPP_Set_ZPP_Body, c.phys.ZPP_Body.bodyset.lt = c.phys.ZPP_Body.bodysetlt, c.phys.ZPP_Body.bodystack = new c.util.ZNPList_ZPP_Body);
  35565. null;
  35566. var g = null == b ? new h.phys.BodyList : b;
  35567. c.phys.ZPP_Body.bodystack.add(this);
  35568. c.phys.ZPP_Body.bodyset.insert(this);
  35569. for (this.graph_depth = 0; null != c.phys.ZPP_Body.bodystack.head;) {
  35570. var e =
  35571. c.phys.ZPP_Body.bodystack.pop_unsafe();
  35572. if (e.graph_depth != a)
  35573. for (c.phys.ZPP_Body.cur_graph_depth = e.graph_depth, e = e.constraints.head; null != e;) e.elt.outer.visitBodies(A(this, this.connectedBodies_cont)), e = e.next
  35574. }
  35575. c.phys.ZPP_Body.bodyset.clear_with(function (a) {
  35576. a != d && g.add(a.outer)
  35577. });
  35578. return g
  35579. },
  35580. connectedBodies_cont: function (a) {
  35581. c.phys.ZPP_Body.bodyset.try_insert_bool(a.zpp_inner) && (c.phys.ZPP_Body.bodystack.add(a.zpp_inner), a.zpp_inner.graph_depth = c.phys.ZPP_Body.cur_graph_depth + 1)
  35582. },
  35583. init_bodysetlist: function () {
  35584. null ==
  35585. c.phys.ZPP_Body.bodyset && (c.phys.ZPP_Body.bodyset = new c.util.ZPP_Set_ZPP_Body, c.phys.ZPP_Body.bodyset.lt = c.phys.ZPP_Body.bodysetlt, c.phys.ZPP_Body.bodystack = new c.util.ZNPList_ZPP_Body)
  35586. },
  35587. invalidate_shapes: function () {
  35588. this.zip_worldCOM = this.zip_localCOM = this.zip_aabb = !0;
  35589. this.invalidate_mass();
  35590. this.invalidate_inertia()
  35591. },
  35592. invalidate_type: function () {
  35593. this.invalidate_mass();
  35594. this.invalidate_inertia()
  35595. },
  35596. isKinematic: function () {
  35597. return this.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC
  35598. },
  35599. isDynamic: function () {
  35600. return this.type ==
  35601. c.util.ZPP_Flags.id_BodyType_DYNAMIC
  35602. },
  35603. isStatic: function () {
  35604. return this.type == c.util.ZPP_Flags.id_BodyType_STATIC
  35605. },
  35606. __class__: c.phys.ZPP_Body
  35607. });
  35608. c.phys.ZPP_Compound = function () {
  35609. this.compound = this.space = null;
  35610. this.depth = 0;
  35611. this.outer = this.bodies = this.constraints = this.compounds = this.wrap_bodies = this.wrap_constraints = this.wrap_compounds = null;
  35612. c.phys.ZPP_Interactor.call(this);
  35613. this.icompound = this;
  35614. this.depth = 1;
  35615. this.bodies = new c.util.ZNPList_ZPP_Body;
  35616. this.wrap_bodies = c.util.ZPP_BodyList.get(this.bodies);
  35617. this.wrap_bodies.zpp_inner.adder =
  35618. A(this, this.bodies_adder);
  35619. this.wrap_bodies.zpp_inner.subber = A(this, this.bodies_subber);
  35620. this.wrap_bodies.zpp_inner._modifiable = A(this, this.bodies_modifiable);
  35621. this.constraints = new c.util.ZNPList_ZPP_Constraint;
  35622. this.wrap_constraints = c.util.ZPP_ConstraintList.get(this.constraints);
  35623. this.wrap_constraints.zpp_inner.adder = A(this, this.constraints_adder);
  35624. this.wrap_constraints.zpp_inner.subber = A(this, this.constraints_subber);
  35625. this.wrap_constraints.zpp_inner._modifiable = A(this, this.constraints_modifiable);
  35626. this.compounds =
  35627. new c.util.ZNPList_ZPP_Compound;
  35628. this.wrap_compounds = c.util.ZPP_CompoundList.get(this.compounds);
  35629. this.wrap_compounds.zpp_inner.adder = A(this, this.compounds_adder);
  35630. this.wrap_compounds.zpp_inner.subber = A(this, this.compounds_subber);
  35631. this.wrap_compounds.zpp_inner._modifiable = A(this, this.compounds_modifiable)
  35632. };
  35633. s["zpp_nape.phys.ZPP_Compound"] = c.phys.ZPP_Compound;
  35634. c.phys.ZPP_Compound.__name__ = ["zpp_nape", "phys", "ZPP_Compound"];
  35635. c.phys.ZPP_Compound.__super__ = c.phys.ZPP_Interactor;
  35636. c.phys.ZPP_Compound.prototype =
  35637. I(c.phys.ZPP_Interactor.prototype, {
  35638. copy: function (a, b) {
  35639. var d = null == a;
  35640. null == a && (a = []);
  35641. null == b && (b = []);
  35642. for (var g = new h.phys.Compound, e = this.compounds.head; null != e;) {
  35643. var f = e.elt,
  35644. f = f.copy(a, b);
  35645. f.zpp_inner.immutable_midstep("Compound::compound");
  35646. (null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer) != g && (null != (null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer) && (null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer).zpp_inner.wrap_compounds.remove(f), null != g && g.zpp_inner.wrap_compounds.add(f));
  35647. null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer;
  35648. e = e.next
  35649. }
  35650. for (e = this.bodies.head; null != e;) {
  35651. var f = e.elt,
  35652. l = f.outer.copy();
  35653. a.push(c.constraint.ZPP_CopyHelper.dict(f.id, l));
  35654. (null == l.zpp_inner.compound ? null : l.zpp_inner.compound.outer) != g && (null != (null == l.zpp_inner.compound ? null : l.zpp_inner.compound.outer) && (null == l.zpp_inner.compound ? null : l.zpp_inner.compound.outer).zpp_inner.wrap_bodies.remove(l), null != g && g.zpp_inner.wrap_bodies.add(l));
  35655. null == l.zpp_inner.compound ? null : l.zpp_inner.compound.outer;
  35656. e = e.next
  35657. }
  35658. for (e = this.constraints.head; null != e;) f = e.elt, f = f.copy(a, b), (null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer) != g && (null != (null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer) && (null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer).zpp_inner.wrap_constraints.remove(f), null != g && g.zpp_inner.wrap_constraints.add(f)), null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer, e = e.next;
  35659. if (d)
  35660. for (; 0 < b.length;)
  35661. for (d = b.pop(), e = 0; e < a.length;)
  35662. if (f = a[e], ++e, f.id == d.id) {
  35663. d.cb(f.bc);
  35664. break
  35665. }
  35666. this.copyto(g);
  35667. return g
  35668. },
  35669. compounds_modifiable: function () {
  35670. this.immutable_midstep("Compound::compounds")
  35671. },
  35672. compounds_subber: function (a) {
  35673. a.zpp_inner.compound = null;
  35674. a.zpp_inner.depth = 1;
  35675. null != this.space && this.space.remCompound(a.zpp_inner)
  35676. },
  35677. compounds_adder: function (a) {
  35678. for (var b = this; null != b && b != a.zpp_inner;) b = b.compound;
  35679. if (b == a.zpp_inner) throw "Error: Assignment would cause a cycle in the Compound tree: assigning " + a.toString() + ".compound = " + this.outer.toString();
  35680. return a.zpp_inner.compound != this ?
  35681. (null != a.zpp_inner.compound ? a.zpp_inner.compound.wrap_compounds.remove(a) : null != a.zpp_inner.space && a.zpp_inner.space.wrap_compounds.remove(a), a.zpp_inner.compound = this, a.zpp_inner.depth = this.depth + 1, null != this.space && this.space.addCompound(a.zpp_inner), !0) : !1
  35682. },
  35683. constraints_modifiable: function () {
  35684. this.immutable_midstep("Compound::constraints")
  35685. },
  35686. constraints_subber: function (a) {
  35687. a.zpp_inner.compound = null;
  35688. null != this.space && this.space.remConstraint(a.zpp_inner)
  35689. },
  35690. constraints_adder: function (a) {
  35691. return a.zpp_inner.compound !=
  35692. this ? (null != a.zpp_inner.compound ? a.zpp_inner.compound.wrap_constraints.remove(a) : null != a.zpp_inner.space && a.zpp_inner.space.wrap_constraints.remove(a), a.zpp_inner.compound = this, null != this.space && this.space.addConstraint(a.zpp_inner), !0) : !1
  35693. },
  35694. bodies_modifiable: function () {
  35695. this.immutable_midstep("Compound::bodies")
  35696. },
  35697. bodies_subber: function (a) {
  35698. a.zpp_inner.compound = null;
  35699. null != this.space && this.space.remBody(a.zpp_inner)
  35700. },
  35701. bodies_adder: function (a) {
  35702. return a.zpp_inner.compound != this ? (null != a.zpp_inner.compound ?
  35703. a.zpp_inner.compound.wrap_bodies.remove(a) : null != a.zpp_inner.space && a.zpp_inner.space.wrap_bodies.remove(a), a.zpp_inner.compound = this, null != this.space && this.space.addBody(a.zpp_inner), !0) : !1
  35704. },
  35705. breakApart: function () {
  35706. null != this.space && (this.__iremovedFromSpace(), this.space.nullInteractorType(this));
  35707. for (null != this.compound ? this.compound.compounds.remove(this) : null != this.space && this.space.compounds.remove(this); null != this.bodies.head;) {
  35708. var a = this.bodies.pop_unsafe();
  35709. null != (a.compound = this.compound) ? this.compound.bodies.add(a) :
  35710. null != this.space && this.space.bodies.add(a);
  35711. null != this.space && this.space.freshInteractorType(a)
  35712. }
  35713. for (; null != this.constraints.head;) a = this.constraints.pop_unsafe(), null != (a.compound = this.compound) ? this.compound.constraints.add(a) : null != this.space && this.space.constraints.add(a);
  35714. for (; null != this.compounds.head;) a = this.compounds.pop_unsafe(), null != (a.compound = this.compound) ? this.compound.compounds.add(a) : null != this.space && this.space.compounds.add(a), null != this.space && this.space.freshInteractorType(a);
  35715. this.space =
  35716. this.compound = null
  35717. },
  35718. removedFromSpace: function () {
  35719. this.__iremovedFromSpace()
  35720. },
  35721. addedToSpace: function () {
  35722. this.__iaddedToSpace()
  35723. },
  35724. __imutable_midstep: function (a) {
  35725. if (null != this.space && this.space.midstep) throw "Error: " + a + " cannot be set during space step()";
  35726. },
  35727. __class__: c.phys.ZPP_Compound
  35728. });
  35729. c.phys.ZPP_FluidProperties = function () {
  35730. this.wrap_gravity = null;
  35731. this.viscosity = this.density = this.gravityx = this.gravityy = 0;
  35732. this.next = this.userData = this.outer = this.shapes = this.wrap_shapes = null;
  35733. this.shapes = new c.util.ZNPList_ZPP_Shape;
  35734. this.density = this.viscosity = 1;
  35735. this.wrap_gravity = null;
  35736. this.gravityy = this.gravityx = 0
  35737. };
  35738. s["zpp_nape.phys.ZPP_FluidProperties"] = c.phys.ZPP_FluidProperties;
  35739. c.phys.ZPP_FluidProperties.__name__ = ["zpp_nape", "phys", "ZPP_FluidProperties"];
  35740. c.phys.ZPP_FluidProperties.prototype = {
  35741. invalidate: function () {
  35742. for (var a = this.shapes.head; null != a;) a.elt.invalidate_fluidprops(), a = a.next
  35743. },
  35744. getgravity: function () {
  35745. this.wrap_gravity = h.geom.Vec2.get(this.gravityx, this.gravityy, null);
  35746. this.wrap_gravity.zpp_inner._inuse = !0;
  35747. this.wrap_gravity.zpp_inner._invalidate =
  35748. A(this, this.gravity_invalidate);
  35749. this.wrap_gravity.zpp_inner._validate = A(this, this.gravity_validate)
  35750. },
  35751. gravity_validate: function () {
  35752. this.wrap_gravity.zpp_inner.x = this.gravityx;
  35753. this.wrap_gravity.zpp_inner.y = this.gravityy
  35754. },
  35755. gravity_invalidate: function (a) {
  35756. this.gravityx = a.x;
  35757. this.gravityy = a.y;
  35758. this.invalidate()
  35759. },
  35760. copy: function () {
  35761. var a;
  35762. null == c.phys.ZPP_FluidProperties.zpp_pool ? a = new c.phys.ZPP_FluidProperties : (a = c.phys.ZPP_FluidProperties.zpp_pool, c.phys.ZPP_FluidProperties.zpp_pool = a.next, a.next = null);
  35763. null;
  35764. a.viscosity = this.viscosity;
  35765. a.density = this.density;
  35766. return a
  35767. },
  35768. remShape: function (a) {
  35769. this.shapes.remove(a)
  35770. },
  35771. addShape: function (a) {
  35772. this.shapes.add(a)
  35773. },
  35774. feature_cons: function () {
  35775. this.shapes = new c.util.ZNPList_ZPP_Shape
  35776. },
  35777. alloc: function () {},
  35778. free: function () {
  35779. this.outer = null
  35780. },
  35781. wrapper: function () {
  35782. if (null == this.outer) {
  35783. this.outer = new h.phys.FluidProperties;
  35784. var a = this.outer.zpp_inner;
  35785. a.outer = null;
  35786. a.next = c.phys.ZPP_FluidProperties.zpp_pool;
  35787. c.phys.ZPP_FluidProperties.zpp_pool = a;
  35788. this.outer.zpp_inner = this
  35789. }
  35790. return this.outer
  35791. },
  35792. __class__: c.phys.ZPP_FluidProperties
  35793. };
  35794. c.phys.ZPP_Material = function () {
  35795. this.dynamicFriction = this.staticFriction = this.density = this.elasticity = this.rollingFriction = 0;
  35796. this.next = this.userData = this.outer = this.shapes = this.wrap_shapes = null;
  35797. this.shapes = new c.util.ZNPList_ZPP_Shape;
  35798. this.elasticity = 0;
  35799. this.dynamicFriction = 1;
  35800. this.staticFriction = 2;
  35801. this.density = 0.001;
  35802. this.rollingFriction = 0.01
  35803. };
  35804. s["zpp_nape.phys.ZPP_Material"] = c.phys.ZPP_Material;
  35805. c.phys.ZPP_Material.__name__ = ["zpp_nape", "phys", "ZPP_Material"];
  35806. c.phys.ZPP_Material.prototype = {
  35807. invalidate: function (a) {
  35808. for (var b = this.shapes.head; null != b;) b.elt.invalidate_material(a), b = b.next
  35809. },
  35810. set: function (a) {
  35811. this.dynamicFriction = a.dynamicFriction;
  35812. this.staticFriction = a.staticFriction;
  35813. this.density = a.density;
  35814. this.elasticity = a.elasticity;
  35815. this.rollingFriction = a.rollingFriction
  35816. },
  35817. copy: function () {
  35818. var a = new c.phys.ZPP_Material;
  35819. a.dynamicFriction = this.dynamicFriction;
  35820. a.staticFriction = this.staticFriction;
  35821. a.density = this.density;
  35822. a.elasticity = this.elasticity;
  35823. a.rollingFriction = this.rollingFriction;
  35824. return a
  35825. },
  35826. remShape: function (a) {
  35827. this.shapes.remove(a)
  35828. },
  35829. addShape: function (a) {
  35830. this.shapes.add(a)
  35831. },
  35832. feature_cons: function () {
  35833. this.shapes = new c.util.ZNPList_ZPP_Shape
  35834. },
  35835. alloc: function () {},
  35836. free: function () {
  35837. this.outer = null
  35838. },
  35839. wrapper: function () {
  35840. if (null == this.outer) {
  35841. this.outer = new h.phys.Material;
  35842. var a = this.outer.zpp_inner;
  35843. a.outer = null;
  35844. a.next = c.phys.ZPP_Material.zpp_pool;
  35845. c.phys.ZPP_Material.zpp_pool = a;
  35846. this.outer.zpp_inner = this
  35847. }
  35848. return this.outer
  35849. },
  35850. __class__: c.phys.ZPP_Material
  35851. };
  35852. c.shape = {};
  35853. c.shape.ZPP_Shape = function (a) {
  35854. this.zip_aabb = !1;
  35855. this.sweep = this.node = this.pairs = this.aabb = null;
  35856. this.fluidEnabled = this.sensorEnabled = !1;
  35857. this.circle = this.polygon = this.refmaterial = this.material = this.filter = this.fluidProperties = null;
  35858. this.sweepCoef = 0;
  35859. this.zip_sweepRadius = !1;
  35860. this.sweepRadius = 0;
  35861. this.wrap_localCOM = this.wrap_worldCOM = null;
  35862. this.zip_worldCOM = !1;
  35863. this.worldCOMx = this.worldCOMy = 0;
  35864. this.zip_localCOM = !1;
  35865. this.localCOMx = this.localCOMy = 0;
  35866. this.zip_angDrag = !1;
  35867. this.inertia = this.angDrag = 0;
  35868. this.zip_area_inertia = !1;
  35869. this.type = this.area = 0;
  35870. this.outer = this.body =
  35871. null;
  35872. c.phys.ZPP_Interactor.call(this);
  35873. this.pairs = new c.util.ZNPList_ZPP_AABBPair;
  35874. this.ishape = this;
  35875. this.type = a;
  35876. this.aabb = c.geom.ZPP_AABB.get(0, 0, 0, 0);
  35877. this.aabb._immutable = !0;
  35878. this.aabb._validate = A(this, this.aabb_validate);
  35879. this.zip_area_inertia = this.zip_angDrag = this.zip_localCOM = this.zip_sweepRadius = !0;
  35880. this.worldCOMy = this.worldCOMx = this.localCOMy = this.localCOMx = 0;
  35881. this.sensorEnabled = this.fluidEnabled = !1;
  35882. this.body = this.fluidProperties = null;
  35883. this.refmaterial = new c.phys.ZPP_Material;
  35884. this.sweepRadius = this.sweepCoef =
  35885. 0
  35886. };
  35887. s["zpp_nape.shape.ZPP_Shape"] = c.shape.ZPP_Shape;
  35888. c.shape.ZPP_Shape.__name__ = ["zpp_nape", "shape", "ZPP_Shape"];
  35889. c.shape.ZPP_Shape.__super__ = c.phys.ZPP_Interactor;
  35890. c.shape.ZPP_Shape.prototype = I(c.phys.ZPP_Interactor.prototype, {
  35891. copy: function () {
  35892. var a = null,
  35893. a = this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__copy() : this.polygon.__copy();
  35894. this.zip_area_inertia ? a.invalidate_area_inertia() : (a.area = this.area, a.inertia = this.inertia);
  35895. this.zip_sweepRadius ? a.zip_sweepRadius = !0 : (a.sweepRadius = this.sweepRadius,
  35896. a.sweepCoef = this.sweepCoef);
  35897. this.zip_angDrag ? a.invalidate_angDrag() : a.angDrag = this.angDrag;
  35898. this.zip_aabb ? (a.zip_aabb = !0, null != a.body && (a.body.zip_aabb = !0)) : (a.aabb.minx = this.aabb.minx, a.aabb.miny = this.aabb.miny, a.aabb.maxx = this.aabb.maxx, a.aabb.maxy = this.aabb.maxy);
  35899. var b = a.material;
  35900. b.outer = null;
  35901. b.next = c.phys.ZPP_Material.zpp_pool;
  35902. c.phys.ZPP_Material.zpp_pool = b;
  35903. b = a.filter;
  35904. b.outer = null;
  35905. b.next = c.dynamics.ZPP_InteractionFilter.zpp_pool;
  35906. c.dynamics.ZPP_InteractionFilter.zpp_pool = b;
  35907. a.material = this.material;
  35908. a.filter = this.filter;
  35909. null != this.fluidProperties && (a.fluidProperties = this.fluidProperties);
  35910. a.fluidEnabled = this.fluidEnabled;
  35911. a.sensorEnabled = this.sensorEnabled;
  35912. null != this.userData && (a.userData = W.copy(this.userData));
  35913. this.copyto(a.outer);
  35914. return a.outer
  35915. },
  35916. removedFromSpace: function () {
  35917. this.__iremovedFromSpace();
  35918. this.material.shapes.remove(this);
  35919. this.filter.shapes.remove(this);
  35920. null != this.fluidProperties && this.fluidProperties.shapes.remove(this)
  35921. },
  35922. addedToSpace: function () {
  35923. this.__iaddedToSpace();
  35924. this.material.shapes.add(this);
  35925. this.filter.shapes.add(this);
  35926. null != this.fluidProperties && this.fluidProperties.shapes.add(this)
  35927. },
  35928. removedFromBody: function () {},
  35929. addedToBody: function () {
  35930. this.invalidate_worldCOM();
  35931. this.zip_aabb = !0;
  35932. null != this.body && (this.body.zip_aabb = !0)
  35933. },
  35934. __immutable_midstep: function (a) {
  35935. if (null != this.body && null != this.body.space && this.body.space.midstep) throw "Error: " + a + " cannot be set during a space step()";
  35936. },
  35937. setFluid: function (a) {
  35938. this.fluidProperties != a && (null != this.body && null != this.body.space && null != this.fluidProperties &&
  35939. this.fluidProperties.shapes.remove(this), this.fluidProperties = a, null != this.body && null != this.body.space && a.shapes.add(this), this.fluidEnabled && this.wake())
  35940. },
  35941. setFilter: function (a) {
  35942. this.filter != a && (null != this.body && null != this.body.space && null != this.filter && this.filter.shapes.remove(this), this.filter = a, null != this.body && null != this.body.space && a.shapes.add(this), this.wake())
  35943. },
  35944. setMaterial: function (a) {
  35945. this.material != a && (null != this.body && null != this.body.space && null != this.material && this.material.shapes.remove(this),
  35946. this.material = a, null != this.body && null != this.body.space && a.shapes.add(this), this.wake(), null != this.body && this.body.refreshArbiters())
  35947. },
  35948. aabb_validate: function () {
  35949. if (null == this.body) throw "Error: bounds only makes sense when Shape belongs to a Body";
  35950. this.zip_aabb && null != this.body && (this.zip_aabb = !1, this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__validate_aabb() : this.polygon.__validate_aabb())
  35951. },
  35952. invalidate_fluidprops: function () {
  35953. this.fluidEnabled && this.wake()
  35954. },
  35955. invalidate_filter: function () {
  35956. this.wake()
  35957. },
  35958. invalidate_material: function (a) {
  35959. 0 != (a & c.phys.ZPP_Material.WAKE) && this.wake();
  35960. 0 != (a & c.phys.ZPP_Material.ARBITERS) && null != this.body && this.body.refreshArbiters();
  35961. 0 != (a & c.phys.ZPP_Material.PROPS) && null != this.body && (this.body.invalidate_localCOM(), this.body.invalidate_mass(), this.body.invalidate_inertia());
  35962. 0 != (a & c.phys.ZPP_Material.ANGDRAG) && this.invalidate_angDrag();
  35963. this.refmaterial.set(this.material)
  35964. },
  35965. invalidate_worldCOM: function () {
  35966. this.zip_aabb = this.zip_worldCOM = !0;
  35967. null != this.body && (this.body.zip_aabb = !0)
  35968. },
  35969. invalidate_localCOM: function () {
  35970. this.zip_localCOM = !0;
  35971. this.invalidate_area_inertia();
  35972. this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE && (this.zip_sweepRadius = !0);
  35973. this.invalidate_angDrag();
  35974. this.invalidate_worldCOM();
  35975. null != this.body && this.body.invalidate_localCOM()
  35976. },
  35977. invalidate_angDrag: function () {
  35978. this.zip_angDrag = !0
  35979. },
  35980. invalidate_area_inertia: function () {
  35981. this.zip_area_inertia = !0;
  35982. null != this.body && (this.body.invalidate_localCOM(), this.body.invalidate_mass(), this.body.invalidate_inertia())
  35983. },
  35984. getworldCOM: function () {
  35985. if (null ==
  35986. this.body) throw "Error: worldCOM only makes sense when Shape belongs to a Body";
  35987. this.zip_worldCOM && null != this.body && (this.zip_worldCOM = !1, this.zip_localCOM && (this.zip_localCOM = !1, this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && this.polygon.__validate_localCOM(), null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x = this.localCOMx, this.wrap_localCOM.zpp_inner.y = this.localCOMy)), this.body.validate_axis(), this.worldCOMx = this.body.posx + (this.body.axisy * this.localCOMx - this.body.axisx * this.localCOMy),
  35988. this.worldCOMy = this.body.posy + (this.localCOMx * this.body.axisx + this.localCOMy * this.body.axisy));
  35989. this.wrap_worldCOM.zpp_inner.x = this.worldCOMx;
  35990. this.wrap_worldCOM.zpp_inner.y = this.worldCOMy
  35991. },
  35992. validate_worldCOM: function () {
  35993. this.zip_worldCOM && null != this.body && (this.zip_worldCOM = !1, this.zip_localCOM && (this.zip_localCOM = !1, this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && this.polygon.__validate_localCOM(), null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x = this.localCOMx, this.wrap_localCOM.zpp_inner.y =
  35994. this.localCOMy)), this.body.validate_axis(), this.worldCOMx = this.body.posx + (this.body.axisy * this.localCOMx - this.body.axisx * this.localCOMy), this.worldCOMy = this.body.posy + (this.localCOMx * this.body.axisx + this.localCOMy * this.body.axisy))
  35995. },
  35996. validate_localCOM: function () {
  35997. this.zip_localCOM && (this.zip_localCOM = !1, this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && this.polygon.__validate_localCOM(), null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x = this.localCOMx, this.wrap_localCOM.zpp_inner.y = this.localCOMy))
  35998. },
  35999. validate_angDrag: function () {
  36000. if (this.zip_angDrag || this.refmaterial.dynamicFriction != this.material.dynamicFriction) this.zip_angDrag = !1, this.refmaterial.dynamicFriction = this.material.dynamicFriction, this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__validate_angDrag() : this.polygon.__validate_angDrag()
  36001. },
  36002. validate_area_inertia: function () {
  36003. this.zip_area_inertia && (this.zip_area_inertia = !1, this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__validate_area_inertia() : this.polygon.__validate_area_inertia())
  36004. },
  36005. invalidate_aabb: function () {
  36006. this.zip_aabb = !0;
  36007. null != this.body && (this.body.zip_aabb = !0)
  36008. },
  36009. force_validate_aabb: function () {
  36010. this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle._force_validate_aabb() : this.polygon._force_validate_aabb()
  36011. },
  36012. validate_aabb: function () {
  36013. this.zip_aabb && null != this.body && (this.zip_aabb = !1, this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__validate_aabb() : this.polygon.__validate_aabb())
  36014. },
  36015. clear: function () {
  36016. this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__clear() :
  36017. this.polygon.__clear()
  36018. },
  36019. validate_sweepRadius: function () {
  36020. this.zip_sweepRadius && (this.zip_sweepRadius = !1, this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__validate_sweepRadius() : this.polygon.__validate_sweepRadius())
  36021. },
  36022. invalidate_sweepRadius: function () {
  36023. this.zip_sweepRadius = !0
  36024. },
  36025. isPolygon: function () {
  36026. return this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON
  36027. },
  36028. isCircle: function () {
  36029. return this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE
  36030. },
  36031. __class__: c.shape.ZPP_Shape
  36032. });
  36033. c.shape.ZPP_Circle = function () {
  36034. this.radius =
  36035. 0;
  36036. this.outer_zn = null;
  36037. c.shape.ZPP_Shape.call(this, c.util.ZPP_Flags.id_ShapeType_CIRCLE);
  36038. this.circle = this;
  36039. this.zip_localCOM = !1
  36040. };
  36041. s["zpp_nape.shape.ZPP_Circle"] = c.shape.ZPP_Circle;
  36042. c.shape.ZPP_Circle.__name__ = ["zpp_nape", "shape", "ZPP_Circle"];
  36043. c.shape.ZPP_Circle.__super__ = c.shape.ZPP_Shape;
  36044. c.shape.ZPP_Circle.prototype = I(c.shape.ZPP_Shape.prototype, {
  36045. __copy: function () {
  36046. var a = (new h.shape.Circle(this.radius)).zpp_inner_zn;
  36047. a.localCOMx = this.localCOMx;
  36048. a.localCOMy = this.localCOMy;
  36049. a.zip_localCOM = !1;
  36050. return a
  36051. },
  36052. __transform: function (a) {
  36053. var b =
  36054. a.zpp_inner.a * a.zpp_inner.d - a.zpp_inner.b * a.zpp_inner.c;
  36055. 0 > b && (b = -b);
  36056. this.radius *= Math.sqrt(b);
  36057. b = a.zpp_inner.a * this.localCOMx + a.zpp_inner.b * this.localCOMy + a.zpp_inner.tx;
  36058. this.localCOMy = a.zpp_inner.c * this.localCOMx + a.zpp_inner.d * this.localCOMy + a.zpp_inner.ty;
  36059. this.localCOMx = b;
  36060. this.invalidate_radius();
  36061. this.invalidate_localCOM()
  36062. },
  36063. __rotate: function (a, b) {
  36064. if (0 < this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy) {
  36065. var d = 0,
  36066. c = 0,
  36067. d = b * this.localCOMx - a * this.localCOMy,
  36068. c = this.localCOMx * a + this.localCOMy * b;
  36069. this.localCOMx =
  36070. d;
  36071. this.localCOMy = c;
  36072. this.invalidate_localCOM()
  36073. }
  36074. },
  36075. __translate: function (a, b) {
  36076. this.localCOMx += 1 * a;
  36077. this.localCOMy += 1 * b;
  36078. this.invalidate_localCOM()
  36079. },
  36080. __scale: function (a, b) {
  36081. var d = ((0 > a ? -a : a) + (0 > b ? -b : b)) / 2;
  36082. this.radius *= 0 > d ? -d : d;
  36083. this.invalidate_radius();
  36084. 0 < this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy && (this.localCOMx *= a, this.localCOMy *= b, this.invalidate_localCOM())
  36085. },
  36086. __validate_angDrag: function () {
  36087. var a = this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy,
  36088. b = this.radius * this.radius;
  36089. this.angDrag =
  36090. (a + 2 * b) * this.material.dynamicFriction * h.Config.fluidAngularDragFriction + 0.5 * h.Config.fluidAngularDrag * (1 + h.Config.fluidVacuumDrag) * a;
  36091. this.angDrag /= 2 * (a + 0.5 * b)
  36092. },
  36093. __validate_area_inertia: function () {
  36094. var a = this.radius * this.radius;
  36095. this.area = a * Math.PI;
  36096. this.inertia = 0.5 * a + (this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy)
  36097. },
  36098. __validate_sweepRadius: function () {
  36099. this.sweepCoef = Math.sqrt(this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy);
  36100. this.sweepRadius = this.sweepCoef + this.radius
  36101. },
  36102. _force_validate_aabb: function () {
  36103. this.worldCOMx =
  36104. this.body.posx + (this.body.axisy * this.localCOMx - this.body.axisx * this.localCOMy);
  36105. this.worldCOMy = this.body.posy + (this.localCOMx * this.body.axisx + this.localCOMy * this.body.axisy);
  36106. this.aabb.minx = this.worldCOMx - this.radius;
  36107. this.aabb.miny = this.worldCOMy - this.radius;
  36108. this.aabb.maxx = this.worldCOMx + this.radius;
  36109. this.aabb.maxy = this.worldCOMy + this.radius
  36110. },
  36111. __validate_aabb: function () {
  36112. this.zip_worldCOM && null != this.body && (this.zip_worldCOM = !1, this.zip_localCOM && (this.zip_localCOM = !1, this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON &&
  36113. this.polygon.__validate_localCOM(), null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x = this.localCOMx, this.wrap_localCOM.zpp_inner.y = this.localCOMy)), this.body.validate_axis(), this.worldCOMx = this.body.posx + (this.body.axisy * this.localCOMx - this.body.axisx * this.localCOMy), this.worldCOMy = this.body.posy + (this.localCOMx * this.body.axisx + this.localCOMy * this.body.axisy));
  36114. var a = this.radius,
  36115. b = this.radius;
  36116. this.aabb.minx = this.worldCOMx - a;
  36117. this.aabb.miny = this.worldCOMy - b;
  36118. this.aabb.maxx = this.worldCOMx + a;
  36119. this.aabb.maxy =
  36120. this.worldCOMy + b
  36121. },
  36122. setupLocalCOM: function () {
  36123. this.wrap_localCOM = h.geom.Vec2.get(this.localCOMx, this.localCOMy, null);
  36124. this.wrap_localCOM.zpp_inner._inuse = !0;
  36125. this.wrap_localCOM.zpp_inner._validate = A(this, this.localCOM_validate);
  36126. this.wrap_localCOM.zpp_inner._invalidate = A(this, this.localCOM_invalidate);
  36127. this.wrap_localCOM.zpp_inner._isimmutable = A(this, this.localCOM_immutable)
  36128. },
  36129. localCOM_immutable: function () {
  36130. if (null != this.body && this.body.type == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.body.space) throw "Error: Cannot modify localCOM of Circle added to a static Body whilst within a Space";
  36131. },
  36132. localCOM_invalidate: function (a) {
  36133. this.localCOMx = a.x;
  36134. this.localCOMy = a.y;
  36135. this.invalidate_localCOM();
  36136. null != this.body && this.body.wake()
  36137. },
  36138. localCOM_validate: function () {
  36139. this.wrap_localCOM.zpp_inner.x = this.localCOMx;
  36140. this.wrap_localCOM.zpp_inner.y = this.localCOMy
  36141. },
  36142. invalidate_radius: function () {
  36143. this.invalidate_area_inertia();
  36144. this.invalidate_angDrag();
  36145. this.zip_aabb = !0;
  36146. null != this.body && (this.body.zip_aabb = !0);
  36147. null != this.body && this.body.wake()
  36148. },
  36149. __clear: function () {},
  36150. __class__: c.shape.ZPP_Circle
  36151. });
  36152. c.shape.ZPP_Edge =
  36153. function () {
  36154. this.tp0 = this.tp1 = 0;
  36155. this.lp0 = this.gp0 = this.lp1 = this.gp1 = null;
  36156. this.length = this.lprojection = this.gprojection = 0;
  36157. this.wrap_gnorm = null;
  36158. this.gnormx = this.gnormy = 0;
  36159. this.wrap_lnorm = null;
  36160. this.lnormx = this.lnormy = 0;
  36161. this.next = this.polygon = this.outer = null;
  36162. this.gprojection = this.lprojection = this.length = this.gnormy = this.gnormx = this.lnormy = this.lnormx = 0
  36163. };
  36164. s["zpp_nape.shape.ZPP_Edge"] = c.shape.ZPP_Edge;
  36165. c.shape.ZPP_Edge.__name__ = ["zpp_nape", "shape", "ZPP_Edge"];
  36166. c.shape.ZPP_Edge.prototype = {
  36167. getgnorm: function () {
  36168. this.wrap_gnorm =
  36169. h.geom.Vec2.get(this.gnormx, this.gnormy, null);
  36170. this.wrap_gnorm.zpp_inner._immutable = !0;
  36171. this.wrap_gnorm.zpp_inner._validate = A(this, this.gnorm_validate)
  36172. },
  36173. getlnorm: function () {
  36174. this.wrap_lnorm = h.geom.Vec2.get(this.lnormx, this.lnormy, null);
  36175. this.wrap_lnorm.zpp_inner._immutable = !0;
  36176. this.wrap_lnorm.zpp_inner._validate = A(this, this.lnorm_validate)
  36177. },
  36178. gnorm_validate: function () {
  36179. if (null == this.polygon) throw "Error: Edge not currently in use";
  36180. if (null == this.polygon.body) throw "Error: Edge worldNormal only makes sense if the parent Polygon is contained within a rigid body";
  36181. this.polygon.validate_gaxi();
  36182. this.wrap_gnorm.zpp_inner.x = this.gnormx;
  36183. this.wrap_gnorm.zpp_inner.y = this.gnormy
  36184. },
  36185. lnorm_validate: function () {
  36186. if (null == this.polygon) throw "Error: Edge not currently in use";
  36187. this.polygon.validate_laxi();
  36188. this.wrap_lnorm.zpp_inner.x = this.lnormx;
  36189. this.wrap_lnorm.zpp_inner.y = this.lnormy
  36190. },
  36191. wrapper: function () {
  36192. null == this.outer && (c.shape.ZPP_Edge.internal = !0, this.outer = new h.shape.Edge, c.shape.ZPP_Edge.internal = !1, this.outer.zpp_inner = this);
  36193. return this.outer
  36194. },
  36195. alloc: function () {},
  36196. free: function () {
  36197. this.polygon =
  36198. null
  36199. },
  36200. __class__: c.shape.ZPP_Edge
  36201. };
  36202. c.shape.ZPP_Polygon = function () {
  36203. this.reverse_flag = this.zip_lverts = this.zip_laxi = this.zip_gverts = this.zip_gaxi = this.zip_valid = this.zip_sanitation = !1;
  36204. this.edgeCnt = 0;
  36205. this.outer_zn = this.lverts = this.wrap_lverts = this.gverts = this.wrap_gverts = this.edges = this.wrap_edges = null;
  36206. c.shape.ZPP_Shape.call(this, c.util.ZPP_Flags.id_ShapeType_POLYGON);
  36207. this.polygon = this;
  36208. this.lverts = new c.geom.ZPP_Vec2;
  36209. this.gverts = new c.geom.ZPP_Vec2;
  36210. this.edges = new c.util.ZNPList_ZPP_Edge;
  36211. this.edgeCnt =
  36212. 0
  36213. };
  36214. s["zpp_nape.shape.ZPP_Polygon"] = c.shape.ZPP_Polygon;
  36215. c.shape.ZPP_Polygon.__name__ = ["zpp_nape", "shape", "ZPP_Polygon"];
  36216. c.shape.ZPP_Polygon.__super__ = c.shape.ZPP_Shape;
  36217. c.shape.ZPP_Polygon.prototype = I(c.shape.ZPP_Shape.prototype, {
  36218. __copy: function () {
  36219. return (new h.shape.Polygon(this.outer_zn.get_localVerts())).zpp_inner_zn
  36220. },
  36221. __transform: function (a) {
  36222. for (var b = this.lverts.next; null != b;) {
  36223. var d = b,
  36224. c = a.zpp_inner.a * d.x + a.zpp_inner.b * d.y + a.zpp_inner.tx;
  36225. d.y = a.zpp_inner.c * d.x + a.zpp_inner.d * d.y + a.zpp_inner.ty;
  36226. d.x =
  36227. c;
  36228. b = b.next
  36229. }
  36230. this.invalidate_lverts()
  36231. },
  36232. __rotate: function (a, b) {
  36233. for (var d = this.lverts.next; null != d;) {
  36234. var c = d,
  36235. e = 0,
  36236. f = 0,
  36237. e = b * c.x - a * c.y,
  36238. f = c.x * a + c.y * b;
  36239. c.x = e;
  36240. c.y = f;
  36241. d = d.next
  36242. }
  36243. this.invalidate_lverts()
  36244. },
  36245. __scale: function (a, b) {
  36246. for (var d = this.lverts.next; null != d;) {
  36247. var c = d;
  36248. c.x *= a;
  36249. c.y *= b;
  36250. d = d.next
  36251. }
  36252. this.invalidate_lverts()
  36253. },
  36254. __translate: function (a, b) {
  36255. for (var d = this.lverts.next; null != d;) {
  36256. var c = d;
  36257. c.x += 1 * a;
  36258. c.y += 1 * b;
  36259. d = d.next
  36260. }
  36261. this.invalidate_lverts()
  36262. },
  36263. setupLocalCOM: function () {
  36264. this.wrap_localCOM = h.geom.Vec2.get(this.localCOMx,
  36265. this.localCOMy, null);
  36266. this.wrap_localCOM.zpp_inner._inuse = !0;
  36267. this.wrap_localCOM.zpp_inner._validate = A(this, this.localCOM_validate);
  36268. this.wrap_localCOM.zpp_inner._invalidate = A(this, this.localCOM_invalidate)
  36269. },
  36270. localCOM_invalidate: function (a) {
  36271. this.zip_localCOM && (this.zip_localCOM = !1, this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && this.polygon.__validate_localCOM(), null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x = this.localCOMx, this.wrap_localCOM.zpp_inner.y = this.localCOMy));
  36272. var b = 0,
  36273. d = 0,
  36274. b = a.x -
  36275. this.localCOMx,
  36276. d = a.y - this.localCOMy;
  36277. for (a = this.lverts.next; null != a;) {
  36278. var g = a;
  36279. g.x += 1 * b;
  36280. g.y += 1 * d;
  36281. a = a.next
  36282. }
  36283. this.invalidate_lverts()
  36284. },
  36285. localCOM_validate: function () {
  36286. if (null == this.lverts.next) throw "Error: An empty polygon does not have any meaningful localCOM";
  36287. this.zip_localCOM && (this.zip_localCOM = !1, this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && this.polygon.__validate_localCOM(), null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x = this.localCOMx, this.wrap_localCOM.zpp_inner.y = this.localCOMy))
  36288. },
  36289. __validate_localCOM: function () {
  36290. if (null == this.lverts.next) throw "Error: An empty polygon has no meaningful localCOM";
  36291. if (null == this.lverts.next.next) this.localCOMx = this.lverts.next.x, this.localCOMy = this.lverts.next.y;
  36292. else {
  36293. if (null == this.lverts.next.next.next) {
  36294. this.localCOMx = this.lverts.next.x;
  36295. this.localCOMy = this.lverts.next.y;
  36296. var a = 1;
  36297. this.localCOMx += this.lverts.next.next.x * a;
  36298. this.localCOMy += this.lverts.next.next.y * a;
  36299. a = 0.5
  36300. } else {
  36301. for (var a = this.localCOMy = this.localCOMx = 0, b = this.lverts.next, d = b, c = b = b.next,
  36302. b = b.next; null != b;) {
  36303. var e = b,
  36304. a = a + c.x * (e.y - d.y),
  36305. d = e.y * c.x - e.x * c.y;
  36306. this.localCOMx += (c.x + e.x) * d;
  36307. this.localCOMy += (c.y + e.y) * d;
  36308. d = c;
  36309. c = e;
  36310. b = b.next
  36311. }
  36312. e = b = this.lverts.next;
  36313. a += c.x * (e.y - d.y);
  36314. d = e.y * c.x - e.x * c.y;
  36315. this.localCOMx += (c.x + e.x) * d;
  36316. this.localCOMy += (c.y + e.y) * d;
  36317. d = c;
  36318. c = e;
  36319. b = b.next;
  36320. a += c.x * (b.y - d.y);
  36321. d = b.y * c.x - b.x * c.y;
  36322. this.localCOMx += (c.x + b.x) * d;
  36323. this.localCOMy += (c.y + b.y) * d;
  36324. a = 1 / (3 * a)
  36325. }
  36326. this.localCOMx *= a;
  36327. this.localCOMy *= a
  36328. }
  36329. },
  36330. __validate_angDrag: function () {
  36331. if (3 > this.lverts.length) throw "Error: Polygon's with less than 3 vertices have no meaningful angDrag";
  36332. this.validate_area_inertia();
  36333. this.validate_laxi();
  36334. for (var a = 0, b = this.edges.head, d = 0, c = this.lverts.next, e = c, c = c.next; null != c;) {
  36335. var f = c,
  36336. l = b.elt,
  36337. b = b.next,
  36338. d = d + l.length,
  36339. m = 0,
  36340. k = 0,
  36341. m = f.x - e.x,
  36342. k = f.y - e.y,
  36343. a = a + l.length * h.Config.fluidAngularDragFriction * this.material.dynamicFriction * l.lprojection * l.lprojection,
  36344. p = -(e.y * l.lnormx - e.x * l.lnormy) / (k * l.lnormx - m * l.lnormy);
  36345. if (0 < p) var n = 1 < p ? 1 : p,
  36346. r = 0,
  36347. q = 0,
  36348. r = e.x,
  36349. q = e.y,
  36350. w = n,
  36351. r = r + m * w,
  36352. q = q + k * w,
  36353. t = l.lnormy * e.x - l.lnormx * e.y,
  36354. r = l.lnormy * r - l.lnormx * q,
  36355. t = (r * r * r - t * t * t) / (3 * (r - t)),
  36356. a = a + t * n * l.length *
  36357. h.Config.fluidAngularDrag;
  36358. 1 > p && (p = 0 > p ? 0 : p, r = e.x, q = e.y, w = p, r += m * w, q += k * w, t = l.lnormy * r - l.lnormx * q, r = l.lnormy * f.x - l.lnormx * f.y, t = (r * r * r - t * t * t) / (3 * (r - t)), a += t * h.Config.fluidVacuumDrag * (1 - p) * l.length * h.Config.fluidAngularDrag);
  36359. e = f;
  36360. c = c.next
  36361. }
  36362. f = c = this.lverts.next;
  36363. l = b.elt;
  36364. d += l.length;
  36365. m = f.x - e.x;
  36366. k = f.y - e.y;
  36367. a += l.length * h.Config.fluidAngularDragFriction * this.material.dynamicFriction * l.lprojection * l.lprojection;
  36368. p = -(e.y * l.lnormx - e.x * l.lnormy) / (k * l.lnormx - m * l.lnormy);
  36369. 0 < p && (n = 1 < p ? 1 : p, r = e.x, q = e.y, w = n, t = l.lnormy * e.x -
  36370. l.lnormx * e.y, r = l.lnormy * (r + m * w) - l.lnormx * (q + k * w), a += (r * r * r - t * t * t) / (3 * (r - t)) * n * l.length * h.Config.fluidAngularDrag);
  36371. 1 > p && (p = 0 > p ? 0 : p, r = e.x, q = e.y, w = p, r += m * w, q += k * w, t = l.lnormy * r - l.lnormx * q, r = l.lnormy * f.x - l.lnormx * f.y, a += (r * r * r - t * t * t) / (3 * (r - t)) * h.Config.fluidVacuumDrag * (1 - p) * l.length * h.Config.fluidAngularDrag);
  36372. this.angDrag = a / (this.inertia * d)
  36373. },
  36374. __validate_area_inertia: function () {
  36375. if (null == this.lverts.next || null == this.lverts.next.next || null == this.lverts.next.next.next) this.inertia = this.area = 0;
  36376. else {
  36377. for (var a =
  36378. this.area = 0, b = 0, d = this.lverts.next, c = d, e = d = d.next, d = d.next; null != d;) {
  36379. var f = d,
  36380. l = e.y * c.x - e.x * c.y,
  36381. h = e.x * e.x + e.y * e.y + (e.x * c.x + e.y * c.y) + (c.x * c.x + c.y * c.y),
  36382. a = a + l * h,
  36383. b = b + l;
  36384. this.area += e.x * (f.y - c.y);
  36385. c = e;
  36386. e = f;
  36387. d = d.next
  36388. }
  36389. f = d = this.lverts.next;
  36390. l = e.y * c.x - e.x * c.y;
  36391. h = e.x * e.x + e.y * e.y + (e.x * c.x + e.y * c.y) + (c.x * c.x + c.y * c.y);
  36392. a += l * h;
  36393. b += l;
  36394. this.area += e.x * (f.y - c.y);
  36395. c = e;
  36396. e = f;
  36397. d = d.next;
  36398. l = e.y * c.x - e.x * c.y;
  36399. h = e.x * e.x + e.y * e.y + (e.x * c.x + e.y * c.y) + (c.x * c.x + c.y * c.y);
  36400. this.area += e.x * (d.y - c.y);
  36401. this.inertia = (a + l * h) / (6 * (b + l));
  36402. this.area *= 0.5;
  36403. 0 > this.area &&
  36404. (this.area = -this.area, this.reverse_vertices())
  36405. }
  36406. },
  36407. __validate_sweepRadius: function () {
  36408. var a = 0,
  36409. b = 0;
  36410. this.validate_laxi();
  36411. for (var d = this.lverts.next; null != d;) {
  36412. var c = d,
  36413. c = c.x * c.x + c.y * c.y;
  36414. c > a && (a = c);
  36415. d = d.next
  36416. }
  36417. for (d = this.edges.head; null != d;) {
  36418. c = d.elt;
  36419. if (c.lprojection < b && (b = c.lprojection, 0 > b)) break;
  36420. d = d.next
  36421. }
  36422. 0 > b && (b = 0);
  36423. this.sweepRadius = Math.sqrt(a);
  36424. this.sweepCoef = this.sweepRadius - b
  36425. },
  36426. _force_validate_aabb: function () {
  36427. var a = this.lverts.next,
  36428. b = this.gverts.next,
  36429. d = a,
  36430. a = a.next;
  36431. b.x = this.body.posx + (this.body.axisy * d.x - this.body.axisx *
  36432. d.y);
  36433. b.y = this.body.posy + (d.x * this.body.axisx + d.y * this.body.axisy);
  36434. this.aabb.minx = b.x;
  36435. this.aabb.miny = b.y;
  36436. this.aabb.maxx = b.x;
  36437. this.aabb.maxy = b.y;
  36438. for (b = this.gverts.next.next; null != b;) {
  36439. var d = b,
  36440. c = a,
  36441. a = a.next;
  36442. d.x = this.body.posx + (this.body.axisy * c.x - this.body.axisx * c.y);
  36443. d.y = this.body.posy + (c.x * this.body.axisx + c.y * this.body.axisy);
  36444. d.x < this.aabb.minx && (this.aabb.minx = d.x);
  36445. d.x > this.aabb.maxx && (this.aabb.maxx = d.x);
  36446. d.y < this.aabb.miny && (this.aabb.miny = d.y);
  36447. d.y > this.aabb.maxy && (this.aabb.maxy = d.y);
  36448. b = b.next
  36449. }
  36450. },
  36451. __validate_aabb: function () {
  36452. this.validate_gverts();
  36453. if (null == this.lverts.next) throw "Error: An empty polygon has no meaningful bounds";
  36454. var a = this.gverts.next;
  36455. this.aabb.minx = a.x;
  36456. this.aabb.miny = a.y;
  36457. this.aabb.maxx = a.x;
  36458. this.aabb.maxy = a.y;
  36459. for (a = this.gverts.next.next; null != a;) {
  36460. var b = a;
  36461. b.x < this.aabb.minx && (this.aabb.minx = b.x);
  36462. b.x > this.aabb.maxx && (this.aabb.maxx = b.x);
  36463. b.y < this.aabb.miny && (this.aabb.miny = b.y);
  36464. b.y > this.aabb.maxy && (this.aabb.maxy = b.y);
  36465. a = a.next
  36466. }
  36467. },
  36468. validate_gaxi: function () {
  36469. if (this.zip_gaxi && null != this.body) {
  36470. this.zip_gaxi = !1;
  36471. this.validate_laxi();
  36472. this.body.validate_axis();
  36473. this.validate_gverts();
  36474. for (var a = this.edges.head, b = this.gverts.next, d = b, b = b.next; null != b;) {
  36475. var c = b,
  36476. e = a.elt,
  36477. a = a.next;
  36478. e.gp0 = d;
  36479. e.gp1 = c;
  36480. e.gnormx = this.body.axisy * e.lnormx - this.body.axisx * e.lnormy;
  36481. e.gnormy = e.lnormx * this.body.axisx + e.lnormy * this.body.axisy;
  36482. e.gprojection = this.body.posx * e.gnormx + this.body.posy * e.gnormy + e.lprojection;
  36483. null != e.wrap_gnorm && (e.wrap_gnorm.zpp_inner.x = e.gnormx, e.wrap_gnorm.zpp_inner.y = e.gnormy);
  36484. e.tp0 = e.gp0.y * e.gnormx - e.gp0.x * e.gnormy;
  36485. e.tp1 = e.gp1.y * e.gnormx - e.gp1.x * e.gnormy;
  36486. d = c;
  36487. b =
  36488. b.next
  36489. }
  36490. c = this.gverts.next;
  36491. e = a.elt;
  36492. e.gp0 = d;
  36493. e.gp1 = c;
  36494. e.gnormx = this.body.axisy * e.lnormx - this.body.axisx * e.lnormy;
  36495. e.gnormy = e.lnormx * this.body.axisx + e.lnormy * this.body.axisy;
  36496. e.gprojection = this.body.posx * e.gnormx + this.body.posy * e.gnormy + e.lprojection;
  36497. null != e.wrap_gnorm && (e.wrap_gnorm.zpp_inner.x = e.gnormx, e.wrap_gnorm.zpp_inner.y = e.gnormy);
  36498. e.tp0 = e.gp0.y * e.gnormx - e.gp0.x * e.gnormy;
  36499. e.tp1 = e.gp1.y * e.gnormx - e.gp1.x * e.gnormy
  36500. }
  36501. },
  36502. validate_gverts: function () {
  36503. if (this.zip_gverts && null != this.body) {
  36504. this.zip_gverts = !1;
  36505. this.validate_lverts();
  36506. this.body.validate_axis();
  36507. for (var a = this.lverts.next, b = this.gverts.next; null != b;) {
  36508. var d = b,
  36509. c = a,
  36510. a = a.next;
  36511. d.x = this.body.posx + (this.body.axisy * c.x - this.body.axisx * c.y);
  36512. d.y = this.body.posy + (c.x * this.body.axisx + c.y * this.body.axisy);
  36513. b = b.next
  36514. }
  36515. }
  36516. },
  36517. validate_laxi: function () {
  36518. if (this.zip_laxi) {
  36519. this.zip_laxi = !1;
  36520. this.validate_lverts();
  36521. for (var a = this.edges.head, b = this.lverts.next, d = b, b = b.next; null != b;) {
  36522. var c = b,
  36523. e = a.elt,
  36524. a = a.next;
  36525. e.lp0 = d;
  36526. e.lp1 = c;
  36527. var f = 0,
  36528. l = 0,
  36529. f = d.x - c.x,
  36530. l = d.y - c.y,
  36531. h = Math.sqrt(f * f + l * l);
  36532. e.length = h;
  36533. h = 1 / h;
  36534. f *=
  36535. h;
  36536. l *= h;
  36537. h = f;
  36538. f = -l;
  36539. l = h;
  36540. e.lprojection = f * d.x + l * d.y;
  36541. e.lnormx = f;
  36542. e.lnormy = l;
  36543. null != e.wrap_lnorm && (e.wrap_lnorm.zpp_inner.x = f, e.wrap_lnorm.zpp_inner.y = l);
  36544. d = c;
  36545. b = b.next
  36546. }
  36547. c = this.lverts.next;
  36548. e = a.elt;
  36549. e.lp0 = d;
  36550. e.lp1 = c;
  36551. f = d.x - c.x;
  36552. l = d.y - c.y;
  36553. h = Math.sqrt(f * f + l * l);
  36554. e.length = h;
  36555. h = 1 / h;
  36556. l *= h;
  36557. h *= f;
  36558. f = -l;
  36559. l = h;
  36560. e.lprojection = f * d.x + l * d.y;
  36561. e.lnormx = f;
  36562. e.lnormy = l;
  36563. null != e.wrap_lnorm && (e.wrap_lnorm.zpp_inner.x = f, e.wrap_lnorm.zpp_inner.y = l)
  36564. }
  36565. },
  36566. reverse_vertices: function () {
  36567. this.lverts.reverse();
  36568. this.gverts.reverse();
  36569. this.edges.reverse();
  36570. var a =
  36571. this.edges.iterator_at(this.edgeCnt - 1),
  36572. b = this.edges.pop_unsafe();
  36573. this.edges.insert(a, b);
  36574. this.reverse_flag = !this.reverse_flag;
  36575. null != this.wrap_lverts && (this.wrap_lverts.zpp_inner.reverse_flag = this.reverse_flag);
  36576. null != this.wrap_gverts && (this.wrap_gverts.zpp_inner.reverse_flag = this.reverse_flag);
  36577. null != this.wrap_edges && (this.wrap_edges.zpp_inner.reverse_flag = this.reverse_flag)
  36578. },
  36579. splice_collinear_real: function () {
  36580. if (null != this.lverts.next && null != this.lverts.next.next && null != this.lverts.next.next.next) {
  36581. for (var a =
  36582. null, b = this.lverts.next; null != b;) {
  36583. var d = null == b.next ? this.lverts.next : b.next,
  36584. g = b,
  36585. e = d;
  36586. c.geom.ZPP_VecMath.vec_dsq(g.x, g.y, e.x, e.y) < h.Config.epsilon * h.Config.epsilon ? (this.cleanup_lvert(b), b = this.lverts.erase(a)) : (a = b, b = b.next)
  36587. }
  36588. if (null != this.lverts.next) {
  36589. do
  36590. for (a = !1, b = this.lverts.next; null != b;) {
  36591. var f = null == b.next ? this.lverts.next : b.next,
  36592. d = null == f.next ? this.lverts.next : f.next,
  36593. g = b,
  36594. e = f,
  36595. l = 0,
  36596. m = 0,
  36597. l = e.x - g.x,
  36598. m = e.y - g.y,
  36599. k = g = 0,
  36600. g = d.x - e.x,
  36601. k = d.y - e.y,
  36602. e = k * l - g * m;
  36603. e * e >= h.Config.epsilon * h.Config.epsilon || (this.cleanup_lvert(f),
  36604. this.lverts.erase(null == b.next ? null : b), a = !0);
  36605. b = b.next
  36606. }
  36607. while (a)
  36608. }
  36609. }
  36610. },
  36611. splice_collinear: function () {
  36612. this.zip_sanitation && (this.zip_sanitation = !1, this.splice_collinear_real())
  36613. },
  36614. cleanup_lvert: function (a) {
  36615. for (var b = null, d = null, g = this.lverts.next; null != g && g != a;) b = null == b ? this.gverts.next : b.next, d = null == d ? this.edges.head : d.next, g = g.next;
  36616. a = null == b ? this.gverts.next : b.next;
  36617. this.gverts.erase(b);
  36618. b = a;
  36619. null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
  36620. b._isimmutable = null;
  36621. b._validate = null;
  36622. b._invalidate = null;
  36623. b.next =
  36624. c.geom.ZPP_Vec2.zpp_pool;
  36625. c.geom.ZPP_Vec2.zpp_pool = b;
  36626. 2 == this.edgeCnt ? (b = this.edges.pop_unsafe(), b.polygon = null, b.next = c.shape.ZPP_Edge.zpp_pool, c.shape.ZPP_Edge.zpp_pool = b, b = this.edges.pop_unsafe(), b.polygon = null, b.next = c.shape.ZPP_Edge.zpp_pool, c.shape.ZPP_Edge.zpp_pool = b, this.edgeCnt = 0) : 0 != this.edgeCnt && (b = null == d ? this.edges.head.elt : d.next.elt, this.edges.erase(d), b.polygon = null, b.next = c.shape.ZPP_Edge.zpp_pool, c.shape.ZPP_Edge.zpp_pool = b, this.edgeCnt--)
  36627. },
  36628. validate_lverts: function () {
  36629. this.zip_lverts &&
  36630. (this.zip_lverts = !1, 2 < this.lverts.length && (this.validate_area_inertia(), 0 > this.area && (this.reverse_vertices(), this.area = -this.area)))
  36631. },
  36632. valid: function () {
  36633. if (this.zip_valid) {
  36634. this.zip_valid = !1;
  36635. this.zip_sanitation && (this.zip_sanitation = !1, this.splice_collinear_real());
  36636. if (3 > this.lverts.length) return null == c.util.ZPP_Flags.ValidationResult_DEGENERATE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_DEGENERATE = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1), this.validation = c.util.ZPP_Flags.ValidationResult_DEGENERATE;
  36637. this.validate_lverts();
  36638. this.validate_area_inertia();
  36639. if (this.area < h.Config.epsilon) return null == c.util.ZPP_Flags.ValidationResult_DEGENERATE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_DEGENERATE = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1), this.validation = c.util.ZPP_Flags.ValidationResult_DEGENERATE;
  36640. for (var a = !1, b = !1, d = !0, g = this.lverts.next, e = g, f = g = g.next, g = g.next; null != g;) {
  36641. var l = g,
  36642. m = 0,
  36643. k = 0,
  36644. m = l.x - f.x,
  36645. k = l.y - f.y,
  36646. p = 0,
  36647. n = 0,
  36648. p = f.x - e.x,
  36649. n = f.y - e.y,
  36650. m = n * m - p * k;
  36651. m > h.Config.epsilon ?
  36652. b = !0 : m < -h.Config.epsilon && (a = !0);
  36653. if (b && a) {
  36654. d = !1;
  36655. break
  36656. }
  36657. e = f;
  36658. f = l;
  36659. g = g.next
  36660. }
  36661. d && (l = g = this.lverts.next, m = l.x - f.x, k = l.y - f.y, p = f.x - e.x, n = f.y - e.y, m = n * m - p * k, m > h.Config.epsilon ? b = !0 : m < -h.Config.epsilon && (a = !0), b && a && (d = !1), d && (e = f, f = l, d = g = g.next, m = d.x - f.x, k = d.y - f.y, p = f.x - e.x, n = f.y - e.y, m = n * m - p * k, m > h.Config.epsilon ? b = !0 : m < -h.Config.epsilon && (a = !0)));
  36662. if (b && a) return null == c.util.ZPP_Flags.ValidationResult_CONCAVE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_CONCAVE = new h.shape.ValidationResult,
  36663. c.util.ZPP_Flags.internal = !1), this.validation = c.util.ZPP_Flags.ValidationResult_CONCAVE;
  36664. d = a = !0;
  36665. e = g = this.lverts.next;
  36666. for (g = g.next; null != g;) {
  36667. f = g;
  36668. if (!a) {
  36669. d = !1;
  36670. break
  36671. }
  36672. b = !0;
  36673. m = l = this.lverts.next;
  36674. for (l = l.next; null != l;) {
  36675. k = l;
  36676. if (e != m && e != k && f != m && f != k) {
  36677. var n = p = 0,
  36678. p = e.x - m.x,
  36679. n = e.y - m.y,
  36680. r = 0,
  36681. q = 0,
  36682. r = f.x - e.x,
  36683. q = f.y - e.y,
  36684. w = 0,
  36685. t = 0,
  36686. w = k.x - m.x,
  36687. t = k.y - m.y,
  36688. s = q * w - r * t;
  36689. if (s * s > h.Config.epsilon && (s = 1 / s, w = (t * p - w * n) * s, w > h.Config.epsilon && w < 1 - h.Config.epsilon && (p = (q * p - r * n) * s, p > h.Config.epsilon && p < 1 - h.Config.epsilon))) {
  36690. b = a = !1;
  36691. break
  36692. }
  36693. }
  36694. m = k;
  36695. l = l.next
  36696. }
  36697. b && (k = this.lverts.next, e != m && e != k && f != m && f != k && (p = e.x - m.x, n = e.y - m.y, r = f.x - e.x, q = f.y - e.y, w = k.x - m.x, t = k.y - m.y, s = q * w - r * t, s * s > h.Config.epsilon && (s = 1 / s, w = (t * p - w * n) * s, w > h.Config.epsilon && w < 1 - h.Config.epsilon && (p = (q * p - r * n) * s, p > h.Config.epsilon && p < 1 - h.Config.epsilon && (a = !1)))));
  36698. e = f;
  36699. g = g.next
  36700. }
  36701. if (d) {
  36702. do
  36703. if (f = this.lverts.next, a) {
  36704. b = !0;
  36705. m = l = this.lverts.next;
  36706. for (l = l.next; null != l;) {
  36707. k = l;
  36708. if (e != m && e != k && f != m && f != k && (p = e.x - m.x, n = e.y - m.y, r = f.x - e.x, q = f.y - e.y, w = k.x - m.x, t = k.y - m.y, s = q * w - r * t, s * s > h.Config.epsilon && (s =
  36709. 1 / s, w = (t * p - w * n) * s, w > h.Config.epsilon && w < 1 - h.Config.epsilon && (p = (q * p - r * n) * s, p > h.Config.epsilon && p < 1 - h.Config.epsilon)))) {
  36710. b = a = !1;
  36711. break
  36712. }
  36713. m = k;
  36714. l = l.next
  36715. }
  36716. b && (k = this.lverts.next, e != m && e != k && f != m && f != k && (p = e.x - m.x, n = e.y - m.y, r = f.x - e.x, q = f.y - e.y, w = k.x - m.x, t = k.y - m.y, s = q * w - r * t, s * s > h.Config.epsilon && (s = 1 / s, w = (t * p - w * n) * s, w > h.Config.epsilon && w < 1 - h.Config.epsilon && (p = (q * p - r * n) * s, p > h.Config.epsilon && p < 1 - h.Config.epsilon && (a = !1)))))
  36717. }
  36718. while (0)
  36719. }
  36720. a ? (null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1), e = this.validation = c.util.ZPP_Flags.ValidationResult_VALID) : (null == c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1), e = this.validation = c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING);
  36721. return e
  36722. }
  36723. return this.validation
  36724. },
  36725. invalidate_gaxi: function () {
  36726. this.zip_gaxi = !0
  36727. },
  36728. invalidate_gverts: function () {
  36729. this.zip_aabb = !0;
  36730. null != this.body && (this.body.zip_aabb = !0);
  36731. this.zip_gverts = !0
  36732. },
  36733. invalidate_laxi: function () {
  36734. this.invalidate_gaxi();
  36735. this.zip_laxi = this.zip_sweepRadius = !0
  36736. },
  36737. invalidate_lverts: function () {
  36738. this.invalidate_laxi();
  36739. this.invalidate_area_inertia();
  36740. this.invalidate_angDrag();
  36741. this.invalidate_localCOM();
  36742. this.invalidate_gverts();
  36743. this.zip_sanitation = this.zip_valid = this.zip_lverts = !0;
  36744. null != this.body && this.body.wake()
  36745. },
  36746. getedges: function () {
  36747. this.wrap_edges = c.util.ZPP_EdgeList.get(this.edges, !0);
  36748. this.wrap_edges.zpp_inner.reverse_flag = this.reverse_flag;
  36749. this.wrap_edges.zpp_inner._validate = A(this, this.edges_validate)
  36750. },
  36751. getgverts: function () {
  36752. this.wrap_gverts = c.util.ZPP_MixVec2List.get(this.gverts, !0);
  36753. this.wrap_gverts.zpp_inner.reverse_flag = this.reverse_flag;
  36754. this.wrap_gverts.zpp_inner._validate = A(this, this.gverts_validate)
  36755. },
  36756. getlverts: function () {
  36757. this.wrap_lverts = c.util.ZPP_MixVec2List.get(this.lverts);
  36758. this.wrap_lverts.zpp_inner.post_adder = A(this, this.lverts_post_adder);
  36759. this.wrap_lverts.zpp_inner.subber =
  36760. A(this, this.lverts_subber);
  36761. this.wrap_lverts.zpp_inner._invalidate = A(this, this.lverts_invalidate);
  36762. this.wrap_lverts.zpp_inner._validate = A(this, this.lverts_validate);
  36763. this.wrap_lverts.zpp_inner._modifiable = A(this, this.lverts_modifiable);
  36764. this.wrap_lverts.zpp_inner.reverse_flag = this.reverse_flag
  36765. },
  36766. edges_validate: function () {
  36767. this.validate_lverts()
  36768. },
  36769. gverts_validate: function () {
  36770. this.validate_gverts()
  36771. },
  36772. lverts_modifiable: function () {
  36773. this.immutable_midstep("Polygon::localVerts");
  36774. if (null != this.body && this.body.type ==
  36775. c.util.ZPP_Flags.id_BodyType_STATIC && null != this.body.space) throw "Error: Cannot modifiy shapes of static object once added to Space";
  36776. },
  36777. lverts_validate: function () {
  36778. this.validate_lverts()
  36779. },
  36780. lverts_invalidate: function (a) {
  36781. this.invalidate_lverts()
  36782. },
  36783. lverts_subber: function (a) {
  36784. this.cleanup_lvert(a.zpp_inner)
  36785. },
  36786. lverts_post_adder: function (a) {
  36787. a.zpp_inner._invalidate = A(this, this.lverts_pa_invalidate);
  36788. a.zpp_inner._isimmutable = A(this, this.lverts_pa_immutable);
  36789. for (var b = null, d = null, g = this.lverts.next; null != g && g != a.zpp_inner;) b =
  36790. null == b ? this.gverts.next : b.next, d = null == d ? this.edges.head : d.next, g = g.next;
  36791. a = c.geom.ZPP_Vec2.get(0, 0, !0);
  36792. this.gverts.insert(b, a);
  36793. null != this.lverts.next.next && (null == this.lverts.next.next.next ? (null == c.shape.ZPP_Edge.zpp_pool ? b = new c.shape.ZPP_Edge : (b = c.shape.ZPP_Edge.zpp_pool, c.shape.ZPP_Edge.zpp_pool = b.next, b.next = null), null, b.polygon = this, this.edges.add(b), null == c.shape.ZPP_Edge.zpp_pool ? d = new c.shape.ZPP_Edge : (d = c.shape.ZPP_Edge.zpp_pool, c.shape.ZPP_Edge.zpp_pool = d.next, d.next = null), null, d.polygon =
  36794. this, this.edges.add(d), this.edgeCnt += 2) : (null == c.shape.ZPP_Edge.zpp_pool ? b = new c.shape.ZPP_Edge : (b = c.shape.ZPP_Edge.zpp_pool, c.shape.ZPP_Edge.zpp_pool = b.next, b.next = null), null, b.polygon = this, this.edges.insert(d, b), this.edgeCnt++));
  36795. a._validate = A(this, this.gverts_pa_validate)
  36796. },
  36797. gverts_pa_validate: function () {
  36798. if (null == this.body) throw "Error: World vertex only makes sense when Polygon is contained in a rigid body";
  36799. this.validate_gverts()
  36800. },
  36801. lverts_pa_immutable: function () {
  36802. if (null != this.body && this.body.type ==
  36803. c.util.ZPP_Flags.id_BodyType_STATIC && null != this.body.space) throw "Error: Cannot modify local vertex of Polygon added to a static body whilst within a Space";
  36804. },
  36805. lverts_pa_invalidate: function (a) {
  36806. this.invalidate_lverts()
  36807. },
  36808. __clear: function () {},
  36809. __class__: c.shape.ZPP_Polygon
  36810. });
  36811. c.space = {};
  36812. c.space.ZPP_Broadphase = function () {
  36813. this.sweep = this.dynab = this.aabbShape = this.matrix = this.circShape = null;
  36814. this.is_sweep = !1;
  36815. this.space = null
  36816. };
  36817. s["zpp_nape.space.ZPP_Broadphase"] = c.space.ZPP_Broadphase;
  36818. c.space.ZPP_Broadphase.__name__ = ["zpp_nape", "space", "ZPP_Broadphase"];
  36819. c.space.ZPP_Broadphase.prototype = {
  36820. rayMultiCast: function (a, b, d, c) {
  36821. return null
  36822. },
  36823. rayCast: function (a, b, d) {
  36824. return null
  36825. },
  36826. bodiesInShape: function (a, b, d, c) {
  36827. return null
  36828. },
  36829. shapesInShape: function (a, b, d, c) {
  36830. return null
  36831. },
  36832. validateShape: function (a) {
  36833. a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.validate_gaxi();
  36834. a.zip_aabb && null != a.body && (a.zip_aabb = !1, a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.__validate_aabb() : a.polygon.__validate_aabb());
  36835. a.zip_worldCOM && null !=
  36836. a.body && (a.zip_worldCOM = !1, a.zip_localCOM && (a.zip_localCOM = !1, a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.__validate_localCOM(), null != a.wrap_localCOM && (a.wrap_localCOM.zpp_inner.x = a.localCOMx, a.wrap_localCOM.zpp_inner.y = a.localCOMy)), a.body.validate_axis(), a.worldCOMx = a.body.posx + (a.body.axisy * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy))
  36837. },
  36838. bodiesInCircle: function (a, b, d, c, e, f) {
  36839. return null
  36840. },
  36841. shapesInCircle: function (a, b,
  36842. d, c, e, f) {
  36843. return null
  36844. },
  36845. updateCircShape: function (a, b, d) {
  36846. if (null == this.circShape) {
  36847. var g = h.phys.Body;
  36848. null == c.util.ZPP_Flags.BodyType_STATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_STATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  36849. (new g(c.util.ZPP_Flags.BodyType_STATIC)).zpp_inner.wrap_shapes.add(this.circShape = new h.shape.Circle(d, h.geom.Vec2.get(a, b, null)))
  36850. } else g = this.circShape.zpp_inner.circle, d /= g.radius, null == this.matrix && (this.matrix = new h.geom.Mat23), this.matrix.set_a(this.matrix.set_d(d)),
  36851. this.matrix.set_b(this.matrix.set_c(0)), this.matrix.set_tx(a - d * g.localCOMx), this.matrix.set_ty(b - d * g.localCOMy), this.circShape.transform(this.matrix);
  36852. this.circShape.zpp_inner.validate_aabb()
  36853. },
  36854. bodiesInAABB: function (a, b, d, c, e) {
  36855. return null
  36856. },
  36857. shapesInAABB: function (a, b, d, c, e) {
  36858. return null
  36859. },
  36860. updateAABBShape: function (a) {
  36861. if (null == this.aabbShape) {
  36862. var b = h.phys.Body;
  36863. null == c.util.ZPP_Flags.BodyType_STATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_STATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  36864. (new b(c.util.ZPP_Flags.BodyType_STATIC)).zpp_inner.wrap_shapes.add(this.aabbShape = new h.shape.Polygon(h.shape.Polygon.rect(a.minx, a.miny, a.maxx - a.minx, a.maxy - a.miny)))
  36865. } else {
  36866. var b = this.aabbShape.zpp_inner.aabb,
  36867. d = (a.maxx - a.minx) / (b.maxx - b.minx),
  36868. g = (a.maxy - a.miny) / (b.maxy - b.miny);
  36869. null == this.matrix && (this.matrix = new h.geom.Mat23);
  36870. this.matrix.set_a(d);
  36871. this.matrix.set_b(this.matrix.set_c(0));
  36872. this.matrix.set_d(g);
  36873. this.matrix.set_tx(a.minx - d * b.minx);
  36874. this.matrix.set_ty(a.miny - g * b.miny);
  36875. this.aabbShape.transform(this.matrix)
  36876. }
  36877. this.aabbShape.zpp_inner.validate_aabb();
  36878. this.aabbShape.zpp_inner.polygon.validate_gaxi()
  36879. },
  36880. bodiesUnderPoint: function (a, b, d, c) {
  36881. return null
  36882. },
  36883. shapesUnderPoint: function (a, b, d, c) {
  36884. return null
  36885. },
  36886. clear: function () {},
  36887. broadphase: function (a, b) {},
  36888. sync: function (a) {
  36889. this.is_sweep ? !this.sweep.space.continuous && a.zip_aabb && null != a.body && (a.zip_aabb = !1, a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.__validate_aabb() : a.polygon.__validate_aabb()) : this.dynab.__sync(a)
  36890. },
  36891. remove: function (a) {
  36892. this.is_sweep ? this.sweep.__remove(a) : this.dynab.__remove(a)
  36893. },
  36894. insert: function (a) {
  36895. this.is_sweep ?
  36896. this.sweep.__insert(a) : this.dynab.__insert(a)
  36897. },
  36898. __class__: c.space.ZPP_Broadphase
  36899. };
  36900. c.space.ZPP_AABBNode = function () {
  36901. this.synced = this.first_sync = !1;
  36902. this.snext = null;
  36903. this.moved = !1;
  36904. this.next = this.mnext = null;
  36905. this.height = this.rayt = 0;
  36906. this.parent = this.child1 = this.child2 = null;
  36907. this.dyn = !1;
  36908. this.aabb = this.shape = null;
  36909. this.height = -1
  36910. };
  36911. s["zpp_nape.space.ZPP_AABBNode"] = c.space.ZPP_AABBNode;
  36912. c.space.ZPP_AABBNode.__name__ = ["zpp_nape", "space", "ZPP_AABBNode"];
  36913. c.space.ZPP_AABBNode.prototype = {
  36914. isLeaf: function () {
  36915. return null ==
  36916. this.child1
  36917. },
  36918. free: function () {
  36919. this.height = -1;
  36920. var a = this.aabb;
  36921. null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
  36922. a.wrap_min = a.wrap_max = null;
  36923. a._invalidate = null;
  36924. a._validate = null;
  36925. a.next = c.geom.ZPP_AABB.zpp_pool;
  36926. c.geom.ZPP_AABB.zpp_pool = a;
  36927. this.mnext = this.snext = this.next = this.child1 = this.child2 = this.parent = null
  36928. },
  36929. alloc: function () {
  36930. null == c.geom.ZPP_AABB.zpp_pool ? this.aabb = new c.geom.ZPP_AABB : (this.aabb = c.geom.ZPP_AABB.zpp_pool, c.geom.ZPP_AABB.zpp_pool = this.aabb.next, this.aabb.next = null);
  36931. null;
  36932. this.first_sync =
  36933. this.synced = this.moved = !1
  36934. },
  36935. __class__: c.space.ZPP_AABBNode
  36936. };
  36937. c.space.ZPP_AABBPair = function () {
  36938. this.arb = this.next = null;
  36939. this.id = this.di = 0;
  36940. this.first = this.sleeping = !1;
  36941. this.n1 = this.n2 = null
  36942. };
  36943. s["zpp_nape.space.ZPP_AABBPair"] = c.space.ZPP_AABBPair;
  36944. c.space.ZPP_AABBPair.__name__ = ["zpp_nape", "space", "ZPP_AABBPair"];
  36945. c.space.ZPP_AABBPair.prototype = {
  36946. free: function () {
  36947. this.n1 = this.n2 = null;
  36948. this.sleeping = !1
  36949. },
  36950. alloc: function () {},
  36951. __class__: c.space.ZPP_AABBPair
  36952. };
  36953. c.space.ZPP_AABBTree = function () {
  36954. this.root = null
  36955. };
  36956. s["zpp_nape.space.ZPP_AABBTree"] =
  36957. c.space.ZPP_AABBTree;
  36958. c.space.ZPP_AABBTree.__name__ = ["zpp_nape", "space", "ZPP_AABBTree"];
  36959. c.space.ZPP_AABBTree.prototype = {
  36960. balance: function (a) {
  36961. if (null == a.child1 || 2 > a.height) return a;
  36962. var b = a.child1,
  36963. d = a.child2,
  36964. c = d.height - b.height;
  36965. if (1 < c) {
  36966. var e = d.child1,
  36967. f = d.child2;
  36968. d.child1 = a;
  36969. d.parent = a.parent;
  36970. a.parent = d;
  36971. null != d.parent ? d.parent.child1 == a ? d.parent.child1 = d : d.parent.child2 = d : this.root = d;
  36972. e.height > f.height ? (d.child2 = e, a.child2 = f, f.parent = a, a.aabb.setCombine(b.aabb, f.aabb), d.aabb.setCombine(a.aabb, e.aabb), a.height =
  36973. 1 + function (a) {
  36974. a = b.height;
  36975. var d = f.height;
  36976. return a > d ? a : d
  36977. }(this), d.height = 1 + function (b) {
  36978. b = a.height;
  36979. var d = e.height;
  36980. return b > d ? b : d
  36981. }(this)) : (d.child2 = f, a.child2 = e, e.parent = a, a.aabb.setCombine(b.aabb, e.aabb), d.aabb.setCombine(a.aabb, f.aabb), a.height = 1 + function (a) {
  36982. a = b.height;
  36983. var d = e.height;
  36984. return a > d ? a : d
  36985. }(this), d.height = 1 + function (b) {
  36986. b = a.height;
  36987. var d = f.height;
  36988. return b > d ? b : d
  36989. }(this));
  36990. return d
  36991. }
  36992. return -1 > c ? (e = b.child1, f = b.child2, b.child1 = a, b.parent = a.parent, a.parent = b, null != b.parent ? b.parent.child1 == a ? b.parent.child1 =
  36993. b : b.parent.child2 = b : this.root = b, e.height > f.height ? (b.child2 = e, a.child1 = f, f.parent = a, a.aabb.setCombine(d.aabb, f.aabb), b.aabb.setCombine(a.aabb, e.aabb), a.height = 1 + function (a) {
  36994. a = d.height;
  36995. var b = f.height;
  36996. return a > b ? a : b
  36997. }(this), b.height = 1 + function (b) {
  36998. b = a.height;
  36999. var d = e.height;
  37000. return b > d ? b : d
  37001. }(this)) : (b.child2 = f, a.child1 = e, e.parent = a, a.aabb.setCombine(d.aabb, e.aabb), b.aabb.setCombine(a.aabb, f.aabb), a.height = 1 + function (a) {
  37002. a = d.height;
  37003. var b = e.height;
  37004. return a > b ? a : b
  37005. }(this), b.height = 1 + function (b) {
  37006. b = a.height;
  37007. var d =
  37008. f.height;
  37009. return b > d ? b : d
  37010. }(this)), b) : a
  37011. },
  37012. inlined_removeLeaf: function (a) {
  37013. if (a == this.root) this.root = null;
  37014. else {
  37015. var b = a.parent,
  37016. d = b.parent;
  37017. a = b.child1 == a ? b.child2 : b.child1;
  37018. if (null != d)
  37019. for (d.child1 == b ? d.child1 = a : d.child2 = a, a.parent = d, b.free(), b.next = c.space.ZPP_AABBNode.zpp_pool, c.space.ZPP_AABBNode.zpp_pool = b; null != d;) {
  37020. var d = this.balance(d),
  37021. g = d.child1;
  37022. a = d.child2;
  37023. d.aabb.setCombine(g.aabb, a.aabb);
  37024. var b = d,
  37025. e = void 0,
  37026. g = g.height;
  37027. a = a.height;
  37028. e = g > a ? g : a;
  37029. b.height = 1 + e;
  37030. d = d.parent
  37031. } else this.root = a, a.parent = null, b.free(),
  37032. b.next = c.space.ZPP_AABBNode.zpp_pool, c.space.ZPP_AABBNode.zpp_pool = b
  37033. }
  37034. },
  37035. removeLeaf: function (a) {
  37036. this.inlined_removeLeaf(a)
  37037. },
  37038. inlined_insertLeaf: function (a) {
  37039. if (null == this.root) this.root = a, this.root.parent = null;
  37040. else {
  37041. for (var b = a.aabb, d = this.root; null != d.child1;) {
  37042. var g = d.child1,
  37043. e = d.child2,
  37044. f = d.aabb.perimeter();
  37045. c.space.ZPP_AABBTree.tmpaabb.setCombine(d.aabb, b);
  37046. var l = c.space.ZPP_AABBTree.tmpaabb.perimeter(),
  37047. h = 2 * l,
  37048. k = 2 * (l - f),
  37049. f = function (a) {
  37050. c.space.ZPP_AABBTree.tmpaabb.setCombine(b, g.aabb);
  37051. null == g.child1 ? a = c.space.ZPP_AABBTree.tmpaabb.perimeter() +
  37052. k : (a = g.aabb.perimeter(), a = c.space.ZPP_AABBTree.tmpaabb.perimeter() - a + k);
  37053. return a
  37054. }(this),
  37055. l = function (a) {
  37056. c.space.ZPP_AABBTree.tmpaabb.setCombine(b, e.aabb);
  37057. null == e.child1 ? a = c.space.ZPP_AABBTree.tmpaabb.perimeter() + k : (a = e.aabb.perimeter(), a = c.space.ZPP_AABBTree.tmpaabb.perimeter() - a + k);
  37058. return a
  37059. }(this);
  37060. if (h < f && h < l) break;
  37061. else d = f < l ? g : e
  37062. }
  37063. h = d.parent;
  37064. null == c.space.ZPP_AABBNode.zpp_pool ? f = new c.space.ZPP_AABBNode : (f = c.space.ZPP_AABBNode.zpp_pool, c.space.ZPP_AABBNode.zpp_pool = f.next, f.next = null);
  37065. null == c.geom.ZPP_AABB.zpp_pool ?
  37066. f.aabb = new c.geom.ZPP_AABB : (f.aabb = c.geom.ZPP_AABB.zpp_pool, c.geom.ZPP_AABB.zpp_pool = f.aabb.next, f.aabb.next = null);
  37067. null;
  37068. f.moved = !1;
  37069. f.synced = !1;
  37070. f.first_sync = !1;
  37071. f.parent = h;
  37072. f.aabb.setCombine(b, d.aabb);
  37073. f.height = d.height + 1;
  37074. null != h ? (h.child1 == d ? h.child1 = f : h.child2 = f, f.child1 = d, f.child2 = a, d.parent = f, a.parent = f) : (f.child1 = d, f.child2 = a, d.parent = f, this.root = a.parent = f);
  37075. for (d = a.parent; null != d;) d = this.balance(d), g = d.child1, e = d.child2, d.height = 1 + function (a) {
  37076. a = g.height;
  37077. var b = e.height;
  37078. return a > b ? a : b
  37079. }(this), d.aabb.setCombine(g.aabb,
  37080. e.aabb), d = d.parent
  37081. }
  37082. },
  37083. insertLeaf: function (a) {
  37084. this.inlined_insertLeaf(a)
  37085. },
  37086. clear: function () {
  37087. if (null != this.root) {
  37088. var a;
  37089. this.root.next = null;
  37090. for (a = this.root; null != a;) {
  37091. var b;
  37092. b = void 0;
  37093. b = a;
  37094. a = b.next;
  37095. b.next = null;
  37096. null == b.child1 ? (b.shape.node = null, b.shape.removedFromSpace(), b.shape = null) : (null != b.child1 && (b.child1.next = a, a = b.child1), null != b.child2 && (b.child2.next = a, a = b.child2));
  37097. b.free();
  37098. b.next = c.space.ZPP_AABBNode.zpp_pool;
  37099. c.space.ZPP_AABBNode.zpp_pool = b
  37100. }
  37101. this.root = null
  37102. }
  37103. },
  37104. __class__: c.space.ZPP_AABBTree
  37105. };
  37106. c.space.ZPP_DynAABBPhase =
  37107. function (a) {
  37108. this.stree = this.dtree = this.pairs = this.syncs = this.moves = this.treeStack = this.treeStack2 = this.failed = this.openlist = null;
  37109. this.space = a;
  37110. this.is_sweep = !1;
  37111. this.dynab = this;
  37112. this.stree = new c.space.ZPP_AABBTree;
  37113. this.dtree = new c.space.ZPP_AABBTree
  37114. };
  37115. s["zpp_nape.space.ZPP_DynAABBPhase"] = c.space.ZPP_DynAABBPhase;
  37116. c.space.ZPP_DynAABBPhase.__name__ = ["zpp_nape", "space", "ZPP_DynAABBPhase"];
  37117. c.space.ZPP_DynAABBPhase.__super__ = c.space.ZPP_Broadphase;
  37118. c.space.ZPP_DynAABBPhase.prototype = I(c.space.ZPP_Broadphase.prototype, {
  37119. rayMultiCast: function (a, b, d, g) {
  37120. null == this.openlist && (this.openlist = new c.util.ZNPList_ZPP_AABBNode);
  37121. this.sync_broadphase();
  37122. a.validate_dir();
  37123. var e = a.maxdist >= Math.POSITIVE_INFINITY;
  37124. g = null == g ? new h.geom.RayResultList : g;
  37125. if (null != this.dtree.root && a.aabbtest(this.dtree.root.aabb))
  37126. if (e) this.openlist.add(this.dtree.root);
  37127. else {
  37128. var f = a.aabbsect(this.dtree.root.aabb);
  37129. 0 <= f && f < a.maxdist && this.openlist.add(this.dtree.root)
  37130. }
  37131. null != this.stree.root && a.aabbtest(this.stree.root.aabb) && (e ? this.openlist.add(this.stree.root) :
  37132. (f = a.aabbsect(this.stree.root.aabb), 0 <= f && f < a.maxdist && this.openlist.add(this.stree.root)));
  37133. for (; null != this.openlist.head;) {
  37134. var l = this.openlist.pop_unsafe();
  37135. if (null == l.child1) {
  37136. if (f = l.shape, null == d || f.filter.shouldCollide(d)) f.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect2(f.circle, b, g) : a.aabbtest(f.aabb) && a.polysect2(f.polygon, b, g)
  37137. } else null != l.child1 && a.aabbtest(l.child1.aabb) && (e ? this.openlist.add(l.child1) : (f = a.aabbsect(l.child1.aabb), 0 <= f && f < a.maxdist && this.openlist.add(l.child1))),
  37138. null != l.child2 && a.aabbtest(l.child2.aabb) && (e ? this.openlist.add(l.child2) : (f = a.aabbsect(l.child2.aabb), 0 <= f && f < a.maxdist && this.openlist.add(l.child2)))
  37139. }
  37140. this.openlist.clear();
  37141. return g
  37142. },
  37143. rayCast: function (a, b, d) {
  37144. null == this.openlist && (this.openlist = new c.util.ZNPList_ZPP_AABBNode);
  37145. this.sync_broadphase();
  37146. a.validate_dir();
  37147. var g = a.maxdist;
  37148. if (null != this.dtree.root && a.aabbtest(this.dtree.root.aabb)) {
  37149. var e = a.aabbsect(this.dtree.root.aabb);
  37150. if (0 <= e && e < g) {
  37151. this.dtree.root.rayt = e;
  37152. for (var e = null, f = this.openlist.head; null !=
  37153. f;) {
  37154. var l = f.elt;
  37155. if (this.dtree.root.rayt < l.rayt) break;
  37156. e = f;
  37157. f = f.next
  37158. }
  37159. this.openlist.inlined_insert(e, this.dtree.root)
  37160. }
  37161. }
  37162. if (null != this.stree.root && a.aabbtest(this.stree.root.aabb) && (e = a.aabbsect(this.stree.root.aabb), 0 <= e && e < g)) {
  37163. this.stree.root.rayt = e;
  37164. e = null;
  37165. for (f = this.openlist.head; null != f;) {
  37166. l = f.elt;
  37167. if (this.stree.root.rayt < l.rayt) break;
  37168. e = f;
  37169. f = f.next
  37170. }
  37171. this.openlist.inlined_insert(e, this.stree.root)
  37172. }
  37173. for (var h = null; null != this.openlist.head;) {
  37174. var k = this.openlist.pop_unsafe();
  37175. if (k.rayt >= g) break;
  37176. if (null == k.child1) {
  37177. if (k =
  37178. k.shape, null == d || k.filter.shouldCollide(d))
  37179. if (k = k.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect(k.circle, b, g) : a.aabbtest(k.aabb) ? a.polysect(k.polygon, b, g) : null, null != k) {
  37180. g = void 0;
  37181. if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  37182. g = k.zpp_inner.toiDistance;
  37183. if (null != h) {
  37184. if (null != h.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  37185. h.zpp_inner.free()
  37186. }
  37187. h = k
  37188. }
  37189. } else {
  37190. if (null != k.child1 && a.aabbtest(k.child1.aabb) && (e = a.aabbsect(k.child1.aabb),
  37191. 0 <= e && e < g)) {
  37192. k.child1.rayt = e;
  37193. e = null;
  37194. for (f = this.openlist.head; null != f;) {
  37195. l = f.elt;
  37196. if (k.child1.rayt < l.rayt) break;
  37197. e = f;
  37198. f = f.next
  37199. }
  37200. this.openlist.inlined_insert(e, k.child1)
  37201. }
  37202. if (null != k.child2 && a.aabbtest(k.child2.aabb) && (e = a.aabbsect(k.child2.aabb), 0 <= e && e < g)) {
  37203. k.child2.rayt = e;
  37204. e = null;
  37205. for (f = this.openlist.head; null != f;) {
  37206. l = f.elt;
  37207. if (k.child2.rayt < l.rayt) break;
  37208. e = f;
  37209. f = f.next
  37210. }
  37211. this.openlist.inlined_insert(e, k.child2)
  37212. }
  37213. }
  37214. }
  37215. this.openlist.clear();
  37216. return h
  37217. },
  37218. bodiesInShape: function (a, b, d, g) {
  37219. this.sync_broadphase();
  37220. this.validateShape(a);
  37221. var e = a.aabb;
  37222. g = null == g ? new h.phys.BodyList : g;
  37223. null == this.failed && (this.failed = new h.phys.BodyList);
  37224. if (null != this.stree.root)
  37225. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
  37226. var f = this.treeStack.pop_unsafe();
  37227. if (f.aabb.intersect(e))
  37228. if (null == f.child1) {
  37229. var l = f.shape.body.outer;
  37230. if (null == d || f.shape.filter.shouldCollide(d)) b ? this.failed.has(l) || (f = c.geom.ZPP_Collide.containTest(a, f.shape), !g.has(l) && f ? g.push(l) : f || (g.remove(l),
  37231. this.failed.push(l))) : !g.has(l) && c.geom.ZPP_Collide.testCollide_safe(f.shape, a) && g.push(l)
  37232. } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2)
  37233. }
  37234. if (null != this.dtree.root)
  37235. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
  37236. if (f = this.treeStack.pop_unsafe(), f.aabb.intersect(e))
  37237. if (null == f.child1) {
  37238. if (l = f.shape.body.outer, null == d || f.shape.filter.shouldCollide(d)) b ? this.failed.has(l) ||
  37239. (f = c.geom.ZPP_Collide.containTest(a, f.shape), !g.has(l) && f ? g.push(l) : f || (g.remove(l), this.failed.push(l))) : !g.has(l) && c.geom.ZPP_Collide.testCollide_safe(f.shape, a) && g.push(l)
  37240. } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
  37241. this.failed.clear();
  37242. return g
  37243. },
  37244. shapesInShape: function (a, b, d, g) {
  37245. this.sync_broadphase();
  37246. this.validateShape(a);
  37247. var e = a.aabb;
  37248. g = null == g ? new h.shape.ShapeList : g;
  37249. if (null != this.stree.root)
  37250. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode),
  37251. this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
  37252. var f = this.treeStack.pop_unsafe();
  37253. if (f.aabb.intersect(e))
  37254. if (null == f.child1) {
  37255. if (null == d || f.shape.filter.shouldCollide(d)) b ? c.geom.ZPP_Collide.containTest(a, f.shape) && g.push(f.shape.outer) : c.geom.ZPP_Collide.testCollide_safe(f.shape, a) && g.push(f.shape.outer)
  37256. } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2)
  37257. }
  37258. if (null != this.dtree.root)
  37259. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode),
  37260. this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
  37261. if (f = this.treeStack.pop_unsafe(), f.aabb.intersect(e))
  37262. if (null == f.child1) {
  37263. if (null == d || f.shape.filter.shouldCollide(d)) b ? c.geom.ZPP_Collide.containTest(a, f.shape) && g.push(f.shape.outer) : c.geom.ZPP_Collide.testCollide_safe(f.shape, a) && g.push(f.shape.outer)
  37264. } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
  37265. return g
  37266. },
  37267. bodiesInCircle: function (a, b, d, g, e, f) {
  37268. this.sync_broadphase();
  37269. this.updateCircShape(a,
  37270. b, d);
  37271. a = this.circShape.zpp_inner.aabb;
  37272. f = null == f ? new h.phys.BodyList : f;
  37273. null == this.failed && (this.failed = new h.phys.BodyList);
  37274. if (null != this.stree.root)
  37275. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
  37276. if (d = this.treeStack.pop_unsafe(), d.aabb.intersect(a))
  37277. if (null == d.child1) {
  37278. if (b = d.shape.body.outer, null == e || d.shape.filter.shouldCollide(e)) g ? this.failed.has(b) || (d = c.geom.ZPP_Collide.containTest(this.circShape.zpp_inner,
  37279. d.shape), !f.has(b) && d ? f.push(b) : d || (f.remove(b), this.failed.push(b))) : !f.has(b) && c.geom.ZPP_Collide.testCollide_safe(d.shape, this.circShape.zpp_inner) && f.push(b)
  37280. } else null != d.child1 && this.treeStack.add(d.child1), null != d.child2 && this.treeStack.add(d.child2);
  37281. if (null != this.dtree.root)
  37282. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
  37283. if (d = this.treeStack.pop_unsafe(), d.aabb.intersect(a))
  37284. if (null == d.child1) {
  37285. if (b = d.shape.body.outer,
  37286. null == e || d.shape.filter.shouldCollide(e)) g ? this.failed.has(b) || (d = c.geom.ZPP_Collide.containTest(this.circShape.zpp_inner, d.shape), !f.has(b) && d ? f.push(b) : d || (f.remove(b), this.failed.push(b))) : !f.has(b) && c.geom.ZPP_Collide.testCollide_safe(d.shape, this.circShape.zpp_inner) && f.push(b)
  37287. } else null != d.child1 && this.treeStack.add(d.child1), null != d.child2 && this.treeStack.add(d.child2);
  37288. this.failed.clear();
  37289. return f
  37290. },
  37291. shapesInCircle: function (a, b, d, g, e, f) {
  37292. this.sync_broadphase();
  37293. this.updateCircShape(a, b, d);
  37294. a = this.circShape.zpp_inner.aabb;
  37295. f = null == f ? new h.shape.ShapeList : f;
  37296. if (null != this.stree.root)
  37297. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
  37298. if (b = this.treeStack.pop_unsafe(), b.aabb.intersect(a))
  37299. if (null == b.child1) {
  37300. if (null == e || b.shape.filter.shouldCollide(e)) g ? c.geom.ZPP_Collide.containTest(this.circShape.zpp_inner, b.shape) && f.push(b.shape.outer) : c.geom.ZPP_Collide.testCollide_safe(b.shape, this.circShape.zpp_inner) && f.push(b.shape.outer)
  37301. } else null !=
  37302. b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
  37303. if (null != this.dtree.root)
  37304. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
  37305. if (b = this.treeStack.pop_unsafe(), b.aabb.intersect(a))
  37306. if (null == b.child1) {
  37307. if (null == e || b.shape.filter.shouldCollide(e)) g ? c.geom.ZPP_Collide.containTest(this.circShape.zpp_inner, b.shape) && f.push(b.shape.outer) : c.geom.ZPP_Collide.testCollide_safe(b.shape, this.circShape.zpp_inner) &&
  37308. f.push(b.shape.outer)
  37309. } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
  37310. return f
  37311. },
  37312. bodiesInAABB: function (a, b, d, g, e) {
  37313. this.sync_broadphase();
  37314. this.updateAABBShape(a);
  37315. a = this.aabbShape.zpp_inner.aabb;
  37316. e = null == e ? new h.phys.BodyList : e;
  37317. null == this.failed && (this.failed = new h.phys.BodyList);
  37318. if (null != this.stree.root)
  37319. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
  37320. var f = this.treeStack.pop_unsafe();
  37321. if (a.contains(f.aabb))
  37322. if (null == f.child1) {
  37323. if (null == g || f.shape.filter.shouldCollide(g)) {
  37324. var l = f.shape.body.outer;
  37325. e.has(l) || e.push(l)
  37326. }
  37327. } else
  37328. for (null == this.treeStack2 && (this.treeStack2 = new c.util.ZNPList_ZPP_AABBNode), this.treeStack2.add(f); null != this.treeStack2.head;)
  37329. if (l = this.treeStack2.pop_unsafe(), null == l.child1) {
  37330. if (null == g || l.shape.filter.shouldCollide(g)) l = l.shape.body.outer, e.has(l) || e.push(l)
  37331. } else null != l.child1 && this.treeStack2.add(l.child1), null != l.child2 && this.treeStack2.add(l.child2);
  37332. else if (f.aabb.intersect(a))
  37333. if (null ==
  37334. f.child1) {
  37335. if (l = f.shape.body.outer, null == g || f.shape.filter.shouldCollide(g)) b ? d ? this.failed.has(l) || (f = c.geom.ZPP_Collide.containTest(this.aabbShape.zpp_inner, f.shape), !e.has(l) && f ? e.push(l) : f || (e.remove(l), this.failed.push(l))) : !e.has(l) && c.geom.ZPP_Collide.testCollide_safe(f.shape, this.aabbShape.zpp_inner) && e.push(l) : d ? this.failed.has(l) || (f = a.contains(f.shape.aabb), !e.has(l) && f ? e.push(l) : f || (e.remove(l), this.failed.push(l))) : !e.has(l) && a.contains(f.shape.aabb) && e.push(l)
  37336. } else null != f.child1 && this.treeStack.add(f.child1),
  37337. null != f.child2 && this.treeStack.add(f.child2)
  37338. }
  37339. if (null != this.dtree.root)
  37340. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
  37341. if (f = this.treeStack.pop_unsafe(), a.contains(f.aabb))
  37342. if (null == f.child1) {
  37343. if (null == g || f.shape.filter.shouldCollide(g)) l = f.shape.body.outer, e.has(l) || e.push(l)
  37344. } else
  37345. for (null == this.treeStack2 && (this.treeStack2 = new c.util.ZNPList_ZPP_AABBNode), this.treeStack2.add(f); null != this.treeStack2.head;)
  37346. if (l =
  37347. this.treeStack2.pop_unsafe(), null == l.child1) {
  37348. if (null == g || l.shape.filter.shouldCollide(g)) l = l.shape.body.outer, e.has(l) || e.push(l)
  37349. } else null != l.child1 && this.treeStack2.add(l.child1), null != l.child2 && this.treeStack2.add(l.child2);
  37350. else if (f.aabb.intersect(a))
  37351. if (null == f.child1) {
  37352. if (l = f.shape.body.outer, null == g || f.shape.filter.shouldCollide(g)) b ? d ? this.failed.has(l) || (f = c.geom.ZPP_Collide.containTest(this.aabbShape.zpp_inner, f.shape), !e.has(l) && f ? e.push(l) : f || (e.remove(l), this.failed.push(l))) : !e.has(l) &&
  37353. c.geom.ZPP_Collide.testCollide_safe(f.shape, this.aabbShape.zpp_inner) && e.push(l) : d ? this.failed.has(l) || (f = a.contains(f.shape.aabb), !e.has(l) && f ? e.push(l) : f || (e.remove(l), this.failed.push(l))) : !e.has(l) && a.contains(f.shape.aabb) && e.push(l)
  37354. } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
  37355. this.failed.clear();
  37356. return e
  37357. },
  37358. shapesInAABB: function (a, b, d, g, e) {
  37359. this.sync_broadphase();
  37360. this.updateAABBShape(a);
  37361. a = this.aabbShape.zpp_inner.aabb;
  37362. e = null == e ? new h.shape.ShapeList :
  37363. e;
  37364. if (null != this.stree.root)
  37365. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
  37366. var f = this.treeStack.pop_unsafe();
  37367. if (a.contains(f.aabb))
  37368. if (null == f.child1)(null == g || f.shape.filter.shouldCollide(g)) && e.push(f.shape.outer);
  37369. else
  37370. for (null == this.treeStack2 && (this.treeStack2 = new c.util.ZNPList_ZPP_AABBNode), this.treeStack2.add(f); null != this.treeStack2.head;) f = this.treeStack2.pop_unsafe(), null == f.child1 ? (null == g || f.shape.filter.shouldCollide(g)) &&
  37371. e.push(f.shape.outer) : (null != f.child1 && this.treeStack2.add(f.child1), null != f.child2 && this.treeStack2.add(f.child2));
  37372. else if (f.aabb.intersect(a))
  37373. if (null == f.child1) {
  37374. if (null == g || f.shape.filter.shouldCollide(g)) b ? d ? c.geom.ZPP_Collide.containTest(this.aabbShape.zpp_inner, f.shape) && e.push(f.shape.outer) : a.contains(f.shape.aabb) ? e.push(f.shape.outer) : c.geom.ZPP_Collide.testCollide_safe(f.shape, this.aabbShape.zpp_inner) && e.push(f.shape.outer) : d && !a.contains(f.shape.aabb) || e.push(f.shape.outer)
  37375. } else null !=
  37376. f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2)
  37377. }
  37378. if (null != this.dtree.root)
  37379. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
  37380. if (f = this.treeStack.pop_unsafe(), a.contains(f.aabb))
  37381. if (null == f.child1)(null == g || f.shape.filter.shouldCollide(g)) && e.push(f.shape.outer);
  37382. else
  37383. for (null == this.treeStack2 && (this.treeStack2 = new c.util.ZNPList_ZPP_AABBNode), this.treeStack2.add(f); null != this.treeStack2.head;) f =
  37384. this.treeStack2.pop_unsafe(), null == f.child1 ? (null == g || f.shape.filter.shouldCollide(g)) && e.push(f.shape.outer) : (null != f.child1 && this.treeStack2.add(f.child1), null != f.child2 && this.treeStack2.add(f.child2));
  37385. else if (f.aabb.intersect(a))
  37386. if (null == f.child1) {
  37387. if (null == g || f.shape.filter.shouldCollide(g)) b ? d ? c.geom.ZPP_Collide.containTest(this.aabbShape.zpp_inner, f.shape) && e.push(f.shape.outer) : a.contains(f.shape.aabb) ? e.push(f.shape.outer) : c.geom.ZPP_Collide.testCollide_safe(f.shape, this.aabbShape.zpp_inner) &&
  37388. e.push(f.shape.outer) : d && !a.contains(f.shape.aabb) || e.push(f.shape.outer)
  37389. } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
  37390. return e
  37391. },
  37392. bodiesUnderPoint: function (a, b, d, g) {
  37393. this.sync_broadphase();
  37394. a = c.geom.ZPP_Vec2.get(a, b, null);
  37395. g = null == g ? new h.phys.BodyList : g;
  37396. if (null != this.stree.root)
  37397. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
  37398. if (b = this.treeStack.pop_unsafe(), b.aabb.containsPoint(a))
  37399. if (null ==
  37400. b.child1) {
  37401. var e = b.shape.body.outer;
  37402. g.has(e) || null != d && !b.shape.filter.shouldCollide(d) || (b.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? c.geom.ZPP_Collide.circleContains(b.shape.circle, a) && g.push(e) : c.geom.ZPP_Collide.polyContains(b.shape.polygon, a) && g.push(e))
  37403. } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
  37404. if (null != this.dtree.root)
  37405. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null !=
  37406. this.treeStack.head;) b = this.treeStack.pop_unsafe(), b.aabb.containsPoint(a) && (null == b.child1 ? (e = b.shape.body.outer, g.has(e) || null != d && !b.shape.filter.shouldCollide(d) || (b.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? c.geom.ZPP_Collide.circleContains(b.shape.circle, a) && g.push(e) : c.geom.ZPP_Collide.polyContains(b.shape.polygon, a) && g.push(e))) : (null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2)));
  37407. null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
  37408. a._isimmutable =
  37409. null;
  37410. a._validate = null;
  37411. a._invalidate = null;
  37412. a.next = c.geom.ZPP_Vec2.zpp_pool;
  37413. c.geom.ZPP_Vec2.zpp_pool = a;
  37414. return g
  37415. },
  37416. shapesUnderPoint: function (a, b, d, g) {
  37417. this.sync_broadphase();
  37418. a = c.geom.ZPP_Vec2.get(a, b, null);
  37419. g = null == g ? new h.shape.ShapeList : g;
  37420. if (null != this.stree.root)
  37421. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
  37422. if (b = this.treeStack.pop_unsafe(), b.aabb.containsPoint(a))
  37423. if (null == b.child1) {
  37424. if (null == d || b.shape.filter.shouldCollide(d)) b.shape.type ==
  37425. c.util.ZPP_Flags.id_ShapeType_CIRCLE ? c.geom.ZPP_Collide.circleContains(b.shape.circle, a) && g.push(b.shape.outer) : c.geom.ZPP_Collide.polyContains(b.shape.polygon, a) && g.push(b.shape.outer)
  37426. } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
  37427. if (null != this.dtree.root)
  37428. for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
  37429. if (b = this.treeStack.pop_unsafe(), b.aabb.containsPoint(a))
  37430. if (null ==
  37431. b.child1) {
  37432. if (null == d || b.shape.filter.shouldCollide(d)) b.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? c.geom.ZPP_Collide.circleContains(b.shape.circle, a) && g.push(b.shape.outer) : c.geom.ZPP_Collide.polyContains(b.shape.polygon, a) && g.push(b.shape.outer)
  37433. } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
  37434. null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
  37435. a._isimmutable = null;
  37436. a._validate = null;
  37437. a._invalidate = null;
  37438. a.next = c.geom.ZPP_Vec2.zpp_pool;
  37439. c.geom.ZPP_Vec2.zpp_pool =
  37440. a;
  37441. return g
  37442. },
  37443. clear: function () {
  37444. for (; null != this.syncs;) {
  37445. var a = this.syncs.snext;
  37446. this.syncs.snext = null;
  37447. this.syncs.first_sync && (this.syncs.shape.node = null, this.syncs.shape.removedFromSpace(), this.syncs.shape = null);
  37448. this.syncs = a
  37449. }
  37450. for (; null != this.moves;) a = this.moves.mnext, this.moves.mnext = null, this.moves.first_sync && (this.moves.shape.node = null, this.moves.shape.removedFromSpace(), this.moves.shape = null), this.moves = a;
  37451. for (; null != this.pairs;) {
  37452. a = this.pairs.next;
  37453. null != this.pairs.arb && (this.pairs.arb.pair = null);
  37454. this.pairs.arb =
  37455. null;
  37456. this.pairs.n1.shape.pairs.inlined_try_remove(this.pairs);
  37457. this.pairs.n2.shape.pairs.inlined_try_remove(this.pairs);
  37458. var b = this.pairs;
  37459. b.n1 = b.n2 = null;
  37460. b.sleeping = !1;
  37461. b.next = c.space.ZPP_AABBPair.zpp_pool;
  37462. c.space.ZPP_AABBPair.zpp_pool = b;
  37463. this.pairs = a
  37464. }
  37465. this.dtree.clear();
  37466. this.stree.clear()
  37467. },
  37468. broadphase: function (a, b) {
  37469. for (var d = this.syncs; null != d;) {
  37470. var g = d.shape;
  37471. if (d.first_sync) d.first_sync = !1;
  37472. else {
  37473. var e = d.dyn ? this.dtree : this.stree;
  37474. e.inlined_removeLeaf(d)
  37475. }
  37476. e = d.aabb;
  37477. !a.continuous && g.zip_aabb && null != g.body &&
  37478. (g.zip_aabb = !1, g.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? g.circle.__validate_aabb() : g.polygon.__validate_aabb());
  37479. e.setExpand(g.aabb, 3);
  37480. e = (d.dyn = g.body.type == c.util.ZPP_Flags.id_BodyType_STATIC ? !1 : !g.body.component.sleeping) ? this.dtree : this.stree;
  37481. e.inlined_insertLeaf(d);
  37482. d.synced = !1;
  37483. d = d.snext
  37484. }
  37485. for (; null != this.syncs;)
  37486. if (d = function (a) {
  37487. var b = a.syncs;
  37488. a.syncs = b.snext;
  37489. b.snext = null;
  37490. return b
  37491. }(this), !d.moved && (d.moved = !1, e = d.shape, g = e.body, !g.component.sleeping)) {
  37492. var f = d.aabb,
  37493. l = null;
  37494. null != this.dtree.root &&
  37495. (this.dtree.root.next = l, l = this.dtree.root);
  37496. for (; null != l;) {
  37497. var h = function (a) {
  37498. a = l;
  37499. l = a.next;
  37500. a.next = null;
  37501. return a
  37502. }(this);
  37503. if (h != d)
  37504. if (null == h.child1) {
  37505. if (g = h.shape, g.body != e.body && (g.body.type != c.util.ZPP_Flags.id_BodyType_STATIC || e.body.type != c.util.ZPP_Flags.id_BodyType_STATIC) && f.intersect(h.aabb)) {
  37506. var k, p;
  37507. e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
  37508. for (var n = e.pairs.length < g.pairs.length ? e : g, r = null, n = n.pairs.head; null != n;) {
  37509. var q = n.elt;
  37510. if (q.id == k && q.di == p) {
  37511. r = q;
  37512. break
  37513. }
  37514. n = n.next
  37515. }
  37516. null != r ? r.sleeping && (r.sleeping = !1, r.next = this.pairs, this.pairs = r, r.first = !0) : (null == c.space.ZPP_AABBPair.zpp_pool ? r = new c.space.ZPP_AABBPair : (r = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = r.next, r.next = null), null, r.n1 = d, r.n2 = h, r.id = k, r.di = p, r.next = this.pairs, this.pairs = r, r.first = !0, e.pairs.inlined_add(r), g.pairs.inlined_add(r))
  37517. }
  37518. } else f.intersect(h.aabb) && (null != h.child1 && (h.child1.next = l, l = h.child1), null != h.child2 && (h.child2.next = l, l = h.child2))
  37519. }
  37520. null != this.stree.root && (this.stree.root.next = l, l = this.stree.root);
  37521. for (; null !=
  37522. l;)
  37523. if (h = function (a) {
  37524. a = l;
  37525. l = a.next;
  37526. a.next = null;
  37527. return a
  37528. }(this), h != d)
  37529. if (null == h.child1) {
  37530. if (g = h.shape, g.body != e.body && (g.body.type != c.util.ZPP_Flags.id_BodyType_STATIC || e.body.type != c.util.ZPP_Flags.id_BodyType_STATIC) && f.intersect(h.aabb)) {
  37531. e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
  37532. n = e.pairs.length < g.pairs.length ? e : g;
  37533. r = null;
  37534. for (n = n.pairs.head; null != n;) {
  37535. q = n.elt;
  37536. if (q.id == k && q.di == p) {
  37537. r = q;
  37538. break
  37539. }
  37540. n = n.next
  37541. }
  37542. null != r ? r.sleeping && (r.sleeping = !1, r.next = this.pairs, this.pairs = r, r.first = !0) : (null == c.space.ZPP_AABBPair.zpp_pool ?
  37543. r = new c.space.ZPP_AABBPair : (r = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = r.next, r.next = null), null, r.n1 = d, r.n2 = h, r.id = k, r.di = p, r.next = this.pairs, this.pairs = r, r.first = !0, e.pairs.inlined_add(r), g.pairs.inlined_add(r))
  37544. }
  37545. } else f.intersect(h.aabb) && (null != h.child1 && (h.child1.next = l, l = h.child1), null != h.child2 && (h.child2.next = l, l = h.child2))
  37546. }
  37547. for (; null != this.moves;)
  37548. if (d = function (a) {
  37549. var b = a.moves;
  37550. a.moves = b.mnext;
  37551. b.mnext = null;
  37552. return b
  37553. }(this), d.moved = !1, e = d.shape, g = e.body, !g.component.sleeping) {
  37554. f =
  37555. d.aabb;
  37556. l = null;
  37557. null != this.dtree.root && (this.dtree.root.next = l, l = this.dtree.root);
  37558. for (; null != l;)
  37559. if (h = function (a) {
  37560. a = l;
  37561. l = a.next;
  37562. a.next = null;
  37563. return a
  37564. }(this), h != d)
  37565. if (null == h.child1) {
  37566. if (g = h.shape, g.body != e.body && (g.body.type != c.util.ZPP_Flags.id_BodyType_STATIC || e.body.type != c.util.ZPP_Flags.id_BodyType_STATIC) && f.intersect(h.aabb)) {
  37567. e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
  37568. n = e.pairs.length < g.pairs.length ? e : g;
  37569. r = null;
  37570. for (n = n.pairs.head; null != n;) {
  37571. q = n.elt;
  37572. if (q.id == k && q.di == p) {
  37573. r = q;
  37574. break
  37575. }
  37576. n = n.next
  37577. }
  37578. null != r ? r.sleeping &&
  37579. (r.sleeping = !1, r.next = this.pairs, this.pairs = r, r.first = !0) : (null == c.space.ZPP_AABBPair.zpp_pool ? r = new c.space.ZPP_AABBPair : (r = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = r.next, r.next = null), null, r.n1 = d, r.n2 = h, r.id = k, r.di = p, r.next = this.pairs, this.pairs = r, r.first = !0, e.pairs.inlined_add(r), g.pairs.inlined_add(r))
  37580. }
  37581. } else f.intersect(h.aabb) && (null != h.child1 && (h.child1.next = l, l = h.child1), null != h.child2 && (h.child2.next = l, l = h.child2));
  37582. null != this.stree.root && (this.stree.root.next = l, l = this.stree.root);
  37583. for (; null != l;)
  37584. if (h = function (a) {
  37585. a = l;
  37586. l = a.next;
  37587. a.next = null;
  37588. return a
  37589. }(this), h != d)
  37590. if (null == h.child1) {
  37591. if (g = h.shape, g.body != e.body && (g.body.type != c.util.ZPP_Flags.id_BodyType_STATIC || e.body.type != c.util.ZPP_Flags.id_BodyType_STATIC) && f.intersect(h.aabb)) {
  37592. e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
  37593. n = e.pairs.length < g.pairs.length ? e : g;
  37594. r = null;
  37595. for (n = n.pairs.head; null != n;) {
  37596. q = n.elt;
  37597. if (q.id == k && q.di == p) {
  37598. r = q;
  37599. break
  37600. }
  37601. n = n.next
  37602. }
  37603. null != r ? r.sleeping && (r.sleeping = !1, r.next = this.pairs, this.pairs = r, r.first = !0) : (null == c.space.ZPP_AABBPair.zpp_pool ?
  37604. r = new c.space.ZPP_AABBPair : (r = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = r.next, r.next = null), null, r.n1 = d, r.n2 = h, r.id = k, r.di = p, r.next = this.pairs, this.pairs = r, r.first = !0, e.pairs.inlined_add(r), g.pairs.inlined_add(r))
  37605. }
  37606. } else f.intersect(h.aabb) && (null != h.child1 && (h.child1.next = l, l = h.child1), null != h.child2 && (h.child2.next = l, l = h.child2))
  37607. }
  37608. g = null;
  37609. for (d = this.pairs; null != d;) d.first || d.n1.aabb.intersect(d.n2.aabb) ? (e = d.n1.shape, f = e.body, h = d.n2.shape, k = h.body, d.first || !f.component.sleeping &&
  37610. f.type != c.util.ZPP_Flags.id_BodyType_STATIC || !k.component.sleeping && k.type != c.util.ZPP_Flags.id_BodyType_STATIC ? (d.first = !1, e.aabb.intersect(h.aabb) && (g = d.arb, d.arb = b ? a.narrowPhase(e, h, f.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || k.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC, d.arb, !1) : a.continuousEvent(e, h, f.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || k.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC, d.arb, !1), null == d.arb ? null != g && (g.pair = null) : d.arb.pair = d), g = d) : (d.sleeping = !0, null == g ? this.pairs = d.next :
  37611. g.next = d.next), d = d.next) : (null == g ? this.pairs = d.next : g.next = d.next, d.n1.shape.pairs.inlined_try_remove(d), d.n2.shape.pairs.inlined_try_remove(d), e = d.next, null != d.arb && (d.arb.pair = null), d.arb = null, d.n1 = d.n2 = null, d.sleeping = !1, d.next = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = d, d = e)
  37612. },
  37613. sync_broadphase: function () {
  37614. this.space.validation();
  37615. if (null != this.syncs)
  37616. if (null == this.moves) {
  37617. for (var a = this.syncs; null != a;) {
  37618. var b = a.shape;
  37619. if (a.first_sync) a.first_sync = !1;
  37620. else {
  37621. var d = a.dyn ? this.dtree : this.stree;
  37622. d.inlined_removeLeaf(a)
  37623. }
  37624. d = a.aabb;
  37625. !this.space.continuous && b.zip_aabb && null != b.body && (b.zip_aabb = !1, b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? b.circle.__validate_aabb() : b.polygon.__validate_aabb());
  37626. d.setExpand(b.aabb, 3);
  37627. d = (a.dyn = b.body.type == c.util.ZPP_Flags.id_BodyType_STATIC ? !1 : !b.body.component.sleeping) ? this.dtree : this.stree;
  37628. d.inlined_insertLeaf(a);
  37629. a.synced = !1;
  37630. a.moved = !0;
  37631. a.mnext = a.snext;
  37632. a.snext = null;
  37633. a = a.mnext
  37634. }
  37635. a = this.syncs;
  37636. this.syncs = this.moves;
  37637. this.moves = a
  37638. } else
  37639. for (; null != this.syncs;) a = void 0,
  37640. a = this.syncs, this.syncs = a.snext, a.snext = null, b = a.shape, a.first_sync ? a.first_sync = !1 : (d = a.dyn ? this.dtree : this.stree, d.inlined_removeLeaf(a)), d = a.aabb, !this.space.continuous && b.zip_aabb && null != b.body && (b.zip_aabb = !1, b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? b.circle.__validate_aabb() : b.polygon.__validate_aabb()), d.setExpand(b.aabb, 3), d = (a.dyn = b.body.type == c.util.ZPP_Flags.id_BodyType_STATIC ? !1 : !b.body.component.sleeping) ? this.dtree : this.stree, d.inlined_insertLeaf(a), a.synced = !1, a.moved || (a.moved = !0, a.mnext = this.moves, this.moves = a)
  37641. },
  37642. __sync: function (a) {
  37643. var b = a.node;
  37644. b.synced || (!this.space.continuous && a.zip_aabb && null != a.body && (a.zip_aabb = !1, a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.__validate_aabb() : a.polygon.__validate_aabb()), b.dyn == (a.body.type == c.util.ZPP_Flags.id_BodyType_STATIC ? !1 : !a.body.component.sleeping) && b.aabb.contains(a.aabb) || (b.synced = !0, b.snext = this.syncs, this.syncs = b))
  37645. },
  37646. __remove: function (a) {
  37647. var b = a.node;
  37648. b.first_sync || (b.dyn ? this.dtree.removeLeaf(b) : this.stree.removeLeaf(b));
  37649. a.node = null;
  37650. if (b.synced) {
  37651. for (var d = null, g = this.syncs; null != g && g != b;) d = g, g = g.snext;
  37652. null == d ? this.syncs = g.snext : d.snext = g.snext;
  37653. g.snext = null;
  37654. b.synced = !1
  37655. }
  37656. if (b.moved) {
  37657. d = null;
  37658. for (g = this.moves; null != g && g != b;) d = g, g = g.mnext;
  37659. null == d ? this.moves = g.mnext : d.mnext = g.mnext;
  37660. g.mnext = null;
  37661. b.moved = !1
  37662. }
  37663. d = null;
  37664. for (g = this.pairs; null != g;) {
  37665. var e = g.next;
  37666. g.n1 == b || g.n2 == b ? (null == d ? this.pairs = e : d.next = e, null != g.arb && (g.arb.pair = null), g.arb = null, g.n1.shape.pairs.remove(g), g.n2.shape.pairs.remove(g), g.n1 = g.n2 = null, g.sleeping = !1,
  37667. g.next = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = g) : d = g;
  37668. g = e
  37669. }
  37670. for (; null != a.pairs.head;) d = a.pairs.pop_unsafe(), d.n1 == b ? d.n2.shape.pairs.remove(d) : d.n1.shape.pairs.remove(d), null != d.arb && (d.arb.pair = null), d.arb = null, g = d, g.n1 = g.n2 = null, g.sleeping = !1, g.next = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = g;
  37671. g = b;
  37672. g.free();
  37673. g.next = c.space.ZPP_AABBNode.zpp_pool;
  37674. c.space.ZPP_AABBNode.zpp_pool = g
  37675. },
  37676. __insert: function (a) {
  37677. var b;
  37678. null == c.space.ZPP_AABBNode.zpp_pool ? b = new c.space.ZPP_AABBNode :
  37679. (b = c.space.ZPP_AABBNode.zpp_pool, c.space.ZPP_AABBNode.zpp_pool = b.next, b.next = null);
  37680. null == c.geom.ZPP_AABB.zpp_pool ? b.aabb = new c.geom.ZPP_AABB : (b.aabb = c.geom.ZPP_AABB.zpp_pool, c.geom.ZPP_AABB.zpp_pool = b.aabb.next, b.aabb.next = null);
  37681. null;
  37682. b.moved = !1;
  37683. b.synced = !1;
  37684. b.first_sync = !1;
  37685. b.shape = a;
  37686. a.node = b;
  37687. b.synced = !0;
  37688. b.first_sync = !0;
  37689. b.snext = this.syncs;
  37690. this.syncs = b
  37691. },
  37692. dyn: function (a) {
  37693. return a.body.type == c.util.ZPP_Flags.id_BodyType_STATIC ? !1 : !a.body.component.sleeping
  37694. },
  37695. __class__: c.space.ZPP_DynAABBPhase
  37696. });
  37697. c.space.ZPP_Island =
  37698. function () {
  37699. this.waket = 0;
  37700. this.sleep = !1;
  37701. this.comps = null;
  37702. this.length = 0;
  37703. this._inuse = this.modified = this.pushmod = !1;
  37704. this.next = null;
  37705. this.comps = new c.util.ZNPList_ZPP_Component
  37706. };
  37707. s["zpp_nape.space.ZPP_Island"] = c.space.ZPP_Island;
  37708. c.space.ZPP_Island.__name__ = ["zpp_nape", "space", "ZPP_Island"];
  37709. c.space.ZPP_Island.prototype = {
  37710. alloc: function () {
  37711. this.waket = 0
  37712. },
  37713. free: function () {},
  37714. at: function (a) {
  37715. a = this.iterator_at(a);
  37716. return null != a ? a : null
  37717. },
  37718. iterator_at: function (a) {
  37719. for (var b = this.next; 0 < a-- && null != b;) b = b.next;
  37720. return b
  37721. },
  37722. back: function () {
  37723. for (var a =
  37724. this.next, b = a; null != b;) a = b, b = b.next;
  37725. return a
  37726. },
  37727. front: function () {
  37728. return this.next
  37729. },
  37730. inlined_has: function (a) {
  37731. var b;
  37732. b = !1;
  37733. for (var d = this.next; null != d;) {
  37734. if (d == a) {
  37735. b = !0;
  37736. break
  37737. }
  37738. d = d.next
  37739. }
  37740. return b
  37741. },
  37742. has: function (a) {
  37743. return this.inlined_has(a)
  37744. },
  37745. size: function () {
  37746. return this.length
  37747. },
  37748. empty: function () {
  37749. return null == this.next
  37750. },
  37751. reverse: function () {
  37752. for (var a = this.next, b = null; null != a;) {
  37753. var d = a.next;
  37754. a.next = b;
  37755. b = this.next = a;
  37756. a = d
  37757. }
  37758. this.pushmod = this.modified = !0
  37759. },
  37760. inlined_clear: function () {},
  37761. clear: function () {},
  37762. splice: function (a, b) {
  37763. for (; 0 <
  37764. b-- && null != a.next;) this.erase(a);
  37765. return a.next
  37766. },
  37767. inlined_erase: function (a) {
  37768. var b, d;
  37769. null == a ? (b = this.next, this.next = d = b.next, null == this.next && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  37770. b._inuse = !1;
  37771. this.modified = !0;
  37772. this.length--;
  37773. this.pushmod = !0;
  37774. return d
  37775. },
  37776. erase: function (a) {
  37777. return this.inlined_erase(a)
  37778. },
  37779. inlined_try_remove: function (a) {
  37780. for (var b = null, d = this.next, c = !1; null != d;) {
  37781. if (d == a) {
  37782. this.inlined_erase(b);
  37783. c = !0;
  37784. break
  37785. }
  37786. b = d;
  37787. d = d.next
  37788. }
  37789. return c
  37790. },
  37791. inlined_remove: function (a) {
  37792. this.inlined_try_remove(a)
  37793. },
  37794. try_remove: function (a) {
  37795. for (var b = null, d = this.next, c = !1; null != d;) {
  37796. if (d == a) {
  37797. this.erase(b);
  37798. c = !0;
  37799. break
  37800. }
  37801. b = d;
  37802. d = d.next
  37803. }
  37804. return c
  37805. },
  37806. remove: function (a) {
  37807. this.inlined_try_remove(a)
  37808. },
  37809. inlined_pop_unsafe: function () {
  37810. var a = this.next;
  37811. this.pop();
  37812. return a
  37813. },
  37814. pop_unsafe: function () {
  37815. return this.inlined_pop_unsafe()
  37816. },
  37817. inlined_pop: function () {
  37818. var a = this.next;
  37819. this.next = a.next;
  37820. a._inuse = !1;
  37821. null == this.next && (this.pushmod = !0);
  37822. this.modified = !0;
  37823. this.length--
  37824. },
  37825. pop: function () {
  37826. this.inlined_pop()
  37827. },
  37828. inlined_insert: function (a, b) {
  37829. b._inuse = !0;
  37830. null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
  37831. this.pushmod = this.modified = !0;
  37832. this.length++;
  37833. return b
  37834. },
  37835. insert: function (a, b) {
  37836. return this.inlined_insert(a, b)
  37837. },
  37838. addAll: function (a) {
  37839. for (a = a.next; null != a;) this.add(a), a = a.next
  37840. },
  37841. inlined_add: function (a) {
  37842. a._inuse = !0;
  37843. a.next = this.next;
  37844. this.next = a;
  37845. this.modified = !0;
  37846. this.length++;
  37847. return a
  37848. },
  37849. add: function (a) {
  37850. return this.inlined_add(a)
  37851. },
  37852. setbegin: function (a) {
  37853. this.next = a;
  37854. this.pushmod = this.modified = !0
  37855. },
  37856. begin: function () {
  37857. return this.next
  37858. },
  37859. elem: function () {
  37860. return this
  37861. },
  37862. __class__: c.space.ZPP_Island
  37863. };
  37864. c.space.ZPP_Component = function () {
  37865. this.woken = !1;
  37866. this.waket = 0;
  37867. this.sleeping = !1;
  37868. this.body = this.constraint = this.island = null;
  37869. this.isBody = !1;
  37870. this.rank = 0;
  37871. this.next = this.parent = null;
  37872. this.sleeping = !1;
  37873. this.island = null;
  37874. this.parent = this;
  37875. this.rank = 0;
  37876. this.woken = !1
  37877. };
  37878. s["zpp_nape.space.ZPP_Component"] = c.space.ZPP_Component;
  37879. c.space.ZPP_Component.__name__ = ["zpp_nape", "space", "ZPP_Component"];
  37880. c.space.ZPP_Component.prototype = {
  37881. reset: function () {
  37882. this.sleeping = !1;
  37883. this.island = null;
  37884. this.parent =
  37885. this;
  37886. this.rank = 0
  37887. },
  37888. alloc: function () {},
  37889. free: function () {
  37890. this.constraint = this.body = null
  37891. },
  37892. __class__: c.space.ZPP_Component
  37893. };
  37894. c.space.ZPP_CallbackSet = function () {
  37895. this.freed = this.lazydel = !1;
  37896. this.length = 0;
  37897. this._inuse = this.modified = this.pushmod = !1;
  37898. this.int1 = this.int2 = this.next = null;
  37899. this.id = this.di = 0;
  37900. this.arbiters = new c.util.ZNPList_ZPP_Arbiter
  37901. };
  37902. s["zpp_nape.space.ZPP_CallbackSet"] = c.space.ZPP_CallbackSet;
  37903. c.space.ZPP_CallbackSet.__name__ = ["zpp_nape", "space", "ZPP_CallbackSet"];
  37904. c.space.ZPP_CallbackSet.get = function (a,
  37905. b) {
  37906. var d;
  37907. null == c.space.ZPP_CallbackSet.zpp_pool ? d = new c.space.ZPP_CallbackSet : (d = c.space.ZPP_CallbackSet.zpp_pool, c.space.ZPP_CallbackSet.zpp_pool = d.next, d.next = null);
  37908. d.freed = !1;
  37909. d.lazydel = !1;
  37910. d.COLLISIONstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
  37911. d.COLLISIONstamp = 0;
  37912. d.SENSORstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
  37913. d.SENSORstamp = 0;
  37914. d.FLUIDstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
  37915. d.FLUIDstamp = 0;
  37916. a.id < b.id ? (d.int1 = a, d.int2 = b) : (d.int1 = b, d.int2 = a);
  37917. d.id = d.int1.id;
  37918. d.di = d.int2.id;
  37919. return d
  37920. };
  37921. c.space.ZPP_CallbackSet.prototype = {
  37922. sleeping: function () {
  37923. var a;
  37924. a = !0;
  37925. for (var b = this.arbiters.head; null != b;)
  37926. if (b.elt.sleeping) b = b.next;
  37927. else {
  37928. a = !1;
  37929. break
  37930. }
  37931. return a
  37932. },
  37933. really_empty: function () {
  37934. return null == this.arbiters.head
  37935. },
  37936. empty_arb: function (a) {
  37937. var b;
  37938. b = !0;
  37939. for (var d = this.arbiters.head; null != d;)
  37940. if (0 == (d.elt.type & a)) d = d.next;
  37941. else {
  37942. b = !1;
  37943. break
  37944. }
  37945. return b
  37946. },
  37947. remove_arb: function (a) {
  37948. this.arbiters.inlined_try_remove(a)
  37949. },
  37950. try_remove_arb: function (a) {
  37951. return this.arbiters.inlined_try_remove(a)
  37952. },
  37953. add_arb: function (a) {
  37954. if (this.arbiters.inlined_has(a)) return !1;
  37955. this.arbiters.inlined_add(a);
  37956. return !0
  37957. },
  37958. alloc: function () {
  37959. this.lazydel = this.freed = !1;
  37960. this.COLLISIONstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
  37961. this.COLLISIONstamp = 0;
  37962. this.SENSORstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
  37963. this.SENSORstamp = 0;
  37964. this.FLUIDstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
  37965. this.FLUIDstamp = 0
  37966. },
  37967. free: function () {
  37968. this.int1 = this.int2 = null;
  37969. this.id = this.di = -1;
  37970. this.freed = !0
  37971. },
  37972. at: function (a) {
  37973. a = this.iterator_at(a);
  37974. return null != a ? a : null
  37975. },
  37976. iterator_at: function (a) {
  37977. for (var b = this.next; 0 < a-- && null != b;) b = b.next;
  37978. return b
  37979. },
  37980. back: function () {
  37981. for (var a =
  37982. this.next, b = a; null != b;) a = b, b = b.next;
  37983. return a
  37984. },
  37985. front: function () {
  37986. return this.next
  37987. },
  37988. inlined_has: function (a) {
  37989. var b;
  37990. b = !1;
  37991. for (var d = this.next; null != d;) {
  37992. if (d == a) {
  37993. b = !0;
  37994. break
  37995. }
  37996. d = d.next
  37997. }
  37998. return b
  37999. },
  38000. has: function (a) {
  38001. return this.inlined_has(a)
  38002. },
  38003. size: function () {
  38004. return this.length
  38005. },
  38006. empty: function () {
  38007. return null == this.next
  38008. },
  38009. reverse: function () {
  38010. for (var a = this.next, b = null; null != a;) {
  38011. var d = a.next;
  38012. a.next = b;
  38013. b = this.next = a;
  38014. a = d
  38015. }
  38016. this.pushmod = this.modified = !0
  38017. },
  38018. inlined_clear: function () {},
  38019. clear: function () {},
  38020. splice: function (a, b) {
  38021. for (; 0 <
  38022. b-- && null != a.next;) this.erase(a);
  38023. return a.next
  38024. },
  38025. inlined_erase: function (a) {
  38026. var b, d;
  38027. null == a ? (b = this.next, this.next = d = b.next, null == this.next && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  38028. b._inuse = !1;
  38029. this.modified = !0;
  38030. this.length--;
  38031. this.pushmod = !0;
  38032. return d
  38033. },
  38034. erase: function (a) {
  38035. return this.inlined_erase(a)
  38036. },
  38037. inlined_try_remove: function (a) {
  38038. for (var b = null, d = this.next, c = !1; null != d;) {
  38039. if (d == a) {
  38040. this.inlined_erase(b);
  38041. c = !0;
  38042. break
  38043. }
  38044. b = d;
  38045. d = d.next
  38046. }
  38047. return c
  38048. },
  38049. inlined_remove: function (a) {
  38050. this.inlined_try_remove(a)
  38051. },
  38052. try_remove: function (a) {
  38053. for (var b = null, d = this.next, c = !1; null != d;) {
  38054. if (d == a) {
  38055. this.erase(b);
  38056. c = !0;
  38057. break
  38058. }
  38059. b = d;
  38060. d = d.next
  38061. }
  38062. return c
  38063. },
  38064. remove: function (a) {
  38065. this.inlined_try_remove(a)
  38066. },
  38067. inlined_pop_unsafe: function () {
  38068. var a = this.next;
  38069. this.pop();
  38070. return a
  38071. },
  38072. pop_unsafe: function () {
  38073. return this.inlined_pop_unsafe()
  38074. },
  38075. inlined_pop: function () {
  38076. var a = this.next;
  38077. this.next = a.next;
  38078. a._inuse = !1;
  38079. null == this.next && (this.pushmod = !0);
  38080. this.modified = !0;
  38081. this.length--
  38082. },
  38083. pop: function () {
  38084. this.inlined_pop()
  38085. },
  38086. inlined_insert: function (a, b) {
  38087. b._inuse = !0;
  38088. null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
  38089. this.pushmod = this.modified = !0;
  38090. this.length++;
  38091. return b
  38092. },
  38093. insert: function (a, b) {
  38094. return this.inlined_insert(a, b)
  38095. },
  38096. addAll: function (a) {
  38097. for (a = a.next; null != a;) this.add(a), a = a.next
  38098. },
  38099. inlined_add: function (a) {
  38100. a._inuse = !0;
  38101. a.next = this.next;
  38102. this.next = a;
  38103. this.modified = !0;
  38104. this.length++;
  38105. return a
  38106. },
  38107. add: function (a) {
  38108. return this.inlined_add(a)
  38109. },
  38110. setbegin: function (a) {
  38111. this.next = a;
  38112. this.pushmod = this.modified = !0
  38113. },
  38114. begin: function () {
  38115. return this.next
  38116. },
  38117. elem: function () {
  38118. return this
  38119. },
  38120. __class__: c.space.ZPP_CallbackSet
  38121. };
  38122. c.space.ZPP_CbSetManager = function (a) {
  38123. this.cbsets = this.space = null;
  38124. null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ? this.cbsets = new c.util.ZPP_Set_ZPP_CbSet : (this.cbsets = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool = this.cbsets.next, this.cbsets.next = null);
  38125. null;
  38126. this.cbsets.lt = c.callbacks.ZPP_CbSet.setlt;
  38127. this.space = a
  38128. };
  38129. s["zpp_nape.space.ZPP_CbSetManager"] = c.space.ZPP_CbSetManager;
  38130. c.space.ZPP_CbSetManager.__name__ = ["zpp_nape", "space", "ZPP_CbSetManager"];
  38131. c.space.ZPP_CbSetManager.prototype = {
  38132. valid_listener: function (a) {
  38133. return a.space == this.space
  38134. },
  38135. pair: function (a, b) {
  38136. for (var d = null, g = (a.cbpairs.length < b.cbpairs.length ? a.cbpairs : b.cbpairs).head; null != g;) {
  38137. var e = g.elt;
  38138. if (e.a == a && e.b == b || e.a == b && e.b == a) {
  38139. d = e;
  38140. break
  38141. }
  38142. g = g.next
  38143. }
  38144. null == d && (d = c.callbacks.ZPP_CbSetPair.get(a, b), a.cbpairs.add(d), b != a && b.cbpairs.add(d));
  38145. d.zip_listeners && (d.zip_listeners = !1, d.__validate());
  38146. return d
  38147. },
  38148. validate: function () {
  38149. if (!this.cbsets.empty()) {
  38150. for (var a = this.cbsets.parent; null != a.prev;) a = a.prev;
  38151. for (; null != a;)
  38152. if (a.data.validate(),
  38153. null != a.next)
  38154. for (a = a.next; null != a.prev;) a = a.prev;
  38155. else {
  38156. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  38157. a = a.parent
  38158. }
  38159. }
  38160. },
  38161. clear: function () {},
  38162. remove: function (a) {
  38163. for (this.cbsets.remove(a); null != a.cbpairs.head;) {
  38164. var b = a.cbpairs.pop_unsafe();
  38165. b.a != b.b && (a == b.a ? b.b.cbpairs.remove(b) : b.a.cbpairs.remove(b));
  38166. b.a = b.b = null;
  38167. b.listeners.clear();
  38168. b.next = c.callbacks.ZPP_CbSetPair.zpp_pool;
  38169. c.callbacks.ZPP_CbSetPair.zpp_pool = b
  38170. }
  38171. a.manager = null
  38172. },
  38173. get: function (a) {
  38174. if (null == a.head) return null;
  38175. var b;
  38176. null == c.callbacks.ZPP_CbSet.zpp_pool ?
  38177. b = new c.callbacks.ZPP_CbSet : (b = c.callbacks.ZPP_CbSet.zpp_pool, c.callbacks.ZPP_CbSet.zpp_pool = b.next, b.next = null);
  38178. null;
  38179. var d = b.cbTypes;
  38180. b.cbTypes = a;
  38181. var g = this.cbsets.find_weak(b);
  38182. null != g ? a = g.data : (a = c.callbacks.ZPP_CbSet.get(a), this.cbsets.insert(a), a.manager = this);
  38183. b.cbTypes = d;
  38184. b.free();
  38185. b.next = c.callbacks.ZPP_CbSet.zpp_pool;
  38186. c.callbacks.ZPP_CbSet.zpp_pool = b;
  38187. return a
  38188. },
  38189. __class__: c.space.ZPP_CbSetManager
  38190. };
  38191. c.space.ZPP_Space = function (a, b) {
  38192. this.precb = this.prelisteners = null;
  38193. this.continuous = !1;
  38194. this.toiEvents =
  38195. null;
  38196. this.pre_dt = 0;
  38197. this.c_arbiters_true = this.c_arbiters_false = this.f_arbiters = this.s_arbiters = this.wrap_arbiters = this.live = this.wrap_live = this.live_constraints = this.wrap_livecon = this.staticsleep = this.islands = this.listeners = this.wrap_listeners = this.callbacks = this.callbackset_list = this.cbsets = this.convexShapeList = null;
  38198. this.sortcontacts = !1;
  38199. this.time = 0;
  38200. this.midstep = !1;
  38201. this.global_lin_drag = this.global_ang_drag = this.stamp = 0;
  38202. this.wrap_gravity = this.bodies = this.wrap_bodies = this.compounds = this.wrap_compounds =
  38203. this.constraints = this.wrap_constraints = this.kinematics = this.bphase = this.__static = null;
  38204. this.gravityx = this.gravityy = 0;
  38205. this.outer = this.userData = null;
  38206. this.toiEvents = new c.util.ZNPList_ZPP_ToiEvent;
  38207. this.global_ang_drag = this.global_lin_drag = 0.015;
  38208. c.callbacks.ZPP_Callback.internal = !0;
  38209. this.precb = new h.callbacks.PreCallback;
  38210. this.precb.zpp_inner = new c.callbacks.ZPP_Callback;
  38211. c.callbacks.ZPP_Callback.internal = !1;
  38212. this.sortcontacts = !0;
  38213. this.pre_dt = 0;
  38214. var d;
  38215. (d = null == b) || (null == c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE &&
  38216. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE = new h.space.Broadphase, c.util.ZPP_Flags.internal = !1), d = b == c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE);
  38217. d ? this.bphase = new c.space.ZPP_DynAABBPhase(this) : (null == c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE = new h.space.Broadphase, c.util.ZPP_Flags.internal = !1), b == c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE && (this.bphase = new c.space.ZPP_SweepPhase(this)));
  38218. this.time = 0;
  38219. null != a ? (this.gravityx = a.x, this.gravityy = a.y) : this.gravityy = this.gravityx = 0;
  38220. this.bodies = new c.util.ZNPList_ZPP_Body;
  38221. this.wrap_bodies = c.util.ZPP_BodyList.get(this.bodies);
  38222. this.wrap_bodies.zpp_inner.adder = A(this, this.bodies_adder);
  38223. this.wrap_bodies.zpp_inner.subber = A(this, this.bodies_subber);
  38224. this.wrap_bodies.zpp_inner._modifiable = A(this, this.bodies_modifiable);
  38225. this.compounds = new c.util.ZNPList_ZPP_Compound;
  38226. this.wrap_compounds = c.util.ZPP_CompoundList.get(this.compounds);
  38227. this.wrap_compounds.zpp_inner.adder =
  38228. A(this, this.compounds_adder);
  38229. this.wrap_compounds.zpp_inner.subber = A(this, this.compounds_subber);
  38230. this.wrap_compounds.zpp_inner._modifiable = A(this, this.compounds_modifiable);
  38231. this.kinematics = new c.util.ZNPList_ZPP_Body;
  38232. this.c_arbiters_true = new c.util.ZNPList_ZPP_ColArbiter;
  38233. this.c_arbiters_false = new c.util.ZNPList_ZPP_ColArbiter;
  38234. this.f_arbiters = new c.util.ZNPList_ZPP_FluidArbiter;
  38235. this.s_arbiters = new c.util.ZNPList_ZPP_SensorArbiter;
  38236. this.islands = new c.space.ZPP_Island;
  38237. this.live = new c.util.ZNPList_ZPP_Body;
  38238. this.wrap_live = c.util.ZPP_BodyList.get(this.live, !0);
  38239. this.staticsleep = new c.util.ZNPList_ZPP_Body;
  38240. this.constraints = new c.util.ZNPList_ZPP_Constraint;
  38241. this.wrap_constraints = c.util.ZPP_ConstraintList.get(this.constraints);
  38242. this.wrap_constraints.zpp_inner.adder = A(this, this.constraints_adder);
  38243. this.wrap_constraints.zpp_inner.subber = A(this, this.constraints_subber);
  38244. this.wrap_constraints.zpp_inner._modifiable = A(this, this.constraints_modifiable);
  38245. this.live_constraints = new c.util.ZNPList_ZPP_Constraint;
  38246. this.wrap_livecon =
  38247. c.util.ZPP_ConstraintList.get(this.live_constraints, !0);
  38248. this.__static = c.phys.ZPP_Body.__static();
  38249. this.__static.zpp_inner.space = this;
  38250. this.callbacks = new c.callbacks.ZPP_Callback;
  38251. this.midstep = !1;
  38252. this.listeners = new c.util.ZNPList_ZPP_Listener;
  38253. this.wrap_listeners = c.util.ZPP_ListenerList.get(this.listeners);
  38254. this.wrap_listeners.zpp_inner.adder = A(this, this.listeners_adder);
  38255. this.wrap_listeners.zpp_inner.subber = A(this, this.listeners_subber);
  38256. this.wrap_listeners.zpp_inner._modifiable = A(this, this.listeners_modifiable);
  38257. this.callbackset_list = new c.space.ZPP_CallbackSet;
  38258. this.mrca1 = new c.util.ZNPList_ZPP_Interactor;
  38259. this.mrca2 = new c.util.ZNPList_ZPP_Interactor;
  38260. this.prelisteners = new c.util.ZNPList_ZPP_InteractionListener;
  38261. this.cbsets = new c.space.ZPP_CbSetManager(this)
  38262. };
  38263. s["zpp_nape.space.ZPP_Space"] = c.space.ZPP_Space;
  38264. c.space.ZPP_Space.__name__ = ["zpp_nape", "space", "ZPP_Space"];
  38265. c.space.ZPP_Space.prototype = {
  38266. inlined_MRCA_chains: function (a, b) {
  38267. this.mrca1.inlined_clear();
  38268. this.mrca2.inlined_clear();
  38269. null != a.cbSet && this.mrca1.inlined_add(a);
  38270. null != a.body.cbSet && this.mrca1.inlined_add(a.body);
  38271. null != b.cbSet && this.mrca2.inlined_add(b);
  38272. null != b.body.cbSet && this.mrca2.inlined_add(b.body);
  38273. for (var d = a.body.compound, c = b.body.compound; d != c;)(null == d ? 0 : d.depth) < (null == c ? 0 : c.depth) ? (null != c.cbSet && this.mrca2.inlined_add(c), c = c.compound) : (null != d.cbSet && this.mrca1.inlined_add(d), d = d.compound)
  38274. },
  38275. MRCA_chains: function (a, b) {
  38276. this.inlined_MRCA_chains(a, b)
  38277. },
  38278. narrowPhase: function (a, b, d, g, e) {
  38279. var f = this,
  38280. l = null,
  38281. m = a.body,
  38282. k = b.body,
  38283. p = this.interactionType(a, b, m, k);
  38284. if (-1 != p) {
  38285. var n, q;
  38286. a.type > b.type ? (n = b, q = a) : a.type == b.type ? a.id < b.id ? (n = a, q = b) : (q = a, n = b) : (n = a, q = b);
  38287. var s = n == b;
  38288. if (0 == p) {
  38289. g = null == g ? function (a) {
  38290. a = null;
  38291. for (var b = (m.arbiters.length < k.arbiters.length ? m : k).arbiters.head; null != b;) {
  38292. var d = b.elt;
  38293. if (d.id == n.id && d.di == q.id) {
  38294. a = d;
  38295. break
  38296. }
  38297. b = b.next
  38298. }
  38299. return a
  38300. }(this) : g;
  38301. var w = null == g,
  38302. t, y = !1;
  38303. w ? (null == c.dynamics.ZPP_FluidArbiter.zpp_pool ? t = new c.dynamics.ZPP_FluidArbiter : (t = c.dynamics.ZPP_FluidArbiter.zpp_pool, c.dynamics.ZPP_FluidArbiter.zpp_pool = t.next, t.next = null), null) :
  38304. null == g.fluidarb ? (g.cleared = !0, g.b1.arbiters.inlined_try_remove(g), g.b2.arbiters.inlined_try_remove(g), null != g.pair && (g.pair.arb = null, g.pair = null), g.active = !1, this.f_arbiters.modified = !0, null == c.dynamics.ZPP_FluidArbiter.zpp_pool ? t = new c.dynamics.ZPP_FluidArbiter : (t = c.dynamics.ZPP_FluidArbiter.zpp_pool, c.dynamics.ZPP_FluidArbiter.zpp_pool = t.next, t.next = null), null, y = w = t.intchange = !0) : t = g.fluidarb;
  38305. l = function (d) {
  38306. var g = c.util.ZPP_Flags.id_InteractionType_FLUID;
  38307. return w || t.stamp != d.stamp || e ? function (d) {
  38308. t.stamp =
  38309. d.stamp;
  38310. return c.geom.ZPP_Collide.flowCollide(n, q, t) ? function (d) {
  38311. w ? (t.b1 = a.body, t.ws1 = a, t.b2 = b.body, t.ws2 = b, t.id = n.id, t.di = q.id, t.b1.arbiters.inlined_add(t), t.b2.arbiters.inlined_add(t), t.active = !0, t.present = 0, t.cleared = !1, t.sleeping = !1, t.fresh = !1, t.presentable = !1, t.nx = 0, t.ny = 1, t.dampx = 0, t.dampy = 0, t.adamp = 0, d.f_arbiters.inlined_add(t), t.fresh = !y) : t.fresh = t.up_stamp < d.stamp - 1 || t.endGenerated == d.stamp && e;
  38312. t.up_stamp = t.stamp;
  38313. if (t.fresh || 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
  38314. t.immState =
  38315. c.util.ZPP_Flags.id_ImmState_ACCEPT;
  38316. var l = !1;
  38317. d.inlined_MRCA_chains(a, b);
  38318. for (var m = d.mrca1.head; null != m;) {
  38319. for (var k = m.elt, p = d.mrca2.head; null != p;) {
  38320. var u = p.elt,
  38321. s = k.cbSet,
  38322. x = u.cbSet;
  38323. if (null != s.manager.pair(s, x).listeners.head) {
  38324. var A = null,
  38325. D = null;
  38326. d.prelisteners.inlined_clear();
  38327. s.manager.pair(s, x).forall(c.util.ZPP_Flags.id_CbEvent_PRE, function (a) {
  38328. return function (b) {
  38329. 0 != (b.itype & g) && (a[0] = f.prelisteners.inlined_insert(a[0], b), l = l || !b.pure)
  38330. }
  38331. }([null]));
  38332. if (null != d.prelisteners.head)
  38333. if (A = c.phys.ZPP_Interactor.get(k,
  38334. u), null == A && (D = c.space.ZPP_CallbackSet.get(k, u), d.add_callbackset(D)), null == A || (A.FLUIDstamp != d.stamp || e) && 0 == (A.FLUIDstate & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
  38335. null != D && (A = D);
  38336. if (null != A)
  38337. for (u = d.prelisteners.head; null != u;) x = u.elt, x.itype == c.util.ZPP_Flags.id_InteractionType_ANY && (A.COLLISIONstamp = d.stamp, A.SENSORstamp = d.stamp), A.FLUIDstamp = d.stamp, u = u.next;
  38338. t.mutable = !0;
  38339. null != t.wrap_position && (t.wrap_position.zpp_inner._immutable = !1);
  38340. s = t.active;
  38341. t.active = !0;
  38342. d.precb.zpp_inner.pre_arbiter = t;
  38343. d.precb.zpp_inner.set =
  38344. A;
  38345. for (u = d.prelisteners.head; null != u;) {
  38346. x = u.elt;
  38347. d.precb.zpp_inner.listener = x;
  38348. c.phys.ZPP_Interactor.int_callback(A, x, d.precb.zpp_inner);
  38349. d.precb.zpp_inner.pre_swapped = k != d.precb.zpp_inner.int1;
  38350. D = x.handlerp(d.precb);
  38351. if (null != D) {
  38352. var x = t,
  38353. E = D;
  38354. null == c.util.ZPP_Flags.PreFlag_ACCEPT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  38355. E == c.util.ZPP_Flags.PreFlag_ACCEPT ? D = c.util.ZPP_Flags.id_ImmState_ACCEPT | c.util.ZPP_Flags.id_ImmState_ALWAYS : (E =
  38356. D, null == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), E == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE ? D = c.util.ZPP_Flags.id_ImmState_ACCEPT : (null == c.util.ZPP_Flags.PreFlag_IGNORE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), D = D == c.util.ZPP_Flags.PreFlag_IGNORE ? c.util.ZPP_Flags.id_ImmState_IGNORE | c.util.ZPP_Flags.id_ImmState_ALWAYS :
  38357. c.util.ZPP_Flags.id_ImmState_IGNORE));
  38358. x.immState = D
  38359. }
  38360. u = u.next
  38361. }
  38362. t.mutable = !1;
  38363. null != t.wrap_position && (t.wrap_position.zpp_inner._immutable = !0);
  38364. t.active = s;
  38365. if (null != A)
  38366. for (u = d.prelisteners.head; null != u;) x = u.elt, x.itype == c.util.ZPP_Flags.id_InteractionType_ANY && (A.COLLISIONstate = t.immState, A.SENSORstate = t.immState), A.FLUIDstate = t.immState, u = u.next
  38367. } else null == A ? 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS) && (t.immState = c.util.ZPP_Flags.id_ImmState_ACCEPT) : t.immState = A.FLUIDstate
  38368. }
  38369. p = p.next
  38370. }
  38371. m = m.next
  38372. }
  38373. l &&
  38374. 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS) && (t.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (m = t.b1, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))), t.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (m = t.b2, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))))
  38375. }
  38376. 0 != (t.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && (t.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && t.b1.component.sleeping && (m = t.b1, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))), t.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && t.b2.component.sleeping && (m = t.b2, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))));
  38377. t.sleeping && (t.sleeping = !1, d.f_arbiters.inlined_add(t));
  38378. return t
  38379. }(d) : w ? function (a) {
  38380. a = t;
  38381. a.next = c.dynamics.ZPP_FluidArbiter.zpp_pool;
  38382. c.dynamics.ZPP_FluidArbiter.zpp_pool = a;
  38383. return null
  38384. }(d) : t
  38385. }(d) : t
  38386. }(this)
  38387. } else if (1 == p) {
  38388. var A = d ? this.c_arbiters_true : this.c_arbiters_false;
  38389. g = null == g ? function (a) {
  38390. a = null;
  38391. for (var b = (m.arbiters.length < k.arbiters.length ? m : k).arbiters.head; null != b;) {
  38392. var d = b.elt;
  38393. if (d.id == n.id && d.di == q.id) {
  38394. a = d;
  38395. break
  38396. }
  38397. b = b.next
  38398. }
  38399. return a
  38400. }(this) : g;
  38401. w = null ==
  38402. g;
  38403. y = !1;
  38404. w ? (null == c.dynamics.ZPP_ColArbiter.zpp_pool ? t = new c.dynamics.ZPP_ColArbiter : (t = c.dynamics.ZPP_ColArbiter.zpp_pool, c.dynamics.ZPP_ColArbiter.zpp_pool = t.next, t.next = null), null, t.stat = d) : null == g.colarb ? (g.cleared = !0, g.b1.arbiters.inlined_try_remove(g), g.b2.arbiters.inlined_try_remove(g), null != g.pair && (g.pair.arb = null, g.pair = null), g.active = !1, this.f_arbiters.modified = !0, null == c.dynamics.ZPP_ColArbiter.zpp_pool ? t = new c.dynamics.ZPP_ColArbiter : (t = c.dynamics.ZPP_ColArbiter.zpp_pool, c.dynamics.ZPP_ColArbiter.zpp_pool =
  38405. t.next, t.next = null), null, t.intchange = !0, t.stat = d, y = w = !0) : (t = g.colarb, s = n != t.s1, t.stat != d && (t.stat = d, t.sleeping || ((d ? this.c_arbiters_false : this.c_arbiters_true).remove(t), A.add(t))));
  38406. l = function (d) {
  38407. var g = c.util.ZPP_Flags.id_InteractionType_COLLISION;
  38408. return w || t.stamp != d.stamp || e ? function (d) {
  38409. t.stamp = d.stamp;
  38410. return c.geom.ZPP_Collide.contactCollide(n, q, t, s) ? function (d) {
  38411. w ? (t.b1 = a.body, t.ws1 = a, t.b2 = b.body, t.ws2 = b, t.id = n.id, t.di = q.id, t.b1.arbiters.inlined_add(t), t.b2.arbiters.inlined_add(t), t.active = !0,
  38412. t.present = 0, t.cleared = !1, t.sleeping = !1, t.fresh = !1, t.presentable = !1, t.s1 = a, t.s2 = b, t.userdef_restitution || (t.restitution = t.s1.material.elasticity <= Math.NEGATIVE_INFINITY || t.s2.material.elasticity <= Math.NEGATIVE_INFINITY ? 0 : t.s1.material.elasticity >= Math.POSITIVE_INFINITY || t.s2.material.elasticity >= Math.POSITIVE_INFINITY ? 1 : (t.s1.material.elasticity + t.s2.material.elasticity) / 2, 0 > t.restitution && (t.restitution = 0), 1 < t.restitution && (t.restitution = 1)), t.userdef_dyn_fric || (t.dyn_fric = Math.sqrt(t.s1.material.dynamicFriction *
  38413. t.s2.material.dynamicFriction)), t.userdef_stat_fric || (t.stat_fric = Math.sqrt(t.s1.material.staticFriction * t.s2.material.staticFriction)), t.userdef_rfric || (t.rfric = Math.sqrt(t.s1.material.rollingFriction * t.s2.material.rollingFriction)), A.inlined_add(t), t.fresh = !y) : t.fresh = t.up_stamp < d.stamp - 1 || t.endGenerated == d.stamp && e;
  38414. t.up_stamp = t.stamp;
  38415. if (t.fresh || 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
  38416. t.immState = c.util.ZPP_Flags.id_ImmState_ACCEPT;
  38417. var l = !1;
  38418. d.inlined_MRCA_chains(a, b);
  38419. for (var m = d.mrca1.head; null !=
  38420. m;) {
  38421. for (var k = m.elt, p = d.mrca2.head; null != p;) {
  38422. var u = p.elt,
  38423. s = k.cbSet,
  38424. x = u.cbSet;
  38425. if (null != s.manager.pair(s, x).listeners.head) {
  38426. var D = null,
  38427. E = null;
  38428. d.prelisteners.inlined_clear();
  38429. s.manager.pair(s, x).forall(c.util.ZPP_Flags.id_CbEvent_PRE, function (a) {
  38430. return function (b) {
  38431. 0 != (b.itype & g) && (a[0] = f.prelisteners.inlined_insert(a[0], b), l = l || !b.pure)
  38432. }
  38433. }([null]));
  38434. if (null != d.prelisteners.head)
  38435. if (D = c.phys.ZPP_Interactor.get(k, u), null == D && (E = c.space.ZPP_CallbackSet.get(k, u), d.add_callbackset(E)), null == D || (D.COLLISIONstamp !=
  38436. d.stamp || e) && 0 == (D.COLLISIONstate & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
  38437. null != E && (D = E);
  38438. if (null != D)
  38439. for (u = d.prelisteners.head; null != u;) x = u.elt, x.itype == c.util.ZPP_Flags.id_InteractionType_ANY ? (D.COLLISIONstamp = d.stamp, D.SENSORstamp = d.stamp, D.FLUIDstamp = d.stamp) : D.COLLISIONstamp = d.stamp, u = u.next;
  38440. t.mutable = !0;
  38441. null != t.wrap_normal && (t.wrap_normal.zpp_inner._immutable = !1);
  38442. null != t.wrap_contacts && (t.wrap_contacts.zpp_inner.immutable = !1);
  38443. s = t.active;
  38444. t.active = !0;
  38445. t.cleanupContacts();
  38446. d.precb.zpp_inner.pre_arbiter =
  38447. t;
  38448. d.precb.zpp_inner.set = D;
  38449. for (u = d.prelisteners.head; null != u;) {
  38450. x = u.elt;
  38451. d.precb.zpp_inner.listener = x;
  38452. c.phys.ZPP_Interactor.int_callback(D, x, d.precb.zpp_inner);
  38453. d.precb.zpp_inner.pre_swapped = k != d.precb.zpp_inner.int1;
  38454. E = x.handlerp(d.precb);
  38455. if (null != E) {
  38456. var x = t,
  38457. F = E;
  38458. null == c.util.ZPP_Flags.PreFlag_ACCEPT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  38459. F == c.util.ZPP_Flags.PreFlag_ACCEPT ? E = c.util.ZPP_Flags.id_ImmState_ACCEPT | c.util.ZPP_Flags.id_ImmState_ALWAYS :
  38460. (F = E, null == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), F == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE ? E = c.util.ZPP_Flags.id_ImmState_ACCEPT : (null == c.util.ZPP_Flags.PreFlag_IGNORE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), E = E == c.util.ZPP_Flags.PreFlag_IGNORE ? c.util.ZPP_Flags.id_ImmState_IGNORE | c.util.ZPP_Flags.id_ImmState_ALWAYS :
  38461. c.util.ZPP_Flags.id_ImmState_IGNORE));
  38462. x.immState = E
  38463. }
  38464. u = u.next
  38465. }
  38466. t.mutable = !1;
  38467. null != t.wrap_normal && (t.wrap_normal.zpp_inner._immutable = !0);
  38468. null != t.wrap_contacts && (t.wrap_contacts.zpp_inner.immutable = !0);
  38469. t.active = s;
  38470. if (null != D)
  38471. for (u = d.prelisteners.head; null != u;) x = u.elt, x.itype == c.util.ZPP_Flags.id_InteractionType_ANY ? (D.COLLISIONstate = t.immState, D.SENSORstate = t.immState, D.FLUIDstate = t.immState) : D.COLLISIONstate = t.immState, u = u.next
  38472. } else null == D ? 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS) && (t.immState =
  38473. c.util.ZPP_Flags.id_ImmState_ACCEPT) : t.immState = D.COLLISIONstate
  38474. }
  38475. p = p.next
  38476. }
  38477. m = m.next
  38478. }
  38479. l && 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS) && (t.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (m = t.b1, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))), t.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (m = t.b2, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC &&
  38480. (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))))
  38481. }
  38482. 0 != (t.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && (t.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && t.b1.component.sleeping && (m = t.b1, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))), t.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && t.b2.component.sleeping && (m = t.b2, m.world || (m.component.waket = d.stamp + (d.midstep ?
  38483. 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))));
  38484. t.sleeping && (t.sleeping = !1, A.inlined_add(t));
  38485. return t
  38486. }(d) : w ? function (a) {
  38487. a = t;
  38488. a.userdef_dyn_fric = !1;
  38489. a.userdef_stat_fric = !1;
  38490. a.userdef_restitution = !1;
  38491. a.userdef_rfric = !1;
  38492. a.__ref_edge1 = a.__ref_edge2 = null;
  38493. a.next = c.dynamics.ZPP_ColArbiter.zpp_pool;
  38494. c.dynamics.ZPP_ColArbiter.zpp_pool = a;
  38495. return null
  38496. }(d) : t
  38497. }(d) : t
  38498. }(this)
  38499. } else g = null == g ? function (a) {
  38500. a = null;
  38501. for (var b = (m.arbiters.length < k.arbiters.length ?
  38502. m : k).arbiters.head; null != b;) {
  38503. var d = b.elt;
  38504. if (d.id == n.id && d.di == q.id) {
  38505. a = d;
  38506. break
  38507. }
  38508. b = b.next
  38509. }
  38510. return a
  38511. }(this) : g, w = null == g, y = !1, w ? (null == c.dynamics.ZPP_SensorArbiter.zpp_pool ? t = new c.dynamics.ZPP_SensorArbiter : (t = c.dynamics.ZPP_SensorArbiter.zpp_pool, c.dynamics.ZPP_SensorArbiter.zpp_pool = t.next, t.next = null), null) : null == g.sensorarb ? (g.cleared = !0, g.b1.arbiters.inlined_try_remove(g), g.b2.arbiters.inlined_try_remove(g), null != g.pair && (g.pair.arb = null, g.pair = null), g.active = !1, this.f_arbiters.modified = !0, null ==
  38512. c.dynamics.ZPP_SensorArbiter.zpp_pool ? t = new c.dynamics.ZPP_SensorArbiter : (t = c.dynamics.ZPP_SensorArbiter.zpp_pool, c.dynamics.ZPP_SensorArbiter.zpp_pool = t.next, t.next = null), null, y = w = t.intchange = !0) : t = g.sensorarb, l = function (d) {
  38513. var g = c.util.ZPP_Flags.id_InteractionType_SENSOR;
  38514. return w || t.stamp != d.stamp || e ? function (d) {
  38515. t.stamp = d.stamp;
  38516. return c.geom.ZPP_Collide.testCollide(n, q) ? function (d) {
  38517. w ? (t.b1 = a.body, t.ws1 = a, t.b2 = b.body, t.ws2 = b, t.id = n.id, t.di = q.id, t.b1.arbiters.inlined_add(t), t.b2.arbiters.inlined_add(t),
  38518. t.active = !0, t.present = 0, t.cleared = !1, t.sleeping = !1, t.fresh = !1, t.presentable = !1, d.s_arbiters.inlined_add(t), t.fresh = !y) : t.fresh = t.up_stamp < d.stamp - 1 || t.endGenerated == d.stamp && e;
  38519. t.up_stamp = t.stamp;
  38520. if (t.fresh || 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
  38521. t.immState = c.util.ZPP_Flags.id_ImmState_ACCEPT;
  38522. var l = !1;
  38523. d.inlined_MRCA_chains(a, b);
  38524. for (var m = d.mrca1.head; null != m;) {
  38525. for (var k = m.elt, p = d.mrca2.head; null != p;) {
  38526. var u = p.elt,
  38527. s = k.cbSet,
  38528. x = u.cbSet;
  38529. if (null != s.manager.pair(s, x).listeners.head) {
  38530. var A = null,
  38531. D = null;
  38532. d.prelisteners.inlined_clear();
  38533. s.manager.pair(s, x).forall(c.util.ZPP_Flags.id_CbEvent_PRE, function (a) {
  38534. return function (b) {
  38535. 0 != (b.itype & g) && (a[0] = f.prelisteners.inlined_insert(a[0], b), l = l || !b.pure)
  38536. }
  38537. }([null]));
  38538. if (null != d.prelisteners.head)
  38539. if (A = c.phys.ZPP_Interactor.get(k, u), null == A && (D = c.space.ZPP_CallbackSet.get(k, u), d.add_callbackset(D)), null == A || (A.SENSORstamp != d.stamp || e) && 0 == (A.SENSORstate & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
  38540. null != D && (A = D);
  38541. if (null != A)
  38542. for (u = d.prelisteners.head; null != u;) x =
  38543. u.elt, x.itype == c.util.ZPP_Flags.id_InteractionType_ANY ? (A.COLLISIONstamp = d.stamp, A.SENSORstamp = d.stamp, A.FLUIDstamp = d.stamp) : A.SENSORstamp = d.stamp, u = u.next;
  38544. s = t.active;
  38545. t.active = !0;
  38546. d.precb.zpp_inner.pre_arbiter = t;
  38547. d.precb.zpp_inner.set = A;
  38548. for (u = d.prelisteners.head; null != u;) {
  38549. x = u.elt;
  38550. d.precb.zpp_inner.listener = x;
  38551. c.phys.ZPP_Interactor.int_callback(A, x, d.precb.zpp_inner);
  38552. d.precb.zpp_inner.pre_swapped = k != d.precb.zpp_inner.int1;
  38553. D = x.handlerp(d.precb);
  38554. if (null != D) {
  38555. var x = t,
  38556. E = D;
  38557. null == c.util.ZPP_Flags.PreFlag_ACCEPT &&
  38558. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1);
  38559. E == c.util.ZPP_Flags.PreFlag_ACCEPT ? D = c.util.ZPP_Flags.id_ImmState_ACCEPT | c.util.ZPP_Flags.id_ImmState_ALWAYS : (E = D, null == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), E == c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE ? D = c.util.ZPP_Flags.id_ImmState_ACCEPT : (null == c.util.ZPP_Flags.PreFlag_IGNORE &&
  38560. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.PreFlag_IGNORE = new h.callbacks.PreFlag, c.util.ZPP_Flags.internal = !1), D = D == c.util.ZPP_Flags.PreFlag_IGNORE ? c.util.ZPP_Flags.id_ImmState_IGNORE | c.util.ZPP_Flags.id_ImmState_ALWAYS : c.util.ZPP_Flags.id_ImmState_IGNORE));
  38561. x.immState = D
  38562. }
  38563. u = u.next
  38564. }
  38565. t.active = s;
  38566. if (null != A)
  38567. for (u = d.prelisteners.head; null != u;) x = u.elt, x.itype == c.util.ZPP_Flags.id_InteractionType_ANY ? (A.COLLISIONstate = t.immState, A.SENSORstate = t.immState, A.FLUIDstate = t.immState) : A.SENSORstate = t.immState,
  38568. u = u.next
  38569. } else null == A ? 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS) && (t.immState = c.util.ZPP_Flags.id_ImmState_ACCEPT) : t.immState = A.SENSORstate
  38570. }
  38571. p = p.next
  38572. }
  38573. m = m.next
  38574. }
  38575. l && 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS) && (t.b1.type != c.util.ZPP_Flags.id_BodyType_STATIC && (m = t.b1, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))), t.b2.type != c.util.ZPP_Flags.id_BodyType_STATIC && (m =
  38576. t.b2, m.world || (m.component.waket = d.stamp + (d.midstep ? 0 : 1), m.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))))
  38577. }
  38578. t.sleeping && (t.sleeping = !1, d.s_arbiters.inlined_add(t));
  38579. return t
  38580. }(d) : w ? function (a) {
  38581. a = t;
  38582. a.next = c.dynamics.ZPP_SensorArbiter.zpp_pool;
  38583. c.dynamics.ZPP_SensorArbiter.zpp_pool = a;
  38584. return null
  38585. }(d) : t
  38586. }(d) : t
  38587. }(this)
  38588. }
  38589. return l
  38590. },
  38591. interactionType: function (a, b, d, c) {
  38592. var e;
  38593. e = !1;
  38594. for (var f = d.constraints.head; null != f;) {
  38595. var h = f.elt;
  38596. if (h.ignore && h.pair_exists(d.id,
  38597. c.id)) {
  38598. e = !0;
  38599. break
  38600. }
  38601. f = f.next
  38602. }
  38603. return e || this.group_ignore(a, b) ? -1 : (a.sensorEnabled || b.sensorEnabled) && a.filter.shouldSense(b.filter) ? 2 : !a.fluidEnabled && !b.fluidEnabled || !a.filter.shouldFlow(b.filter) || 0 == d.imass && 0 == c.imass && 0 == d.iinertia && 0 == c.iinertia ? !a.filter.shouldCollide(b.filter) || 0 == d.imass && 0 == c.imass && 0 == d.iinertia && 0 == c.iinertia ? -1 : 1 : 0
  38604. },
  38605. group_ignore: function (a, b) {
  38606. var d = a.lookup_group();
  38607. if (null == d) return !1;
  38608. var c = b.lookup_group();
  38609. if (null == c) return !1;
  38610. for (var e = !1; null != d && null != c;) {
  38611. if (d == c) {
  38612. e =
  38613. d.ignore;
  38614. break
  38615. }
  38616. d.depth < c.depth ? c = c.group : d = d.group
  38617. }
  38618. return e
  38619. },
  38620. iteratePos: function (a) {
  38621. for (var b = 0; b < a;) {
  38622. b++;
  38623. for (var d = null, g = this.live_constraints.head; null != g;) {
  38624. var e = g.elt;
  38625. !e.__velocity && e.stiff && e.applyImpulsePos() ? (g = this.live_constraints.erase(d), e.broken(), this.constraintCbBreak(e), e.removeOnBreak ? (e.component.sleeping = !0, this.midstep = !1, null != e.compound ? e.compound.wrap_constraints.remove(e.outer) : this.wrap_constraints.remove(e.outer), this.midstep = !0) : e.active = !1, e.clearcache()) : (d = g, g = g.next)
  38626. }
  38627. d =
  38628. this.c_arbiters_false.head;
  38629. g = !0;
  38630. null == d && (d = this.c_arbiters_true.head, g = !1);
  38631. for (; null != d;) e = d.elt, e.active && 0 != (e.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && e.applyImpulsePos(), d = d.next, g && null == d && (d = this.c_arbiters_true.head, g = !1)
  38632. }
  38633. },
  38634. iterateVel: function (a) {
  38635. for (var b = 0; b < a;) {
  38636. b++;
  38637. for (var d = this.f_arbiters.head; null != d;) {
  38638. var g = d.elt;
  38639. g.active && 0 != (g.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && g.applyImpulseVel();
  38640. d = d.next
  38641. }
  38642. g = null;
  38643. for (d = this.live_constraints.head; null != d;) {
  38644. var e = d.elt;
  38645. e.applyImpulseVel() ?
  38646. (d = this.live_constraints.erase(g), e.broken(), this.constraintCbBreak(e), e.removeOnBreak ? (e.component.sleeping = !0, this.midstep = !1, null != e.compound ? e.compound.wrap_constraints.remove(e.outer) : this.wrap_constraints.remove(e.outer), this.midstep = !0) : e.active = !1, e.clearcache()) : (g = d, d = d.next)
  38647. }
  38648. d = this.c_arbiters_false.head;
  38649. e = !0;
  38650. null == d && (d = this.c_arbiters_true.head, e = !1);
  38651. for (; null != d;) g = d.elt, g.active && 0 != (g.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && g.applyImpulseVel(), d = d.next, e && null == d && (d = this.c_arbiters_true.head,
  38652. e = !1)
  38653. }
  38654. },
  38655. warmStart: function () {
  38656. for (var a = this.f_arbiters.head; null != a;) {
  38657. var b = a.elt;
  38658. b.active && 0 != (b.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && b.warmStart();
  38659. a = a.next
  38660. }
  38661. var a = this.c_arbiters_false.head,
  38662. d = !0;
  38663. null == a && (a = this.c_arbiters_true.head, d = !1);
  38664. for (; null != a;) b = a.elt, b.active && 0 != (b.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && b.warmStart(), a = a.next, d && null == a && (a = this.c_arbiters_true.head, d = !1);
  38665. for (a = this.live_constraints.head; null != a;) a.elt.warmStart(), a = a.next
  38666. },
  38667. prestep: function (a) {
  38668. for (var b =
  38669. null, d = this.live_constraints.head; null != d;) {
  38670. var c = d.elt;
  38671. c.preStep(a) ? (d = this.live_constraints.erase(b), c.broken(), this.constraintCbBreak(c), c.removeOnBreak ? (c.component.sleeping = !0, this.midstep = !1, null != c.compound ? c.compound.wrap_constraints.remove(c.outer) : this.wrap_constraints.remove(c.outer), this.midstep = !0) : c.active = !1, c.clearcache()) : (b = d, d = d.next)
  38672. }
  38673. var b = null,
  38674. d = this.c_arbiters_true,
  38675. c = d.head,
  38676. e = null != this.c_arbiters_false;
  38677. e && null == c && (e = !1, c = this.c_arbiters_false.head, d = this.c_arbiters_false, b =
  38678. null);
  38679. for (; null != c;) {
  38680. var f = c.elt;
  38681. this.presteparb(f, a) ? c = d.inlined_erase(b) : (b = c, c = c.next);
  38682. e && null == c && (e = !1, c = this.c_arbiters_false.head, d = this.c_arbiters_false, b = null)
  38683. }
  38684. b = null;
  38685. d = this.f_arbiters;
  38686. c = d.head;
  38687. e = !1;
  38688. for (; null != c;) f = c.elt, this.presteparb(f, a) ? c = d.inlined_erase(b) : (b = c, c = c.next), e && null == c && (e = !1, c = null.begin(), b = d = null);
  38689. b = null;
  38690. d = this.s_arbiters;
  38691. c = d.head;
  38692. e = !1;
  38693. for (; null != c;) f = c.elt, this.presteparb(f, a) ? c = d.inlined_erase(b) : (b = c, c = c.next), e && null == c && (e = !1, c = null.begin(), b = d = null)
  38694. },
  38695. presteparb: function (a,
  38696. b, d) {
  38697. null == d && (d = !1);
  38698. var g = this;
  38699. if (!a.cleared && a.b1.component.sleeping && a.b2.component.sleeping) return a.sleep_stamp = this.stamp, a.sleeping = !0;
  38700. if (!a.cleared || 0 != a.present || a.intchange) {
  38701. var e = !d && a.up_stamp == this.stamp - 1 && !a.cleared && !a.intchange;
  38702. d = a.fresh && !a.cleared && !a.intchange;
  38703. e && (a.endGenerated = this.stamp);
  38704. if (d || e || a.cleared || a.intchange)
  38705. for (this.inlined_MRCA_chains(a.ws1, a.ws2), e = this.mrca1.head; null != e;) {
  38706. for (var f = e.elt, l = this.mrca2.head; null != l;) {
  38707. var m = l.elt,
  38708. k = f.cbSet,
  38709. p = m.cbSet;
  38710. if (null != k.manager.pair(k,
  38711. p).listeners.head) {
  38712. var n = [c.phys.ZPP_Interactor.get(f, m)];
  38713. d || a.intchange ? (null == n[0] && (n[0] = c.space.ZPP_CallbackSet.get(f, m), this.add_callbackset(n[0])), k.manager.pair(k, p).forall(c.util.ZPP_Flags.id_CbEvent_BEGIN, function (b) {
  38714. return function (d) {
  38715. if (0 != (d.itype & a.type) && b[0].empty_arb(d.itype)) {
  38716. var e = g.push_callback(d);
  38717. e.event = c.util.ZPP_Flags.id_CbEvent_BEGIN;
  38718. c.phys.ZPP_Interactor.int_callback(b[0], d, e);
  38719. e.set = b[0]
  38720. }
  38721. }
  38722. }(n)), n[0].arbiters.inlined_has(a) ? m = 0 : (n[0].arbiters.inlined_add(a), m = !0), m && a.present++) :
  38723. (a.present--, n[0].remove_arb(a), k.manager.pair(k, p).forall(c.util.ZPP_Flags.id_CbEvent_END, function (b) {
  38724. return function (d) {
  38725. if (0 != (d.itype & a.type) && b[0].empty_arb(d.itype)) {
  38726. var e = g.push_callback(d);
  38727. e.event = c.util.ZPP_Flags.id_CbEvent_END;
  38728. c.phys.ZPP_Interactor.int_callback(b[0], d, e);
  38729. e.set = b[0]
  38730. }
  38731. }
  38732. }(n)), null == n[0].arbiters.head && this.remove_callbackset(n[0]))
  38733. }
  38734. l = l.next
  38735. }
  38736. e = e.next
  38737. }
  38738. a.fresh = !1;
  38739. a.intchange = !1
  38740. }
  38741. if (a.cleared || a.up_stamp + (a.type == c.dynamics.ZPP_Arbiter.COL ? h.Config.arbiterExpirationDelay : 0) < this.stamp) return a.type ==
  38742. c.dynamics.ZPP_Arbiter.SENSOR ? a.sensorarb.retire() : a.type == c.dynamics.ZPP_Arbiter.FLUID ? a.fluidarb.retire() : a.colarb.retire(), !0;
  38743. d = a.active;
  38744. a.active = a.presentable = a.up_stamp == this.stamp;
  38745. 0 != (a.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) ? a.active && a.type != c.dynamics.ZPP_Arbiter.SENSOR && (null != a.colarb ? a.colarb.preStep(b) && (a.active = !1) : a.fluidarb.preStep(this, b)) : null != a.colarb && a.colarb.cleanupContacts() && (a.active = !1);
  38746. d != a.active && (a.b1.arbiters.modified = !0, a.b2.arbiters.modified = !0, this.c_arbiters_true.modified =
  38747. this.c_arbiters_false.modified = !0, this.s_arbiters.modified = this.f_arbiters.modified = !0);
  38748. return !1
  38749. },
  38750. updatePos: function (a) {
  38751. for (var b = 2 * Math.PI / a, d = this.live.head; null != d;) {
  38752. var g = d.elt;
  38753. g.pre_posx = g.posx;
  38754. g.pre_posy = g.posy;
  38755. g.pre_rot = g.rot;
  38756. g.sweepTime = 0;
  38757. g.sweep_angvel = g.angvel % b;
  38758. g.sweepIntegrate(a);
  38759. if (g.disableCCD) g.sweepFrozen = !0, g.bullet = !1;
  38760. else {
  38761. var e = h.Config.staticCCDLinearThreshold * g.sweepRadius,
  38762. f = h.Config.staticCCDAngularThreshold;
  38763. if ((g.velx * g.velx + g.vely * g.vely) * a * a > e * e || g.angvel * g.angvel * a * a > f * f ||
  38764. g.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC) {
  38765. e = g.sweep_angvel;
  38766. 0 > e && (e = -e);
  38767. for (var f = 1 / e, l = g.shapes.head; null != l;) {
  38768. var m = l.elt,
  38769. k = m.aabb,
  38770. n = k.minx,
  38771. q = k.miny,
  38772. r = k.maxx,
  38773. s = k.maxy,
  38774. w = e * a * m.sweepCoef * (1 / 120) | 0;
  38775. 8 < w && (w = 8);
  38776. var t = e * a / w;
  38777. g.sweepIntegrate(a);
  38778. m.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? m.circle._force_validate_aabb() : m.polygon._force_validate_aabb();
  38779. n < k.minx ? k.minx = n : n = k.minx;
  38780. q < k.miny ? k.miny = q : q = k.miny;
  38781. r > k.maxx ? k.maxx = r : r = k.maxx;
  38782. s > k.maxy ? k.maxy = s : s = k.maxy;
  38783. for (var y = 1; y < w;) {
  38784. var A = y++;
  38785. g.sweepIntegrate(t *
  38786. A * f);
  38787. m.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? m.circle._force_validate_aabb() : m.polygon._force_validate_aabb();
  38788. n < k.minx ? k.minx = n : n = k.minx;
  38789. q < k.miny ? k.miny = q : q = k.miny;
  38790. r > k.maxx ? k.maxx = r : r = k.maxx;
  38791. s > k.maxy ? k.maxy = s : s = k.maxy
  38792. }
  38793. this.bphase.sync(m);
  38794. l = l.next
  38795. }
  38796. g.sweepFrozen = !1;
  38797. g.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && g.bulletEnabled && (e = h.Config.bulletCCDLinearThreshold * g.sweepRadius, f = h.Config.bulletCCDAngularThreshold, (g.velx * g.velx + g.vely * g.vely) * a * a > e * e || g.angvel * g.angvel * a * a > f * f) && (g.bullet = !0)
  38798. } else g.sweepFrozen = !0, g.bullet = !1
  38799. }
  38800. d = d.next
  38801. }
  38802. for (d = this.kinematics.head; null != d;) {
  38803. g = d.elt;
  38804. g.pre_posx = g.posx;
  38805. g.pre_posy = g.posy;
  38806. g.pre_rot = g.rot;
  38807. g.sweepTime = 0;
  38808. g.sweep_angvel = g.angvel % b;
  38809. g.sweepIntegrate(a);
  38810. if (g.disableCCD) g.sweepFrozen = !0, g.bullet = !1;
  38811. else if (e = h.Config.staticCCDLinearThreshold * g.sweepRadius, f = h.Config.staticCCDAngularThreshold, (g.velx * g.velx + g.vely * g.vely) * a * a > e * e || g.angvel * g.angvel * a * a > f * f || g.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC) {
  38812. e = g.sweep_angvel;
  38813. 0 > e && (e = -e);
  38814. f = 1 / e;
  38815. for (l = g.shapes.head; null != l;) {
  38816. m =
  38817. l.elt;
  38818. k = m.aabb;
  38819. n = k.minx;
  38820. q = k.miny;
  38821. r = k.maxx;
  38822. s = k.maxy;
  38823. w = e * a * m.sweepCoef * (1 / 120) | 0;
  38824. 8 < w && (w = 8);
  38825. t = e * a / w;
  38826. g.sweepIntegrate(a);
  38827. m.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? m.circle._force_validate_aabb() : m.polygon._force_validate_aabb();
  38828. n < k.minx ? k.minx = n : n = k.minx;
  38829. q < k.miny ? k.miny = q : q = k.miny;
  38830. r > k.maxx ? k.maxx = r : r = k.maxx;
  38831. s > k.maxy ? k.maxy = s : s = k.maxy;
  38832. for (y = 1; y < w;) A = y++, g.sweepIntegrate(t * A * f), m.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? m.circle._force_validate_aabb() : m.polygon._force_validate_aabb(), n < k.minx ? k.minx =
  38833. n : n = k.minx, q < k.miny ? k.miny = q : q = k.miny, r > k.maxx ? k.maxx = r : r = k.maxx, s > k.maxy ? k.maxy = s : s = k.maxy;
  38834. this.bphase.sync(m);
  38835. l = l.next
  38836. }
  38837. g.sweepFrozen = !1;
  38838. g.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && g.bulletEnabled && (e = h.Config.bulletCCDLinearThreshold * g.sweepRadius, f = h.Config.bulletCCDAngularThreshold, (g.velx * g.velx + g.vely * g.vely) * a * a > e * e || g.angvel * g.angvel * a * a > f * f) && (g.bullet = !0)
  38839. } else g.sweepFrozen = !0, g.bullet = !1;
  38840. d = d.next
  38841. }
  38842. },
  38843. updateVel: function (a) {
  38844. for (var b = 1 - a * this.global_lin_drag, d = 1 - a * this.global_ang_drag, c =
  38845. this.live.head; null != c;) {
  38846. var e = c.elt;
  38847. if (0 != e.smass) {
  38848. var f = a * e.imass;
  38849. e.velx = b * e.velx + (e.forcex + this.gravityx * e.gravMass) * f;
  38850. e.vely = b * e.vely + (e.forcey + this.gravityy * e.gravMass) * f
  38851. }
  38852. if (0 != e.sinertia) {
  38853. var h = f = 0,
  38854. f = e.worldCOMx - e.posx,
  38855. h = e.worldCOMy - e.posy;
  38856. e.angvel = d * e.angvel + (e.torque + (this.gravityy * f - this.gravityx * h) * e.gravMass) * a * e.iinertia
  38857. }
  38858. c = c.next
  38859. }
  38860. },
  38861. validation: function () {
  38862. this.cbsets.validate();
  38863. for (var a = this.live.head; null != a;) {
  38864. var b = a.elt;
  38865. b.sweepRadius = 0;
  38866. for (var d = b.shapes.head; null != d;) {
  38867. var g = d.elt;
  38868. if (g.type ==
  38869. c.util.ZPP_Flags.id_ShapeType_POLYGON) {
  38870. g.polygon.splice_collinear();
  38871. var e = g.polygon.valid(),
  38872. f = e;
  38873. null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  38874. if (f != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Cannot simulate with an invalid Polygon : " + g.polygon.outer.toString() + " is invalid : " + e.toString();
  38875. g.polygon.validate_gaxi()
  38876. }
  38877. g.validate_sweepRadius();
  38878. g.sweepRadius > b.sweepRadius &&
  38879. (b.sweepRadius = g.sweepRadius);
  38880. d = d.next
  38881. }
  38882. b.validate_mass();
  38883. b.validate_inertia();
  38884. null != b.shapes.head && (b.validate_aabb(), b.validate_worldCOM());
  38885. b.validate_gravMass();
  38886. b.zip_axis && (b.zip_axis = !1, b.axisx = Math.sin(b.rot), b.axisy = Math.cos(b.rot), null);
  38887. if (!b.nomove && b.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && 0 == b.mass) throw "Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false";
  38888. if (!b.norotate && b.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && 0 == b.inertia) throw "Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false";
  38889. if (b.component.woken && null != b.cbSet)
  38890. for (d = b.cbSet.bodylisteners.head; null != d;) g = d.elt, g.event == c.util.ZPP_Flags.id_CbEvent_WAKE && (g = this.push_callback(g), g.event = c.util.ZPP_Flags.id_CbEvent_WAKE, g.body = b), d = d.next;
  38891. b.component.woken = !1;
  38892. for (d = b.shapes.head; null != d;) b = d.elt, this.bphase.sync(b), d = d.next;
  38893. a = a.next
  38894. }
  38895. for (a = this.kinematics.head; null != a;) {
  38896. b = a.elt;
  38897. b.sweepRadius = 0;
  38898. for (d = b.shapes.head; null != d;) {
  38899. g = d.elt;
  38900. if (g.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
  38901. g.polygon.splice_collinear();
  38902. f = e = g.polygon.valid();
  38903. null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  38904. if (f != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Cannot simulate with an invalid Polygon : " + g.polygon.outer.toString() + " is invalid : " + e.toString();
  38905. g.polygon.validate_gaxi()
  38906. }
  38907. g.validate_sweepRadius();
  38908. g.sweepRadius > b.sweepRadius && (b.sweepRadius = g.sweepRadius);
  38909. d = d.next
  38910. }
  38911. b.validate_mass();
  38912. b.validate_inertia();
  38913. null != b.shapes.head &&
  38914. (b.validate_aabb(), b.validate_worldCOM());
  38915. b.validate_gravMass();
  38916. b.zip_axis && (b.zip_axis = !1, b.axisx = Math.sin(b.rot), b.axisy = Math.cos(b.rot), null);
  38917. if (!b.nomove && b.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && 0 == b.mass) throw "Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false";
  38918. if (!b.norotate && b.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && 0 == b.inertia) throw "Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false";
  38919. for (d = b.shapes.head; null != d;) b =
  38920. d.elt, this.bphase.sync(b), d = d.next;
  38921. a = a.next
  38922. }
  38923. for (a = this.live_constraints.head; null != a;) {
  38924. b = a.elt;
  38925. if (b.active) {
  38926. b.validate();
  38927. if (b.component.woken && null != b.cbSet)
  38928. for (d = b.cbSet.conlisteners.head; null != d;) g = d.elt, g.event == c.util.ZPP_Flags.id_CbEvent_WAKE && (g = this.push_callback(g), g.event = c.util.ZPP_Flags.id_CbEvent_WAKE, g.constraint = b), d = d.next;
  38929. b.component.woken = !1
  38930. }
  38931. a = a.next
  38932. }
  38933. },
  38934. static_validation: function (a) {
  38935. null != a.shapes.head && a.validate_aabb();
  38936. a.validate_mass();
  38937. a.validate_inertia();
  38938. if (0 != a.velx || 0 != a.vely ||
  38939. 0 != a.angvel) throw "Error: Static body cannot have any real velocity, only kinematic or surface velocities";
  38940. for (var b = a.shapes.head; null != b;) {
  38941. var d = b.elt;
  38942. if (d.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
  38943. d.polygon.splice_collinear();
  38944. var g = d.polygon.valid(),
  38945. e = g,
  38946. f = void 0;
  38947. null == c.util.ZPP_Flags.ValidationResult_VALID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ValidationResult_VALID = new h.shape.ValidationResult, c.util.ZPP_Flags.internal = !1);
  38948. f = c.util.ZPP_Flags.ValidationResult_VALID;
  38949. if (e != f) throw "Error: Cannot simulate with an invalid Polygon : " +
  38950. d.polygon.outer.toString() + " is invalid : " + g.toString();
  38951. d.polygon.validate_gaxi()
  38952. }
  38953. b = b.next
  38954. }
  38955. a.sweepFrozen = !0
  38956. },
  38957. sleepArbiters: function () {
  38958. var a = null,
  38959. b = this.c_arbiters_true,
  38960. d = b.head,
  38961. c = null != this.c_arbiters_false;
  38962. c && null == d && (c = !1, d = this.c_arbiters_false.head, b = this.c_arbiters_false, a = null);
  38963. for (; null != d;) {
  38964. var e = d.elt;
  38965. e.b1.component.sleeping && e.b2.component.sleeping ? (e.sleep_stamp = this.stamp, e.sleeping = !0, d = b.inlined_erase(a)) : (a = d, d = d.next);
  38966. c && null == d && (c = !1, d = this.c_arbiters_false.head, b = this.c_arbiters_false,
  38967. a = null)
  38968. }
  38969. a = null;
  38970. b = this.f_arbiters;
  38971. d = b.head;
  38972. c = !1;
  38973. for (; null != d;) e = d.elt, e.b1.component.sleeping && e.b2.component.sleeping ? (e.sleep_stamp = this.stamp, e.sleeping = !0, d = b.inlined_erase(a)) : (a = d, d = d.next), c && null == d && (c = !1, d = null.begin(), a = b = null);
  38974. a = null;
  38975. b = this.s_arbiters;
  38976. d = b.head;
  38977. c = !1;
  38978. for (; null != d;) e = d.elt, e.b1.component.sleeping && e.b2.component.sleeping ? (e.sleep_stamp = this.stamp, e.sleeping = !0, d = b.inlined_erase(a)) : (a = d, d = d.next), c && null == d && (c = !1, d = null.begin(), a = b = null)
  38979. },
  38980. doForests: function (a) {
  38981. for (var b =
  38982. this.c_arbiters_false.head; null != b;) {
  38983. var d = b.elt;
  38984. if (!d.cleared && d.up_stamp == this.stamp && 0 != (d.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && d.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && d.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
  38985. var g = d.b1.component == d.b1.component.parent ? d.b1.component : function (a) {
  38986. a = d.b1.component;
  38987. for (var b = null; a != a.parent;) {
  38988. var c = a.parent;
  38989. a.parent = b;
  38990. b = a;
  38991. a = c
  38992. }
  38993. for (; null != b;) c = b.parent, b.parent = a, b = c;
  38994. return a
  38995. }(this),
  38996. e = d.b2.component == d.b2.component.parent ? d.b2.component :
  38997. function (a) {
  38998. a = d.b2.component;
  38999. for (var b = null; a != a.parent;) {
  39000. var c = a.parent;
  39001. a.parent = b;
  39002. b = a;
  39003. a = c
  39004. }
  39005. for (; null != b;) c = b.parent, b.parent = a, b = c;
  39006. return a
  39007. }(this);
  39008. g != e && (g.rank < e.rank ? g.parent = e : g.rank > e.rank ? e.parent = g : (e.parent = g, g.rank++))
  39009. }
  39010. b = b.next
  39011. }
  39012. for (b = this.f_arbiters.head; null != b;) d = b.elt, d.cleared || d.up_stamp != this.stamp || 0 == (d.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) || d.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || d.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || (g = d.b1.component == d.b1.component.parent ?
  39013. d.b1.component : function (a) {
  39014. a = d.b1.component;
  39015. for (var b = null; a != a.parent;) {
  39016. var c = a.parent;
  39017. a.parent = b;
  39018. b = a;
  39019. a = c
  39020. }
  39021. for (; null != b;) c = b.parent, b.parent = a, b = c;
  39022. return a
  39023. }(this), e = d.b2.component == d.b2.component.parent ? d.b2.component : function (a) {
  39024. a = d.b2.component;
  39025. for (var b = null; a != a.parent;) {
  39026. var c = a.parent;
  39027. a.parent = b;
  39028. b = a;
  39029. a = c
  39030. }
  39031. for (; null != b;) c = b.parent, b.parent = a, b = c;
  39032. return a
  39033. }(this), g != e && (g.rank < e.rank ? g.parent = e : g.rank > e.rank ? e.parent = g : (e.parent = g, g.rank++))), b = b.next;
  39034. for (b = this.live_constraints.head; null != b;) g = b.elt,
  39035. g.forest(), b = b.next;
  39036. for (; null != this.live.head;) {
  39037. var b = this.live.inlined_pop_unsafe(),
  39038. f = b.component,
  39039. g = f == f.parent ? f : function (a) {
  39040. a = f;
  39041. for (var b = null; a != a.parent;) {
  39042. var d = a.parent;
  39043. a.parent = b;
  39044. b = a;
  39045. a = d
  39046. }
  39047. for (; null != b;) d = b.parent, b.parent = a, b = d;
  39048. return a
  39049. }(this);
  39050. null == g.island && (null == c.space.ZPP_Island.zpp_pool ? g.island = new c.space.ZPP_Island : (g.island = c.space.ZPP_Island.zpp_pool, c.space.ZPP_Island.zpp_pool = g.island.next, g.island.next = null), g.island.waket = 0, this.islands.inlined_add(g.island), g.island.sleep = !0);
  39051. f.island = g.island;
  39052. f.island.comps.inlined_add(f);
  39053. b = b.atRest(a);
  39054. f.island.sleep = f.island.sleep && b;
  39055. f.waket > f.island.waket && (f.island.waket = f.waket)
  39056. }
  39057. for (; null != this.live_constraints.head;) b = this.live_constraints.inlined_pop_unsafe(), f = b.component, g = f == f.parent ? f : function (a) {
  39058. a = f;
  39059. for (var b = null; a != a.parent;) {
  39060. var d = a.parent;
  39061. a.parent = b;
  39062. b = a;
  39063. a = d
  39064. }
  39065. for (; null != b;) d = b.parent, b.parent = a, b = d;
  39066. return a
  39067. }(this), f.island = g.island, f.island.comps.inlined_add(f), f.waket > f.island.waket && (f.island.waket = f.waket);
  39068. for (; null !=
  39069. this.islands.next;)
  39070. if (b = this.islands.inlined_pop_unsafe(), b.sleep)
  39071. for (b = b.comps.head; null != b;) {
  39072. a = b.elt;
  39073. if (a.isBody) {
  39074. g = a.body;
  39075. g.velx = 0;
  39076. g.vely = 0;
  39077. g.angvel = 0;
  39078. a.sleeping = !0;
  39079. for (a = g.shapes.head; null != a;) this.bphase.sync(a.elt), a = a.next;
  39080. this.bodyCbSleep(g)
  39081. } else g = a.constraint, this.constraintCbSleep(g), a.sleeping = !0;
  39082. b = b.next
  39083. } else {
  39084. for (; null != b.comps.head;) a = b.comps.inlined_pop_unsafe(), a.waket = b.waket, a.isBody ? this.live.inlined_add(a.body) : this.live_constraints.inlined_add(a.constraint), a.sleeping = !1, a.island =
  39085. null, a.parent = a, a.rank = 0;
  39086. b.next = c.space.ZPP_Island.zpp_pool;
  39087. c.space.ZPP_Island.zpp_pool = b
  39088. }
  39089. },
  39090. wake_constraint: function (a, b) {
  39091. null == b && (b = !1);
  39092. return a.active && (a.component.waket = this.stamp + (this.midstep ? 0 : 1), a.component.sleeping) ? (null == a.component.island ? (a.component.sleeping = !1, this.live_constraints.inlined_add(a), a.wake_connected(), b || this.constraintCbWake(a)) : this.wakeIsland(a.component.island), !0) : !1
  39093. },
  39094. really_wake: function (a, b) {
  39095. null == b && (b = !1);
  39096. if (null == a.component.island) {
  39097. a.component.sleeping = !1;
  39098. a.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC || a.type == c.util.ZPP_Flags.id_BodyType_STATIC ? this.staticsleep.inlined_add(a) : this.live.inlined_add(a);
  39099. for (var d = a.constraints.head; null != d;) {
  39100. var g = d.elt;
  39101. g.space == this && this.wake_constraint(g);
  39102. d = d.next
  39103. }
  39104. for (d = a.arbiters.head; null != d;) {
  39105. g = d.elt;
  39106. if (g.sleeping)
  39107. if (g.sleeping = !1, g.up_stamp += this.stamp + (this.midstep ? 0 : 1) - g.sleep_stamp, g.type == c.dynamics.ZPP_Arbiter.COL) {
  39108. var e = g.colarb;
  39109. e.stat ? this.c_arbiters_true.inlined_add(e) : this.c_arbiters_false.inlined_add(e)
  39110. } else g.type ==
  39111. c.dynamics.ZPP_Arbiter.FLUID ? this.f_arbiters.inlined_add(g.fluidarb) : this.s_arbiters.inlined_add(g.sensorarb);
  39112. g.type != c.dynamics.ZPP_Arbiter.SENSOR && !g.cleared && g.up_stamp >= this.stamp && 0 != (g.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && (g.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && g.b1.component.sleeping && (e = g.b1, e.world || (e.component.waket = this.stamp + (this.midstep ? 0 : 1), e.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (e.kinematicDelaySleep = !0), e.component.sleeping && this.really_wake(e, !1))),
  39113. g.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && g.b2.component.sleeping && (e = g.b2, e.world || (e.component.waket = this.stamp + (this.midstep ? 0 : 1), e.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (e.kinematicDelaySleep = !0), e.component.sleeping && this.really_wake(e, !1))));
  39114. d = d.next
  39115. }
  39116. b || a.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || this.bodyCbWake(a);
  39117. if (!b && !this.bphase.is_sweep && a.type != c.util.ZPP_Flags.id_BodyType_STATIC)
  39118. for (d = a.shapes.head; null != d;) g = d.elt, null != g.node && this.bphase.sync(g), d = d.next
  39119. } else this.wakeIsland(a.component.island)
  39120. },
  39121. non_inlined_wake: function (a, b) {
  39122. null == b && (b = !1);
  39123. a.world || (a.component.waket = this.stamp + (this.midstep ? 0 : 1), a.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (a.kinematicDelaySleep = !0), a.component.sleeping && this.really_wake(a, b))
  39124. },
  39125. wakeIsland: function (a) {
  39126. for (; null != a.comps.head;) {
  39127. var b = a.comps.pop_unsafe();
  39128. b.waket = this.stamp + (this.midstep ? 0 : 1);
  39129. if (b.isBody) {
  39130. var d = b.body;
  39131. this.live.add(d);
  39132. for (var g = d.arbiters.head; null != g;) {
  39133. var e = g.elt;
  39134. e.sleeping && (e.sleeping = !1, e.up_stamp += this.stamp - e.sleep_stamp, e.type ==
  39135. c.dynamics.ZPP_Arbiter.COL ? (e = e.colarb, e.stat ? this.c_arbiters_true.inlined_add(e) : this.c_arbiters_false.inlined_add(e)) : e.type == c.dynamics.ZPP_Arbiter.FLUID ? this.f_arbiters.inlined_add(e.fluidarb) : this.s_arbiters.inlined_add(e.sensorarb));
  39136. g = g.next
  39137. }
  39138. this.bodyCbWake(d);
  39139. b.sleeping = !1;
  39140. b.island = null;
  39141. b.parent = b;
  39142. b.rank = 0;
  39143. if (d.type != c.util.ZPP_Flags.id_BodyType_STATIC)
  39144. for (g = d.shapes.head; null != g;) b = g.elt, null != b.node && this.bphase.sync(b), g = g.next
  39145. } else g = b.constraint, this.live_constraints.inlined_add(g), this.constraintCbWake(g),
  39146. b.sleeping = !1, b.island = null, b.parent = b, b.rank = 0
  39147. }
  39148. a.next = c.space.ZPP_Island.zpp_pool;
  39149. c.space.ZPP_Island.zpp_pool = a
  39150. },
  39151. wakeCompound: function (a) {
  39152. for (var b = a.bodies.head; null != b;) {
  39153. var d = b.elt;
  39154. d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !1));
  39155. b = b.next
  39156. }
  39157. for (b = a.constraints.head; null != b;) d = b.elt, this.wake_constraint(d), b = b.next;
  39158. for (b = a.compounds.head; null != b;) d = b.elt, this.wakeCompound(d),
  39159. b = b.next
  39160. },
  39161. freshInteractorType: function (a, b) {
  39162. null == b && (b = a);
  39163. if (null != a.icompound) {
  39164. for (var d = a.icompound, g = d.bodies.head; null != g;) this.freshInteractorType(g.elt, b), g = g.next;
  39165. for (g = d.compounds.head; null != g;) this.freshInteractorType(g.elt, b), g = g.next
  39166. } else
  39167. for (d = null != a.ishape ? a.ishape : null, g = (null != a.ibody ? a.ibody : a.ishape.body).arbiters.head; null != g;) {
  39168. var e = g.elt;
  39169. if (e.presentable && (null == d || e.ws1 == d || e.ws2 == d)) {
  39170. this.MRCA_chains(e.ws1, e.ws2);
  39171. for (var f = this.mrca1.head; null != f;) {
  39172. for (var h = f.elt, m = this.mrca2.head; null !=
  39173. m;) {
  39174. var k = m.elt;
  39175. if (h == b || k == b) {
  39176. var n = h.cbSet,
  39177. q = k.cbSet;
  39178. n.validate();
  39179. q.validate();
  39180. null != n.manager.pair(n, q).listeners.head && (n = c.phys.ZPP_Interactor.get(h, k), null == n && (n = c.space.ZPP_CallbackSet.get(h, k), this.add_callbackset(n)), n.arbiters.inlined_has(e) ? k = !1 : (k = void 0, n.arbiters.inlined_add(e), k = !0), k && e.present++)
  39181. }
  39182. m = m.next
  39183. }
  39184. f = f.next
  39185. }
  39186. }
  39187. g = g.next
  39188. }
  39189. },
  39190. freshListenerType: function (a, b) {
  39191. for (var d = new c.util.ZNPList_ZPP_Interactor, g = a.interactors.head; null != g;) {
  39192. var e = g.elt;
  39193. d.add(e);
  39194. g = g.next
  39195. }
  39196. if (a != b)
  39197. for (g = b.interactors.head; null !=
  39198. g;) e = g.elt, d.add(e), g = g.next;
  39199. for (; null != d.head;)
  39200. if (g = d.pop_unsafe(), null != g.icompound) {
  39201. for (var f = g.icompound, g = f.bodies.head; null != g;) e = g.elt, d.add(e), g = g.next;
  39202. for (g = f.compounds.head; null != g;) e = g.elt, d.add(e), g = g.next
  39203. } else
  39204. for (e = null != g.ishape ? g.ishape : null, g = (null != g.ibody ? g.ibody : g.ishape.body).arbiters.head; null != g;) {
  39205. f = g.elt;
  39206. if (f.presentable && (null == e || f.ws1 == e || f.ws2 == e)) {
  39207. this.MRCA_chains(f.ws1, f.ws2);
  39208. for (var h = this.mrca1.head; null != h;) {
  39209. var m = h.elt;
  39210. if (m.cbSet == a || m.cbSet == b)
  39211. for (var k = this.mrca2.head; null !=
  39212. k;) {
  39213. var n = k.elt;
  39214. if (!(m.cbSet == a && n.cbSet != b || m.cbSet == b && n.cbSet != a)) {
  39215. var q = c.phys.ZPP_Interactor.get(m, n);
  39216. null == q && (q = c.space.ZPP_CallbackSet.get(m, n), this.add_callbackset(q));
  39217. q.arbiters.inlined_has(f) ? q = !1 : (n = void 0, q.arbiters.inlined_add(f), q = n = !0);
  39218. q && f.present++
  39219. }
  39220. k = k.next
  39221. }
  39222. h = h.next
  39223. }
  39224. }
  39225. g = g.next
  39226. }
  39227. },
  39228. nullInteractorType: function (a, b) {
  39229. null == b && (b = a);
  39230. if (null != a.icompound) {
  39231. for (var d = a.icompound, g = d.bodies.head; null != g;) this.nullInteractorType(g.elt, b), g = g.next;
  39232. for (g = d.compounds.head; null != g;) this.nullInteractorType(g.elt,
  39233. b), g = g.next
  39234. } else
  39235. for (d = null != a.ishape ? a.ishape : null, g = (null != a.ibody ? a.ibody : a.ishape.body).arbiters.head; null != g;) {
  39236. var e = g.elt;
  39237. if (0 != e.present && (null == d || e.ws1 == d || e.ws2 == d)) {
  39238. this.MRCA_chains(e.ws1, e.ws2);
  39239. for (var f = this.mrca1.head; null != f;) {
  39240. for (var h = f.elt, m = this.mrca2.head; null != m;) {
  39241. var k = m.elt;
  39242. if (h == b || k == b) k = c.phys.ZPP_Interactor.get(h, k), null != k && (e.present--, k.remove_arb(e), null == k.arbiters.head && this.remove_callbackset(k));
  39243. m = m.next
  39244. }
  39245. f = f.next
  39246. }
  39247. }
  39248. g = g.next
  39249. }
  39250. },
  39251. nullListenerType: function (a, b) {
  39252. for (var d =
  39253. new c.util.ZNPList_ZPP_Interactor, g = a.interactors.head; null != g;) {
  39254. var e = g.elt;
  39255. d.add(e);
  39256. g = g.next
  39257. }
  39258. if (a != b)
  39259. for (g = b.interactors.head; null != g;) e = g.elt, d.add(e), g = g.next;
  39260. for (; null != d.head;)
  39261. if (g = d.pop_unsafe(), null != g.icompound) {
  39262. for (var f = g.icompound, g = f.bodies.head; null != g;) e = g.elt, d.add(e), g = g.next;
  39263. for (g = f.compounds.head; null != g;) e = g.elt, d.add(e), g = g.next
  39264. } else
  39265. for (e = null != g.ishape ? g.ishape : null, g = (null != g.ibody ? g.ibody : g.ishape.body).arbiters.head; null != g;) {
  39266. f = g.elt;
  39267. if (0 != f.present && (null == e || f.ws1 == e ||
  39268. f.ws2 == e))
  39269. for (this.MRCA_chains(f.ws1, f.ws2), f = this.mrca1.head; null != f;) {
  39270. var h = f.elt;
  39271. if (h.cbSet == a || h.cbSet == b)
  39272. for (var m = this.mrca2.head; null != m;) {
  39273. var k = m.elt;
  39274. if (!(h.cbSet == a && k.cbSet != b || h.cbSet == b && k.cbSet != a) && (k = c.phys.ZPP_Interactor.get(h, k), null != k)) {
  39275. for (; null != k.arbiters.head;) k.arbiters.pop_unsafe().present--;
  39276. this.remove_callbackset(k)
  39277. }
  39278. m = m.next
  39279. }
  39280. f = f.next
  39281. }
  39282. g = g.next
  39283. }
  39284. },
  39285. constraintCbBreak: function (a) {
  39286. if (null != a.cbSet)
  39287. for (var b = a.cbSet.conlisteners.head; null != b;) {
  39288. var d = b.elt;
  39289. d.event == c.util.ZPP_Flags.id_CbEvent_BREAK &&
  39290. (d = this.push_callback(d), d.event = c.util.ZPP_Flags.id_CbEvent_BREAK, d.constraint = a);
  39291. b = b.next
  39292. }
  39293. },
  39294. constraintCbSleep: function (a) {
  39295. if (null != a.cbSet)
  39296. for (var b = a.cbSet.conlisteners.head; null != b;) {
  39297. var d = b.elt;
  39298. d.event == c.util.ZPP_Flags.id_CbEvent_SLEEP && (d = this.push_callback(d), d.event = c.util.ZPP_Flags.id_CbEvent_SLEEP, d.constraint = a);
  39299. b = b.next
  39300. }
  39301. },
  39302. constraintCbWake: function (a) {
  39303. if (null != a.cbSet)
  39304. if (this.midstep)
  39305. for (var b = a.cbSet.conlisteners.head; null != b;) {
  39306. var d = b.elt;
  39307. d.event == c.util.ZPP_Flags.id_CbEvent_WAKE && (d =
  39308. this.push_callback(d), d.event = c.util.ZPP_Flags.id_CbEvent_WAKE, d.constraint = a);
  39309. b = b.next
  39310. } else a.component.woken = !0
  39311. },
  39312. bodyCbSleep: function (a) {
  39313. if (a.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && null != a.cbSet)
  39314. for (var b = a.cbSet.bodylisteners.head; null != b;) {
  39315. var d = b.elt;
  39316. d.event == c.util.ZPP_Flags.id_CbEvent_SLEEP && (d = this.push_callback(d), d.event = c.util.ZPP_Flags.id_CbEvent_SLEEP, d.body = a);
  39317. b = b.next
  39318. }
  39319. },
  39320. bodyCbWake: function (a) {
  39321. if (a.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && null != a.cbSet)
  39322. if (this.midstep)
  39323. for (var b =
  39324. a.cbSet.bodylisteners.head; null != b;) {
  39325. var d = b.elt;
  39326. d.event == c.util.ZPP_Flags.id_CbEvent_WAKE && (d = this.push_callback(d), d.event = c.util.ZPP_Flags.id_CbEvent_WAKE, d.body = a);
  39327. b = b.next
  39328. } else a.component.woken = !0
  39329. },
  39330. continuousEvent: function (a, b, d, g, e) {
  39331. if (a.body.sweepFrozen && b.body.sweepFrozen || a.body.disableCCD || b.body.disableCCD || null != g && null == g.colarb || 0 == this.interactionType(a, b, a.body, b.body)) return g;
  39332. var f = a.body,
  39333. l = b.body;
  39334. if (d || f.bullet || l.bullet) null == c.geom.ZPP_ToiEvent.zpp_pool ? e = new c.geom.ZPP_ToiEvent :
  39335. (e = c.geom.ZPP_ToiEvent.zpp_pool, c.geom.ZPP_ToiEvent.zpp_pool = e.next, e.next = null), e.failed = !1, e.s1 = e.s2 = null, e.arbiter = null, f = f.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC || l.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC, d && !f ? (a.body.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC ? (e.s2 = a, e.s1 = b) : (e.s1 = a, e.s2 = b), e.kinematic = !1, c.geom.ZPP_SweepDistance.staticSweep(e, this.pre_dt, 0, h.Config.collisionSlopCCD)) : (e.s1 = a, e.s2 = b, e.kinematic = f, e.s1.body.sweepFrozen || e.s2.body.sweepFrozen ? (e.s1.body.sweepFrozen &&
  39336. (a = e.s1, e.s1 = e.s2, e.s2 = a, e.frozen1 = !1, e.frozen2 = !0), c.geom.ZPP_SweepDistance.staticSweep(e, this.pre_dt, 0, h.Config.collisionSlopCCD)) : c.geom.ZPP_SweepDistance.dynamicSweep(e, this.pre_dt, 0, h.Config.collisionSlopCCD)), d && 0 > e.toi || e.failed ? (d = e, d.next = c.geom.ZPP_ToiEvent.zpp_pool, c.geom.ZPP_ToiEvent.zpp_pool = d) : (this.toiEvents.add(e), e.frozen1 = e.s1.body.sweepFrozen, e.frozen2 = e.s2.body.sweepFrozen, e.arbiter = null != g ? g.colarb : null);
  39337. return g
  39338. },
  39339. continuousCollisions: function (a) {
  39340. var b = 2 * Math.PI / a;
  39341. this.bphase.broadphase(this, !1);
  39342. for (var d = 0; 1 > d && null != this.toiEvents.head;) {
  39343. for (var g = null, e = 2, f = !1, l = null, m = null, d = this.toiEvents.head; null != d;) {
  39344. var k = d.elt,
  39345. n = k.s1.body,
  39346. q = k.s2.body;
  39347. if (n.sweepFrozen && q.sweepFrozen)
  39348. if (0 != k.toi && c.geom.ZPP_Collide.testCollide_safe(k.s1, k.s2)) k.toi = 0;
  39349. else {
  39350. d = this.toiEvents.erase(m);
  39351. n = k;
  39352. n.next = c.geom.ZPP_ToiEvent.zpp_pool;
  39353. c.geom.ZPP_ToiEvent.zpp_pool = n;
  39354. continue
  39355. }
  39356. if (k.frozen1 != n.sweepFrozen || k.frozen2 != q.sweepFrozen)
  39357. if (k.kinematic) {
  39358. d = this.toiEvents.erase(m);
  39359. n = k;
  39360. n.next = c.geom.ZPP_ToiEvent.zpp_pool;
  39361. c.geom.ZPP_ToiEvent.zpp_pool = n;
  39362. continue
  39363. } else if (k.frozen1 = n.sweepFrozen, k.frozen2 = q.sweepFrozen, k.frozen1 && (n = k.s1, k.s1 = k.s2, k.s2 = n, k.frozen1 = !1, k.frozen2 = !0), c.geom.ZPP_SweepDistance.staticSweep(k, a, 0, h.Config.collisionSlopCCD), 0 > k.toi) {
  39364. d = this.toiEvents.erase(m);
  39365. n = k;
  39366. n.next = c.geom.ZPP_ToiEvent.zpp_pool;
  39367. c.geom.ZPP_ToiEvent.zpp_pool = n;
  39368. continue
  39369. }
  39370. 0 <= k.toi && (k.toi < e || !f && k.kinematic) && (g = k, e = k.toi, f = k.kinematic, l = m);
  39371. m = d;
  39372. d = d.next
  39373. }
  39374. if (null == g) break;
  39375. this.toiEvents.erase(l);
  39376. d = g.toi;
  39377. n = g.s1.body;
  39378. q = g.s2.body;
  39379. n.sweepFrozen ||
  39380. (n.sweepIntegrate(d * a), n.sweepValidate(g.s1));
  39381. q.sweepFrozen || (q.sweepIntegrate(d * a), q.sweepValidate(g.s2));
  39382. e = this.narrowPhase(g.s1, g.s2, !0, g.arbiter, !0);
  39383. null == e ? null != g.arbiter && null != g.arbiter.pair && (g.arbiter.pair.arb = null, g.arbiter.pair = null) : !this.presteparb(e, a, !0) && e.type == c.dynamics.ZPP_Arbiter.COL && e.active && 0 != (e.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && (e.colarb.warmStart(), e.colarb.applyImpulseVel(), e.colarb.applyImpulseVel(), e.colarb.applyImpulseVel(), e.colarb.applyImpulseVel(),
  39384. n.sweep_angvel = n.angvel % b, q.sweep_angvel = q.angvel % b);
  39385. null != e && e.active && 0 != (e.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && e.type == c.dynamics.ZPP_Arbiter.COL && (n.sweepFrozen || n.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC || (n.sweepFrozen = !0, n.angvel = g.failed ? n.sweep_angvel = 0 : g.slipped ? n.sweep_angvel *= h.Config.angularCCDSlipScale : n.sweep_angvel), q.sweepFrozen || q.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC || (q.sweepFrozen = !0, q.angvel = g.failed ? q.sweep_angvel = 0 : g.slipped ? q.sweep_angvel *= h.Config.angularCCDSlipScale :
  39386. q.sweep_angvel))
  39387. }
  39388. for (; null != this.toiEvents.head;) n = k = this.toiEvents.pop_unsafe(), n.next = c.geom.ZPP_ToiEvent.zpp_pool, c.geom.ZPP_ToiEvent.zpp_pool = n;
  39389. for (d = this.kinematics.head; null != d;) b = d.elt, b.sweepIntegrate(a), b.sweepTime = 0, d = d.next;
  39390. for (d = this.live.head; null != d;) b = d.elt, b.sweepFrozen || b.sweepIntegrate(a), b.sweepTime = 0, d = d.next
  39391. },
  39392. step: function (a, b, d) {
  39393. var g = this;
  39394. if (this.midstep) throw "Error: ... REALLY?? you're going to call space.step() inside of space.step()? COME ON!!";
  39395. this.time += a;
  39396. this.pre_dt = a;
  39397. this.midstep = !0;
  39398. this.stamp++;
  39399. this.validation();
  39400. this.bphase.broadphase(this, !0);
  39401. this.prestep(a);
  39402. if (this.sortcontacts) {
  39403. var e = this.c_arbiters_false;
  39404. if (null != e.head && null != e.head.next) {
  39405. var f = e.head,
  39406. h = null,
  39407. m = null,
  39408. k = null,
  39409. n = null,
  39410. q = 1,
  39411. r, s, w;
  39412. do {
  39413. r = 0;
  39414. m = f;
  39415. for (h = f = null; null != m;) {
  39416. r++;
  39417. k = m;
  39418. s = 0;
  39419. for (w = q; null != k && s < q;) s++, k = k.next;
  39420. for (; 0 < s || 0 < w && null != k;) 0 == s ? (n = k, k = k.next, w--) : 0 == w || null == k ? (n = m, m = m.next, s--) : (m.elt.active && k.elt.active ? m.elt.oc1.dist < k.elt.oc1.dist : 1) ? (n = m, m = m.next, s--) : (n = k, k = k.next, w--), null != h ?
  39421. h.next = n : f = n, h = n;
  39422. m = k
  39423. }
  39424. h.next = null;
  39425. q <<= 1
  39426. } while (1 < r);
  39427. e.head = f;
  39428. e.modified = !0;
  39429. e.pushmod = !0
  39430. }
  39431. }
  39432. this.updateVel(a);
  39433. this.warmStart();
  39434. this.iterateVel(b);
  39435. for (b = this.kinematics.head; null != b;) e = b.elt, e.pre_posx = e.posx, e.pre_posy = e.posy, e.pre_rot = e.rot, b = b.next;
  39436. for (b = this.live.head; null != b;) e = b.elt, e.pre_posx = e.posx, e.pre_posy = e.posy, e.pre_rot = e.rot, b = b.next;
  39437. this.updatePos(a);
  39438. this.continuous = !0;
  39439. this.continuousCollisions(a);
  39440. this.continuous = !1;
  39441. this.iteratePos(d);
  39442. for (b = this.kinematics.head; null != b;) e = b.elt, d = !(e.posx ==
  39443. e.pre_posx && e.posy == e.pre_posy), f = e.pre_rot != e.rot, d && e.invalidate_pos(), f && e.invalidate_rot(), b = b.next;
  39444. for (b = this.live.head; null != b;) e = b.elt, d = !(e.posx == e.pre_posx && e.posy == e.pre_posy), f = e.pre_rot != e.rot, d && e.invalidate_pos(), f && e.invalidate_rot(), b = b.next;
  39445. d = null;
  39446. for (b = this.staticsleep.head; null != b;) e = b.elt, e.type != c.util.ZPP_Flags.id_BodyType_KINEMATIC || 0 == e.velx && 0 == e.vely && 0 == e.angvel ? e.kinematicDelaySleep ? (e.kinematicDelaySleep = !1, b = b.next) : (e.component.sleeping = !0, b = this.staticsleep.inlined_erase(d)) :
  39447. (d = b, b = b.next);
  39448. this.doForests(a);
  39449. this.sleepArbiters();
  39450. this.midstep = !1;
  39451. a = null;
  39452. for (b = this.callbackset_list.next; null != b;) d = [b], null == d[0].arbiters.head ? (b = this.callbackset_list.inlined_erase(a), d = d[0], d.int1 = d.int2 = null, d.id = d.di = -1, d.freed = !0, null, d.next = c.space.ZPP_CallbackSet.zpp_pool, c.space.ZPP_CallbackSet.zpp_pool = d) : (a = [d[0].sleeping()], c.callbacks.ZPP_CbSet.find_all(d[0].int1.cbSet, d[0].int2.cbSet, c.util.ZPP_Flags.id_CbEvent_ONGOING, function (a, b) {
  39453. return function (d) {
  39454. if ((!a[0] || d.allowSleepingCallbacks) &&
  39455. !b[0].empty_arb(d.itype)) {
  39456. var e = g.push_callback(d);
  39457. e.event = c.util.ZPP_Flags.id_CbEvent_ONGOING;
  39458. c.phys.ZPP_Interactor.int_callback(b[0], d, e);
  39459. e.set = b[0]
  39460. }
  39461. }
  39462. }(a, d)), a = b, b = b.next);
  39463. for (; !this.callbacks.empty();) a = this.callbacks.pop(), a.listener.type == c.util.ZPP_Flags.id_ListenerType_BODY ? (d = a.listener.body, d.handler(a.wrapper_body())) : a.listener.type == c.util.ZPP_Flags.id_ListenerType_CONSTRAINT ? (d = a.listener.constraint, d.handler(a.wrapper_con())) : a.listener.type == c.util.ZPP_Flags.id_ListenerType_INTERACTION &&
  39464. (d = a.listener.interaction, d.handleri(a.wrapper_int())), d = a, d.int1 = d.int2 = null, d.body = null, d.constraint = null, d.listener = null, null != d.wrap_arbiters && (d.wrap_arbiters.zpp_inner.inner = null), d.set = null, d.next = c.callbacks.ZPP_Callback.zpp_pool, c.callbacks.ZPP_Callback.zpp_pool = d
  39465. },
  39466. push_callback: function (a) {
  39467. var b;
  39468. null == c.callbacks.ZPP_Callback.zpp_pool ? b = new c.callbacks.ZPP_Callback : (b = c.callbacks.ZPP_Callback.zpp_pool, c.callbacks.ZPP_Callback.zpp_pool = b.next, b.next = null);
  39469. null;
  39470. this.callbacks.push(b);
  39471. b.listener =
  39472. a;
  39473. return b
  39474. },
  39475. convexMultiCast: function (a, b, d, g, e) {
  39476. var f;
  39477. null == c.geom.ZPP_ToiEvent.zpp_pool ? f = new c.geom.ZPP_ToiEvent : (f = c.geom.ZPP_ToiEvent.zpp_pool, c.geom.ZPP_ToiEvent.zpp_pool = f.next, f.next = null);
  39478. f.failed = !1;
  39479. f.s1 = f.s2 = null;
  39480. f.arbiter = null;
  39481. a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.validate_worldCOM() : a.polygon.validate_gaxi();
  39482. var l = a.body,
  39483. m = l.posx,
  39484. k = l.posy;
  39485. l.sweepTime = 0;
  39486. l.sweep_angvel = l.angvel;
  39487. l.sweepIntegrate(b);
  39488. var n = l.posx,
  39489. q = l.posy;
  39490. a.validate_sweepRadius();
  39491. var r = a.sweepRadius,
  39492. s;
  39493. null ==
  39494. c.geom.ZPP_AABB.zpp_pool ? s = new c.geom.ZPP_AABB : (s = c.geom.ZPP_AABB.zpp_pool, c.geom.ZPP_AABB.zpp_pool = s.next, s.next = null);
  39495. null;
  39496. s.minx = (m < n ? m : n) - r;
  39497. s.maxx = (m > n ? m : n) + r;
  39498. s.miny = (k < q ? k : q) - r;
  39499. s.maxy = (k > q ? k : q) + r;
  39500. d = this.convexShapeList = this.bphase.shapesInAABB(s, !1, !1, null == d ? null : d.zpp_inner, this.convexShapeList);
  39501. null != s.outer && (s.outer.zpp_inner = null, s.outer = null);
  39502. s.wrap_min = s.wrap_max = null;
  39503. s._invalidate = null;
  39504. s._validate = null;
  39505. s.next = c.geom.ZPP_AABB.zpp_pool;
  39506. c.geom.ZPP_AABB.zpp_pool = s;
  39507. e = null == e ? new h.geom.ConvexResultList :
  39508. e;
  39509. d.zpp_inner.valmod();
  39510. for (s = h.shape.ShapeIterator.get(d); s.hasNext();)
  39511. if (m = s.next(), m != a.outer && (null != m.zpp_inner.body ? m.zpp_inner.body.outer : null) != l.outer && (f.s1 = a, f.s2 = m.zpp_inner, g ? (m.zpp_inner.validate_sweepRadius(), (null != m.zpp_inner.body ? m.zpp_inner.body.outer : null).zpp_inner.sweep_angvel = (null != m.zpp_inner.body ? m.zpp_inner.body.outer : null).zpp_inner.angvel, (null != m.zpp_inner.body ? m.zpp_inner.body.outer : null).zpp_inner.sweepTime = 0, c.geom.ZPP_SweepDistance.dynamicSweep(f, b, 0, 0, !0), (null !=
  39512. m.zpp_inner.body ? m.zpp_inner.body.outer : null).zpp_inner.sweepIntegrate(0), (null != m.zpp_inner.body ? m.zpp_inner.body.outer : null).zpp_inner.sweepValidate(m.zpp_inner)) : c.geom.ZPP_SweepDistance.staticSweep(f, b, 0, 0), f.toi *= b, 0 < f.toi)) {
  39513. m = c.geom.ZPP_ConvexRayResult.getConvex(h.geom.Vec2.get(-f.axis.x, -f.axis.y, null), h.geom.Vec2.get(f.c2.x, f.c2.y, null), f.toi, m);
  39514. k = null;
  39515. for (n = e.zpp_inner.inner.head; null != n;) {
  39516. q = n.elt;
  39517. if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  39518. r = m.zpp_inner.toiDistance;
  39519. if (null != q.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  39520. if (r < q.zpp_inner.toiDistance) break;
  39521. k = n;
  39522. n = n.next
  39523. }
  39524. e.zpp_inner.inner.inlined_insert(k, m)
  39525. }
  39526. d.clear();
  39527. s = f;
  39528. s.next = c.geom.ZPP_ToiEvent.zpp_pool;
  39529. c.geom.ZPP_ToiEvent.zpp_pool = s;
  39530. l.sweepIntegrate(0);
  39531. l.sweepValidate(a);
  39532. return e
  39533. },
  39534. prepareCast: function (a) {
  39535. a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.validate_worldCOM() : a.polygon.validate_gaxi()
  39536. },
  39537. convexCast: function (a, b, d, g) {
  39538. var e;
  39539. null == c.geom.ZPP_ToiEvent.zpp_pool ?
  39540. e = new c.geom.ZPP_ToiEvent : (e = c.geom.ZPP_ToiEvent.zpp_pool, c.geom.ZPP_ToiEvent.zpp_pool = e.next, e.next = null);
  39541. e.failed = !1;
  39542. e.s1 = e.s2 = null;
  39543. e.arbiter = null;
  39544. a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.validate_worldCOM() : a.polygon.validate_gaxi();
  39545. var f = a.body,
  39546. l = f.posx,
  39547. m = f.posy;
  39548. f.sweepTime = 0;
  39549. f.sweep_angvel = f.angvel;
  39550. f.sweepIntegrate(b);
  39551. var k = f.posx,
  39552. n = f.posy;
  39553. a.validate_sweepRadius();
  39554. var q = a.sweepRadius,
  39555. r;
  39556. null == c.geom.ZPP_AABB.zpp_pool ? r = new c.geom.ZPP_AABB : (r = c.geom.ZPP_AABB.zpp_pool, c.geom.ZPP_AABB.zpp_pool =
  39557. r.next, r.next = null);
  39558. null;
  39559. r.minx = (l < k ? l : k) - q;
  39560. r.maxx = (l > k ? l : k) + q;
  39561. r.miny = (m < n ? m : n) - q;
  39562. r.maxy = (m > n ? m : n) + q;
  39563. d = this.convexShapeList = this.bphase.shapesInAABB(r, !1, !1, null == d ? null : d.zpp_inner, this.convexShapeList);
  39564. var s = r;
  39565. null != s.outer && (s.outer.zpp_inner = null, s.outer = null);
  39566. s.wrap_min = s.wrap_max = null;
  39567. s._invalidate = null;
  39568. s._validate = null;
  39569. s.next = c.geom.ZPP_AABB.zpp_pool;
  39570. c.geom.ZPP_AABB.zpp_pool = s;
  39571. k = m = k = m = l = r = l = r = 0;
  39572. n = null;
  39573. q = b + 1;
  39574. d.zpp_inner.valmod();
  39575. for (s = h.shape.ShapeIterator.get(d); s.hasNext();) {
  39576. var w = s.next();
  39577. w != a.outer && (null != w.zpp_inner.body ? w.zpp_inner.body.outer : null) != f.outer && (e.s1 = a, e.s2 = w.zpp_inner, g ? (w.zpp_inner.validate_sweepRadius(), (null != w.zpp_inner.body ? w.zpp_inner.body.outer : null).zpp_inner.sweep_angvel = (null != w.zpp_inner.body ? w.zpp_inner.body.outer : null).zpp_inner.angvel, (null != w.zpp_inner.body ? w.zpp_inner.body.outer : null).zpp_inner.sweepTime = 0, c.geom.ZPP_SweepDistance.dynamicSweep(e, b, 0, 0, !0), (null != w.zpp_inner.body ? w.zpp_inner.body.outer : null).zpp_inner.sweepIntegrate(0), (null != w.zpp_inner.body ?
  39578. w.zpp_inner.body.outer : null).zpp_inner.sweepValidate(w.zpp_inner)) : c.geom.ZPP_SweepDistance.staticSweep(e, b, 0, 0), e.toi *= b, 0 < e.toi && e.toi < q && (q = e.toi, r = e.axis.x, l = e.axis.y, m = e.c2.x, k = e.c2.y, n = w))
  39579. }
  39580. d.clear();
  39581. s = e;
  39582. s.next = c.geom.ZPP_ToiEvent.zpp_pool;
  39583. c.geom.ZPP_ToiEvent.zpp_pool = s;
  39584. f.sweepIntegrate(0);
  39585. f.sweepValidate(a);
  39586. return q <= b ? c.geom.ZPP_ConvexRayResult.getConvex(h.geom.Vec2.get(-r, -l, null), h.geom.Vec2.get(m, k, null), q, n) : null
  39587. },
  39588. rayMultiCast: function (a, b, d, c) {
  39589. return this.bphase.rayMultiCast(a.zpp_inner,
  39590. b, null == d ? null : d.zpp_inner, c)
  39591. },
  39592. rayCast: function (a, b, d) {
  39593. return this.bphase.rayCast(a.zpp_inner, b, null == d ? null : d.zpp_inner)
  39594. },
  39595. bodiesInShape: function (a, b, d, c) {
  39596. return this.bphase.bodiesInShape(a, b, d, c)
  39597. },
  39598. shapesInShape: function (a, b, d, c) {
  39599. return this.bphase.shapesInShape(a, b, d, c)
  39600. },
  39601. bodiesInCircle: function (a, b, d, c, e) {
  39602. return this.bphase.bodiesInCircle(function (b) {
  39603. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  39604. a.zpp_inner.validate();
  39605. return a.zpp_inner.x
  39606. }(this), function (b) {
  39607. if (null !=
  39608. a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  39609. a.zpp_inner.validate();
  39610. return a.zpp_inner.y
  39611. }(this), b, d, c, e)
  39612. },
  39613. shapesInCircle: function (a, b, d, c, e) {
  39614. return this.bphase.shapesInCircle(function (b) {
  39615. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  39616. a.zpp_inner.validate();
  39617. return a.zpp_inner.x
  39618. }(this), function (b) {
  39619. if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  39620. a.zpp_inner.validate();
  39621. return a.zpp_inner.y
  39622. }(this), b, d, c, e)
  39623. },
  39624. bodiesInAABB: function (a,
  39625. b, d, c, e) {
  39626. return this.bphase.bodiesInAABB(a.zpp_inner, b, d, c, e)
  39627. },
  39628. shapesInAABB: function (a, b, d, c, e) {
  39629. return this.bphase.shapesInAABB(a.zpp_inner, b, d, c, e)
  39630. },
  39631. bodiesUnderPoint: function (a, b, d, c) {
  39632. return this.bphase.bodiesUnderPoint(a, b, d, c)
  39633. },
  39634. shapesUnderPoint: function (a, b, d, c) {
  39635. return this.bphase.shapesUnderPoint(a, b, d, c)
  39636. },
  39637. remBody: function (a, b) {
  39638. null == b && (b = -1);
  39639. if (a.type == c.util.ZPP_Flags.id_BodyType_STATIC) {
  39640. var d = a;
  39641. d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC &&
  39642. (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !0));
  39643. this.staticsleep.remove(a)
  39644. } else a.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC ? (d = a, d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !0)), this.live.remove(a)) : (b != c.util.ZPP_Flags.id_BodyType_KINEMATIC && this.kinematics.remove(a), d = a, d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC &&
  39645. (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !0)), this.staticsleep.remove(a));
  39646. for (d = a.shapes.head; null != d;) this.removed_shape(d.elt, !0), d = d.next;
  39647. a.removedFromSpace();
  39648. a.space = null
  39649. },
  39650. addBody: function (a, b) {
  39651. null == b && (b = -1);
  39652. a.space = this;
  39653. a.addedToSpace();
  39654. a.component.sleeping = !0;
  39655. a.world || (a.component.waket = this.stamp + (this.midstep ? 0 : 1), a.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (a.kinematicDelaySleep = !0), a.component.sleeping && this.really_wake(a, !0));
  39656. for (var d = a.shapes.head; null !=
  39657. d;) this.added_shape(d.elt, !0), d = d.next;
  39658. a.type == c.util.ZPP_Flags.id_BodyType_STATIC ? this.static_validation(a) : a.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC && b != c.util.ZPP_Flags.id_BodyType_KINEMATIC && this.kinematics.add(a)
  39659. },
  39660. remCompound: function (a) {
  39661. for (var b = a.bodies.head; null != b;) {
  39662. var d = b.elt;
  39663. this.remBody(d);
  39664. b = b.next
  39665. }
  39666. for (b = a.constraints.head; null != b;) d = b.elt, this.remConstraint(d), b = b.next;
  39667. for (b = a.compounds.head; null != b;) d = b.elt, this.remCompound(d), b = b.next;
  39668. a.removedFromSpace();
  39669. a.space = null
  39670. },
  39671. addCompound: function (a) {
  39672. a.space =
  39673. this;
  39674. a.addedToSpace();
  39675. for (var b = a.bodies.head; null != b;) {
  39676. var d = b.elt;
  39677. this.addBody(d);
  39678. b = b.next
  39679. }
  39680. for (b = a.constraints.head; null != b;) d = b.elt, this.addConstraint(d), b = b.next;
  39681. for (b = a.compounds.head; null != b;) d = b.elt, this.addCompound(d), b = b.next
  39682. },
  39683. remConstraint: function (a) {
  39684. a.active && (this.wake_constraint(a, !0), this.live_constraints.remove(a));
  39685. a.removedFromSpace();
  39686. a.space = null
  39687. },
  39688. addConstraint: function (a) {
  39689. a.space = this;
  39690. a.addedToSpace();
  39691. a.active && (a.component.sleeping = !0, this.wake_constraint(a, !0))
  39692. },
  39693. removed_shape: function (a,
  39694. b) {
  39695. null == b && (b = !1);
  39696. var d = this,
  39697. g = a.body;
  39698. b || g.wake();
  39699. for (var e = null, f = g.arbiters.head; null != f;) {
  39700. var h = [f.elt];
  39701. if (h[0].ws1 == a || h[0].ws2 == a) {
  39702. if (0 != h[0].present)
  39703. for (this.MRCA_chains(h[0].ws1, h[0].ws2), f = this.mrca1.head; null != f;) {
  39704. for (var k = f.elt, n = this.mrca2.head; null != n;) {
  39705. var p = n.elt,
  39706. q = k.cbSet,
  39707. r = p.cbSet;
  39708. q.validate();
  39709. r.validate();
  39710. null != q.manager.pair(q, r).listeners.head && (p = [c.phys.ZPP_Interactor.get(k, p)], p[0].remove_arb(h[0]), h[0].present--, q.manager.pair(q, r).forall(c.util.ZPP_Flags.id_CbEvent_END, function (a,
  39711. b) {
  39712. return function (e) {
  39713. if (0 != (e.itype & b[0].type) && a[0].empty_arb(e.itype)) {
  39714. var f = d.push_callback(e);
  39715. f.event = c.util.ZPP_Flags.id_CbEvent_END;
  39716. c.phys.ZPP_Interactor.int_callback(a[0], e, f);
  39717. f.set = a[0]
  39718. }
  39719. }
  39720. }(p, h)), null == p[0].arbiters.head && this.remove_callbackset(p[0]));
  39721. n = n.next
  39722. }
  39723. f = f.next
  39724. }
  39725. h[0].b1 != g && h[0].b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (f = h[0].b1, f.world || (f.component.waket = this.stamp + (this.midstep ? 0 : 1), f.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (f.kinematicDelaySleep = !0), f.component.sleeping &&
  39726. this.really_wake(f, !1)));
  39727. h[0].b2 != g && h[0].b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (f = h[0].b2, f.world || (f.component.waket = this.stamp + (this.midstep ? 0 : 1), f.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (f.kinematicDelaySleep = !0), f.component.sleeping && this.really_wake(f, !1)));
  39728. h[0].cleared = !0;
  39729. null != g && h[0].b2 != g || h[0].b1.arbiters.inlined_try_remove(h[0]);
  39730. null != g && h[0].b1 != g || h[0].b2.arbiters.inlined_try_remove(h[0]);
  39731. null != h[0].pair && (h[0].pair.arb = null, h[0].pair = null);
  39732. h[0].active = !1;
  39733. this.f_arbiters.modified = !0;
  39734. f = g.arbiters.erase(e)
  39735. } else e = f, f = f.next
  39736. }
  39737. this.bphase.remove(a);
  39738. a.removedFromSpace()
  39739. },
  39740. added_shape: function (a, b) {
  39741. null == b && (b = !1);
  39742. if (!b) {
  39743. var d = a.body;
  39744. d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !1))
  39745. }
  39746. this.bphase.insert(a);
  39747. a.addedToSpace()
  39748. },
  39749. transmitType: function (a, b) {
  39750. var d = a;
  39751. d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC &&
  39752. (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !1));
  39753. a.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC ? this.live.remove(a) : a.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC ? (this.kinematics.remove(a), this.staticsleep.remove(a)) : a.type == c.util.ZPP_Flags.id_BodyType_STATIC && this.staticsleep.remove(a);
  39754. a.type = b;
  39755. a.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && this.kinematics.add(a);
  39756. a.type == c.util.ZPP_Flags.id_BodyType_STATIC && this.static_validation(a);
  39757. a.component.sleeping = !0;
  39758. d = a;
  39759. d.world || (d.component.waket =
  39760. this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !0))
  39761. },
  39762. remove_callbackset: function (a) {
  39763. a.lazydel = !0;
  39764. a.int1.cbsets.inlined_try_remove(a);
  39765. a.int2.cbsets.inlined_try_remove(a)
  39766. },
  39767. add_callbackset: function (a) {
  39768. a.int1.cbsets.inlined_add(a);
  39769. a.int2.cbsets.inlined_add(a);
  39770. this.callbackset_list.inlined_add(a)
  39771. },
  39772. remListener: function (a) {
  39773. null != a.interaction && null;
  39774. a.removedFromSpace();
  39775. a.space = null
  39776. },
  39777. addListener: function (a) {
  39778. a.space =
  39779. this;
  39780. a.addedToSpace();
  39781. null != a.interaction && null
  39782. },
  39783. unrevoke_listener: function (a) {},
  39784. revoke_listener: function (a) {},
  39785. listeners_modifiable: function () {
  39786. if (this.midstep) throw "Error: Space::listeners cannot be set during space step()";
  39787. },
  39788. listeners_subber: function (a) {
  39789. this.remListener(a.zpp_inner)
  39790. },
  39791. listeners_adder: function (a) {
  39792. return a.zpp_inner.space != this ? (null != a.zpp_inner.space && a.zpp_inner.space.outer.zpp_inner.wrap_listeners.remove(a), this.addListener(a.zpp_inner), !0) : !1
  39793. },
  39794. constraints_modifiable: function () {
  39795. if (this.midstep) throw "Error: Space::constraints cannot be set during space step()";
  39796. },
  39797. constraints_subber: function (a) {
  39798. this.remConstraint(a.zpp_inner)
  39799. },
  39800. constraints_adder: function (a) {
  39801. if (null != a.zpp_inner.compound) throw "Error: Cannot set the space of a Constraint belonging to a Compound, only the root Compound space can be set";
  39802. return a.zpp_inner.space != this ? (null != a.zpp_inner.space && a.zpp_inner.space.outer.zpp_inner.wrap_constraints.remove(a), this.addConstraint(a.zpp_inner), !0) : !1
  39803. },
  39804. compounds_modifiable: function () {
  39805. if (this.midstep) throw "Error: Space::compounds cannot be set during space step()";
  39806. },
  39807. compounds_subber: function (a) {
  39808. this.remCompound(a.zpp_inner)
  39809. },
  39810. compounds_adder: function (a) {
  39811. if (null != a.zpp_inner.compound) throw "Error: Cannot set the space of an inner Compound, only the root Compound space can be set";
  39812. return a.zpp_inner.space != this ? (null != a.zpp_inner.space && a.zpp_inner.space.wrap_compounds.remove(a), this.addCompound(a.zpp_inner), !0) : !1
  39813. },
  39814. bodies_modifiable: function () {
  39815. if (this.midstep) throw "Error: Space::bodies cannot be set during space step()";
  39816. },
  39817. bodies_subber: function (a) {
  39818. this.remBody(a.zpp_inner)
  39819. },
  39820. bodies_adder: function (a) {
  39821. if (null != a.zpp_inner.compound) throw "Error: Cannot set the space of a Body belonging to a Compound, only the root Compound space can be set";
  39822. return a.zpp_inner.space != this ? (null != a.zpp_inner.space && a.zpp_inner.space.outer.zpp_inner.wrap_bodies.remove(a), this.addBody(a.zpp_inner), !0) : !1
  39823. },
  39824. clear: function () {
  39825. for (; null != this.listeners.head;) {
  39826. var a = this.listeners.pop_unsafe();
  39827. this.remListener(a)
  39828. }
  39829. for (; null != this.callbackset_list.next;) {
  39830. a = this.callbackset_list.pop_unsafe();
  39831. a.arbiters.clear();
  39832. var b = a;
  39833. b.int1 = b.int2 = null;
  39834. b.id = b.di = -1;
  39835. b.freed = !0;
  39836. null;
  39837. b.next = c.space.ZPP_CallbackSet.zpp_pool;
  39838. c.space.ZPP_CallbackSet.zpp_pool = b
  39839. }
  39840. for (; null != this.c_arbiters_true.head;) a = this.c_arbiters_true.pop_unsafe(), a.retire();
  39841. for (; null != this.c_arbiters_false.head;) a = this.c_arbiters_false.pop_unsafe(), a.retire();
  39842. for (; null != this.s_arbiters.head;) a = this.s_arbiters.pop_unsafe(), a.retire();
  39843. for (; null != this.f_arbiters.head;) a = this.f_arbiters.pop_unsafe(), a.retire();
  39844. for (this.bphase.clear(); null != this.bodies.head;) {
  39845. var d =
  39846. this.bodies.pop_unsafe();
  39847. if (null != d.component && (b = d.component.island, null != b)) {
  39848. for (; null != b.comps.head;) a = b.comps.pop_unsafe(), a.sleeping = !1, a.island = null, a.parent = a, a.rank = 0;
  39849. b.next = c.space.ZPP_Island.zpp_pool;
  39850. c.space.ZPP_Island.zpp_pool = b
  39851. }
  39852. d.removedFromSpace();
  39853. d.space = null
  39854. }
  39855. for (; null != this.constraints.head;) {
  39856. a = this.constraints.pop_unsafe();
  39857. if (null != a.component && (b = a.component.island, null != b)) {
  39858. for (; null != b.comps.head;) d = b.comps.pop_unsafe(), d.sleeping = !1, d.island = null, d.parent = d, d.rank = 0;
  39859. b.next = c.space.ZPP_Island.zpp_pool;
  39860. c.space.ZPP_Island.zpp_pool = b
  39861. }
  39862. a.removedFromSpace();
  39863. a.space = null
  39864. }
  39865. this.kinematics.clear();
  39866. for (var g = new c.util.ZNPList_ZPP_Compound; null != this.compounds.head;) a = this.compounds.pop_unsafe(), g.add(a);
  39867. for (; null != g.head;) {
  39868. var e = g.pop_unsafe();
  39869. e.removedFromSpace();
  39870. e.space = null;
  39871. for (var f = e.bodies.head; null != f;) {
  39872. d = f.elt;
  39873. if (null != d.component && (b = d.component.island, null != b)) {
  39874. for (; null != b.comps.head;) a = b.comps.pop_unsafe(), a.sleeping = !1, a.island = null, a.parent = a, a.rank = 0;
  39875. b.next = c.space.ZPP_Island.zpp_pool;
  39876. c.space.ZPP_Island.zpp_pool =
  39877. b
  39878. }
  39879. d.removedFromSpace();
  39880. d.space = null;
  39881. f = f.next
  39882. }
  39883. for (f = e.constraints.head; null != f;) {
  39884. a = f.elt;
  39885. if (null != a.component && (b = a.component.island, null != b)) {
  39886. for (; null != b.comps.head;) d = b.comps.pop_unsafe(), d.sleeping = !1, d.island = null, d.parent = d, d.rank = 0;
  39887. b.next = c.space.ZPP_Island.zpp_pool;
  39888. c.space.ZPP_Island.zpp_pool = b
  39889. }
  39890. a.removedFromSpace();
  39891. a.space = null;
  39892. f = f.next
  39893. }
  39894. for (f = e.compounds.head; null != f;) b = f.elt, g.add(b), f = f.next
  39895. }
  39896. this.staticsleep.clear();
  39897. this.live.clear();
  39898. this.live_constraints.clear();
  39899. this.time = this.stamp = 0;
  39900. this.mrca1.clear();
  39901. this.mrca2.clear();
  39902. this.prelisteners.clear();
  39903. this.cbsets.clear()
  39904. },
  39905. gravity_validate: function () {
  39906. this.wrap_gravity.zpp_inner.x = this.gravityx;
  39907. this.wrap_gravity.zpp_inner.y = this.gravityy
  39908. },
  39909. gravity_invalidate: function (a) {
  39910. if (this.midstep) throw "Error: Space::gravity cannot be set during space step";
  39911. this.gravityx = a.x;
  39912. this.gravityy = a.y;
  39913. a = new c.util.ZNPList_ZPP_Compound;
  39914. for (var b = this.bodies.head; null != b;) {
  39915. var d = b.elt;
  39916. d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC &&
  39917. (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !1));
  39918. b = b.next
  39919. }
  39920. for (b = this.compounds.head; null != b;) {
  39921. var g = b.elt;
  39922. a.add(g);
  39923. b = b.next
  39924. }
  39925. for (; null != a.head;) {
  39926. g = a.pop_unsafe();
  39927. for (b = g.bodies.head; null != b;) d = b.elt, d.world || (d.component.waket = this.stamp + (this.midstep ? 0 : 1), d.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !1)), b = b.next;
  39928. for (b = g.compounds.head; null != b;) g = b.elt, a.add(g), b = b.next
  39929. }
  39930. },
  39931. getgravity: function () {
  39932. this.wrap_gravity =
  39933. h.geom.Vec2.get(this.gravityx, this.gravityy, null);
  39934. this.wrap_gravity.zpp_inner._inuse = !0;
  39935. this.wrap_gravity.zpp_inner._invalidate = A(this, this.gravity_invalidate);
  39936. this.wrap_gravity.zpp_inner._validate = A(this, this.gravity_validate)
  39937. },
  39938. __class__: c.space.ZPP_Space
  39939. };
  39940. c.space.ZPP_SweepData = function () {
  39941. this.next = this.prev = this.shape = this.aabb = null
  39942. };
  39943. s["zpp_nape.space.ZPP_SweepData"] = c.space.ZPP_SweepData;
  39944. c.space.ZPP_SweepData.__name__ = ["zpp_nape", "space", "ZPP_SweepData"];
  39945. c.space.ZPP_SweepData.prototype = {
  39946. gt: function (a) {
  39947. return this.aabb.minx >
  39948. a.aabb.minx
  39949. },
  39950. alloc: function () {},
  39951. free: function () {
  39952. this.aabb = this.shape = this.prev = null
  39953. },
  39954. __class__: c.space.ZPP_SweepData
  39955. };
  39956. c.space.ZPP_SweepPhase = function (a) {
  39957. this.list = this.failed = null;
  39958. this.space = a;
  39959. this.is_sweep = !0;
  39960. this.sweep = this
  39961. };
  39962. s["zpp_nape.space.ZPP_SweepPhase"] = c.space.ZPP_SweepPhase;
  39963. c.space.ZPP_SweepPhase.__name__ = ["zpp_nape", "space", "ZPP_SweepPhase"];
  39964. c.space.ZPP_SweepPhase.__super__ = c.space.ZPP_Broadphase;
  39965. c.space.ZPP_SweepPhase.prototype = I(c.space.ZPP_Broadphase.prototype, {
  39966. rayMultiCast: function (a,
  39967. b, d, g) {
  39968. this.sync_broadphase();
  39969. a.validate_dir();
  39970. var e = a.rayAABB();
  39971. g = null == g ? new h.geom.RayResultList : g;
  39972. if (0 == a.dirx)
  39973. for (var f = this.list; null != f && f.aabb.minx <= e.minx;) {
  39974. if (f.aabb.intersect(e) && (null == d || f.shape.filter.shouldCollide(d))) {
  39975. var l = a.aabbsect(f.aabb);
  39976. 0 <= l && (f.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect2(f.shape.circle, b, g) : a.polysect2(f.shape.polygon, b, g))
  39977. }
  39978. f = f.next
  39979. } else if (0 > a.dirx) {
  39980. f = this.list;
  39981. for (l = null; null != f && f.aabb.minx <= e.maxx;) l = f, f = f.next;
  39982. for (f = l; null != f;) f.aabb.intersect(e) &&
  39983. (null == d || f.shape.filter.shouldCollide(d)) && (l = a.aabbsect(f.aabb), 0 <= l && (f.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect2(f.shape.circle, b, g) : a.polysect2(f.shape.polygon, b, g))), f = f.prev
  39984. } else
  39985. for (f = this.list; null != f && f.aabb.minx <= e.maxx;) f.aabb.intersect(e) && (null == d || f.shape.filter.shouldCollide(d)) && (l = a.aabbsect(f.aabb), 0 <= l && (f.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect2(f.shape.circle, b, g) : a.polysect2(f.shape.polygon, b, g))), f = f.next;
  39986. null != e.outer && (e.outer.zpp_inner =
  39987. null, e.outer = null);
  39988. e.wrap_min = e.wrap_max = null;
  39989. e._invalidate = null;
  39990. e._validate = null;
  39991. e.next = c.geom.ZPP_AABB.zpp_pool;
  39992. c.geom.ZPP_AABB.zpp_pool = e;
  39993. return g
  39994. },
  39995. rayCast: function (a, b, d) {
  39996. this.sync_broadphase();
  39997. a.validate_dir();
  39998. var g = a.rayAABB(),
  39999. e = a.maxdist,
  40000. f = null;
  40001. if (0 == a.dirx)
  40002. for (var h = this.list; null != h && h.aabb.minx <= g.minx;) {
  40003. if (h.aabb.intersect(g) && (null == d || h.shape.filter.shouldCollide(d))) {
  40004. var k = a.aabbsect(h.aabb);
  40005. if (0 <= k && k < e && (k = h.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect(h.shape.circle,
  40006. b, e) : a.polysect(h.shape.polygon, b, e), null != k)) {
  40007. if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  40008. e = k.zpp_inner.toiDistance;
  40009. if (null != f) {
  40010. if (null != f.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  40011. f.zpp_inner.free()
  40012. }
  40013. f = k
  40014. }
  40015. }
  40016. h = h.next
  40017. } else if (0 > a.dirx) {
  40018. h = this.list;
  40019. for (k = null; null != h && h.aabb.minx <= g.maxx;) k = h, h = h.next;
  40020. for (h = k; null != h;) {
  40021. if (h.aabb.intersect(g) && (null == d || h.shape.filter.shouldCollide(d)) && (k = a.aabbsect(h.aabb), 0 <= k && k <
  40022. e && (k = h.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect(h.shape.circle, b, e) : a.polysect(h.shape.polygon, b, e), null != k))) {
  40023. if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  40024. e = k.zpp_inner.toiDistance;
  40025. if (null != f) {
  40026. if (null != f.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  40027. f.zpp_inner.free()
  40028. }
  40029. f = k
  40030. }
  40031. h = h.prev
  40032. }
  40033. } else
  40034. for (h = this.list; null != h && h.aabb.minx <= g.maxx && h.aabb.minx < a.originx + a.dirx * e;) {
  40035. if (h.aabb.intersect(g) && (null ==
  40036. d || h.shape.filter.shouldCollide(d)) && (k = a.aabbsect(h.aabb), 0 <= k && k < e && (k = h.shape.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circlesect(h.shape.circle, b, e) : a.polysect(h.shape.polygon, b, e), null != k))) {
  40037. if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  40038. e = k.zpp_inner.toiDistance;
  40039. if (null != f) {
  40040. if (null != f.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
  40041. f.zpp_inner.free()
  40042. }
  40043. f = k
  40044. }
  40045. h = h.next
  40046. }
  40047. null != g.outer && (g.outer.zpp_inner = null, g.outer =
  40048. null);
  40049. g.wrap_min = g.wrap_max = null;
  40050. g._invalidate = null;
  40051. g._validate = null;
  40052. g.next = c.geom.ZPP_AABB.zpp_pool;
  40053. c.geom.ZPP_AABB.zpp_pool = g;
  40054. return f
  40055. },
  40056. bodiesInShape: function (a, b, d, g) {
  40057. this.sync_broadphase();
  40058. this.validateShape(a);
  40059. var e = a.aabb;
  40060. g = null == g ? new h.phys.BodyList : g;
  40061. null == this.failed && (this.failed = new h.phys.BodyList);
  40062. for (var f = this.list; null != f && f.aabb.maxx < e.minx;) f = f.next;
  40063. for (; null != f && f.aabb.minx <= e.maxx;) {
  40064. if (f.aabb.intersect(e)) {
  40065. var l = f.shape,
  40066. k = l.body.outer;
  40067. if (null == d || l.filter.shouldCollide(d)) b ? this.failed.has(k) ||
  40068. (l = c.geom.ZPP_Collide.containTest(a, l), !g.has(k) && l ? g.push(k) : l || (g.remove(k), this.failed.push(k))) : !g.has(k) && c.geom.ZPP_Collide.testCollide_safe(a, l) && g.push(k)
  40069. }
  40070. f = f.next
  40071. }
  40072. this.failed.clear();
  40073. return g
  40074. },
  40075. shapesInShape: function (a, b, d, g) {
  40076. this.sync_broadphase();
  40077. this.validateShape(a);
  40078. var e = a.aabb;
  40079. g = null == g ? new h.shape.ShapeList : g;
  40080. for (var f = this.list; null != f && f.aabb.maxx < e.minx;) f = f.next;
  40081. for (; null != f && f.aabb.minx <= e.maxx;) {
  40082. if (f.aabb.intersect(e)) {
  40083. var l = f.shape;
  40084. if (null == d || l.filter.shouldCollide(d)) b ? c.geom.ZPP_Collide.containTest(a,
  40085. l) && g.push(l.outer) : c.geom.ZPP_Collide.testCollide_safe(l, a) && g.push(l.outer)
  40086. }
  40087. f = f.next
  40088. }
  40089. return g
  40090. },
  40091. bodiesInCircle: function (a, b, d, g, e, f) {
  40092. this.sync_broadphase();
  40093. this.updateCircShape(a, b, d);
  40094. a = this.circShape.zpp_inner.aabb;
  40095. f = null == f ? new h.phys.BodyList : f;
  40096. null == this.failed && (this.failed = new h.phys.BodyList);
  40097. for (b = this.list; null != b && b.aabb.maxx < a.minx;) b = b.next;
  40098. for (; null != b && b.aabb.minx <= a.maxx;) {
  40099. if (b.aabb.intersect(a)) {
  40100. var l = b.shape;
  40101. d = l.body.outer;
  40102. if (null == e || l.filter.shouldCollide(e)) g ? this.failed.has(d) ||
  40103. (l = c.geom.ZPP_Collide.containTest(this.circShape.zpp_inner, l), !f.has(d) && l ? f.push(d) : l || (f.remove(d), this.failed.push(d))) : !f.has(d) && c.geom.ZPP_Collide.testCollide_safe(l, this.circShape.zpp_inner) && f.push(d)
  40104. }
  40105. b = b.next
  40106. }
  40107. this.failed.clear();
  40108. return f
  40109. },
  40110. shapesInCircle: function (a, b, d, g, e, f) {
  40111. this.sync_broadphase();
  40112. this.updateCircShape(a, b, d);
  40113. a = this.circShape.zpp_inner.aabb;
  40114. f = null == f ? new h.shape.ShapeList : f;
  40115. for (b = this.list; null != b && b.aabb.maxx < a.minx;) b = b.next;
  40116. for (; null != b && b.aabb.minx <= a.maxx;) b.aabb.intersect(a) &&
  40117. (d = b.shape, null == e || d.filter.shouldCollide(e)) && (g ? c.geom.ZPP_Collide.containTest(this.circShape.zpp_inner, d) && f.push(d.outer) : c.geom.ZPP_Collide.testCollide_safe(d, this.circShape.zpp_inner) && f.push(d.outer)), b = b.next;
  40118. return f
  40119. },
  40120. bodiesInAABB: function (a, b, d, g, e) {
  40121. this.sync_broadphase();
  40122. this.updateAABBShape(a);
  40123. a = this.aabbShape.zpp_inner.aabb;
  40124. e = null == e ? new h.phys.BodyList : e;
  40125. null == this.failed && (this.failed = new h.phys.BodyList);
  40126. for (var f = this.list; null != f && f.aabb.maxx < a.minx;) f = f.next;
  40127. for (; null != f && f.aabb.minx <=
  40128. a.maxx;) {
  40129. var l = f.shape,
  40130. k = l.body.outer;
  40131. f.aabb.intersect(a) && (null == g || l.filter.shouldCollide(g)) && (b ? d ? this.failed.has(k) || (l = c.geom.ZPP_Collide.containTest(this.aabbShape.zpp_inner, l), !e.has(k) && l ? e.push(k) : l || (e.remove(k), this.failed.push(k))) : !e.has(k) && c.geom.ZPP_Collide.testCollide_safe(l, this.aabbShape.zpp_inner) && e.push(k) : d ? this.failed.has(k) || (l = a.contains(l.aabb), !e.has(k) && l ? e.push(k) : l || (e.remove(k), this.failed.push(k))) : !e.has(k) && a.contains(l.aabb) && e.push(k));
  40132. f = f.next
  40133. }
  40134. this.failed.clear();
  40135. return e
  40136. },
  40137. shapesInAABB: function (a, b, d, g, e) {
  40138. this.sync_broadphase();
  40139. this.updateAABBShape(a);
  40140. a = this.aabbShape.zpp_inner.aabb;
  40141. e = null == e ? new h.shape.ShapeList : e;
  40142. for (var f = this.list; null != f && f.aabb.maxx < a.minx;) f = f.next;
  40143. for (; null != f && f.aabb.minx <= a.maxx;) {
  40144. var l = f.shape;
  40145. if (null == g || l.filter.shouldCollide(g)) b ? d ? c.geom.ZPP_Collide.containTest(this.aabbShape.zpp_inner, l) && e.push(l.outer) : a.contains(f.aabb) ? e.push(l.outer) : f.aabb.intersect(a) && c.geom.ZPP_Collide.testCollide_safe(l, this.aabbShape.zpp_inner) &&
  40146. e.push(l.outer) : (d ? a.contains(f.aabb) : f.aabb.intersect(a)) && e.push(l.outer);
  40147. f = f.next
  40148. }
  40149. return e
  40150. },
  40151. bodiesUnderPoint: function (a, b, d, g) {
  40152. this.sync_broadphase();
  40153. var e = c.geom.ZPP_Vec2.get(a, b, null);
  40154. g = null == g ? new h.phys.BodyList : g;
  40155. for (var f = this.list; null != f && f.aabb.minx > a;) f = f.next;
  40156. for (; null != f && f.aabb.minx <= a;) {
  40157. if (f.aabb.maxx >= a && f.aabb.miny <= b && f.aabb.maxy >= b) {
  40158. var l = f.shape,
  40159. k = l.body.outer;
  40160. g.has(k) || null != d && !l.filter.shouldCollide(d) || (l.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? c.geom.ZPP_Collide.circleContains(l.circle,
  40161. e) && g.push(k) : c.geom.ZPP_Collide.polyContains(l.polygon, e) && g.push(k))
  40162. }
  40163. f = f.next
  40164. }
  40165. null != e.outer && (e.outer.zpp_inner = null, e.outer = null);
  40166. e._isimmutable = null;
  40167. e._validate = null;
  40168. e._invalidate = null;
  40169. e.next = c.geom.ZPP_Vec2.zpp_pool;
  40170. c.geom.ZPP_Vec2.zpp_pool = e;
  40171. return g
  40172. },
  40173. shapesUnderPoint: function (a, b, d, g) {
  40174. this.sync_broadphase();
  40175. var e = c.geom.ZPP_Vec2.get(a, b, null);
  40176. g = null == g ? new h.shape.ShapeList : g;
  40177. for (var f = this.list; null != f && f.aabb.minx > a;) f = f.next;
  40178. for (; null != f && f.aabb.minx <= a;) {
  40179. if (f.aabb.maxx >= a && f.aabb.miny <=
  40180. b && f.aabb.maxy >= b) {
  40181. var l = f.shape;
  40182. if (null == d || l.filter.shouldCollide(d)) l.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? c.geom.ZPP_Collide.circleContains(l.circle, e) && g.push(l.outer) : c.geom.ZPP_Collide.polyContains(l.polygon, e) && g.push(l.outer)
  40183. }
  40184. f = f.next
  40185. }
  40186. null != e.outer && (e.outer.zpp_inner = null, e.outer = null);
  40187. e._isimmutable = null;
  40188. e._validate = null;
  40189. e._invalidate = null;
  40190. e.next = c.geom.ZPP_Vec2.zpp_pool;
  40191. c.geom.ZPP_Vec2.zpp_pool = e;
  40192. return g
  40193. },
  40194. clear: function () {
  40195. for (; null != this.list;) this.list.shape.removedFromSpace(),
  40196. this.__remove(this.list.shape)
  40197. },
  40198. broadphase: function (a, b) {
  40199. if (null != this.list) {
  40200. this.sync_broadphase_fast();
  40201. for (var d = this.list; null != d;) {
  40202. for (var g = d.next, e = d.shape, f = e.body, h = d.aabb.maxx; null != g && !(g.aabb.minx > h);) {
  40203. var k = g.shape,
  40204. n = k.body;
  40205. n == f || f.type == c.util.ZPP_Flags.id_BodyType_STATIC && n.type == c.util.ZPP_Flags.id_BodyType_STATIC || f.component.sleeping && n.component.sleeping || e.aabb.intersectY(k.aabb) && (b ? a.narrowPhase(e, k, f.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || n.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC,
  40206. null, !1) : a.continuousEvent(e, k, f.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || n.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC, null, !1));
  40207. g = g.next
  40208. }
  40209. d = d.next
  40210. }
  40211. }
  40212. },
  40213. sync_broadphase_fast: function () {
  40214. for (var a = this.list.next; null != a;) {
  40215. var b = a.next,
  40216. d = a.prev;
  40217. if (!(a.aabb.minx > d.aabb.minx)) {
  40218. for (; null != d.prev && d.prev.aabb.minx > a.aabb.minx;) d = d.prev;
  40219. var c = a.prev;
  40220. c.next = a.next;
  40221. null != a.next && (a.next.prev = c);
  40222. null == d.prev ? (a.prev = null, this.list = a, a.next = d, d.prev = a) : (a.prev = d.prev, d.prev = a, a.prev.next = a, a.next = d)
  40223. }
  40224. a = b
  40225. }
  40226. },
  40227. sync_broadphase: function () {
  40228. this.space.validation();
  40229. null != this.list && this.sync_broadphase_fast()
  40230. },
  40231. __sync: function (a) {
  40232. !this.space.continuous && a.zip_aabb && null != a.body && (a.zip_aabb = !1, a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.__validate_aabb() : a.polygon.__validate_aabb())
  40233. },
  40234. __remove: function (a) {
  40235. var b = a.sweep;
  40236. null == b.prev ? this.list = b.next : b.prev.next = b.next;
  40237. null != b.next && (b.next.prev = b.prev);
  40238. a.sweep = null;
  40239. b.prev = null;
  40240. b.shape = null;
  40241. b.aabb = null;
  40242. b.next = c.space.ZPP_SweepData.zpp_pool;
  40243. c.space.ZPP_SweepData.zpp_pool = b
  40244. },
  40245. __insert: function (a) {
  40246. var b;
  40247. null ==
  40248. c.space.ZPP_SweepData.zpp_pool ? b = new c.space.ZPP_SweepData : (b = c.space.ZPP_SweepData.zpp_pool, c.space.ZPP_SweepData.zpp_pool = b.next, b.next = null);
  40249. null;
  40250. a.sweep = b;
  40251. b.shape = a;
  40252. b.aabb = a.aabb;
  40253. b.next = this.list;
  40254. null != this.list && (this.list.prev = b);
  40255. this.list = b
  40256. },
  40257. __class__: c.space.ZPP_SweepPhase
  40258. });
  40259. c.util.ZNPArray2_Float = function (a, b) {
  40260. this.width = 0;
  40261. this.list = null;
  40262. this.width = a;
  40263. this.list = []
  40264. };
  40265. s["zpp_nape.util.ZNPArray2_Float"] = c.util.ZNPArray2_Float;
  40266. c.util.ZNPArray2_Float.__name__ = ["zpp_nape", "util", "ZNPArray2_Float"];
  40267. c.util.ZNPArray2_Float.prototype = {
  40268. set: function (a, b, d) {
  40269. return this.list[b * this.width + a] = d
  40270. },
  40271. get: function (a, b) {
  40272. return this.list[b * this.width + a]
  40273. },
  40274. resize: function (a, b, d) {
  40275. this.width = a;
  40276. var c = 0;
  40277. for (a *= b; c < a;) b = c++, this.list[b] = d
  40278. },
  40279. __class__: c.util.ZNPArray2_Float
  40280. };
  40281. c.util.ZNPArray2_ZPP_GeomVert = function (a, b) {
  40282. this.width = 0;
  40283. this.list = null;
  40284. this.width = a;
  40285. this.list = []
  40286. };
  40287. s["zpp_nape.util.ZNPArray2_ZPP_GeomVert"] = c.util.ZNPArray2_ZPP_GeomVert;
  40288. c.util.ZNPArray2_ZPP_GeomVert.__name__ = ["zpp_nape", "util", "ZNPArray2_ZPP_GeomVert"];
  40289. c.util.ZNPArray2_ZPP_GeomVert.prototype = {
  40290. set: function (a, b, d) {
  40291. return this.list[b * this.width + a] = d
  40292. },
  40293. get: function (a, b) {
  40294. return this.list[b * this.width + a]
  40295. },
  40296. resize: function (a, b, d) {
  40297. this.width = a;
  40298. var c = 0;
  40299. for (a *= b; c < a;) b = c++, this.list[b] = d
  40300. },
  40301. __class__: c.util.ZNPArray2_ZPP_GeomVert
  40302. };
  40303. c.util.ZNPArray2_ZPP_MarchPair = function (a, b) {
  40304. this.width = 0;
  40305. this.list = null;
  40306. this.width = a;
  40307. this.list = []
  40308. };
  40309. s["zpp_nape.util.ZNPArray2_ZPP_MarchPair"] = c.util.ZNPArray2_ZPP_MarchPair;
  40310. c.util.ZNPArray2_ZPP_MarchPair.__name__ = ["zpp_nape", "util",
  40311. "ZNPArray2_ZPP_MarchPair"
  40312. ];
  40313. c.util.ZNPArray2_ZPP_MarchPair.prototype = {
  40314. set: function (a, b, d) {
  40315. return this.list[b * this.width + a] = d
  40316. },
  40317. get: function (a, b) {
  40318. return this.list[b * this.width + a]
  40319. },
  40320. resize: function (a, b, d) {
  40321. this.width = a;
  40322. var c = 0;
  40323. for (a *= b; c < a;) b = c++, this.list[b] = d
  40324. },
  40325. __class__: c.util.ZNPArray2_ZPP_MarchPair
  40326. };
  40327. c.util.ZPP_Debug = function (a, b) {
  40328. this.viewport = this.iport = this.tmpab = null;
  40329. this.xdet = this.width = this.height = 0;
  40330. this.xnull = !1;
  40331. this.xform = null;
  40332. this.bg_r = this.bg_g = this.bg_b = this.bg_col = 0;
  40333. this.d_shape = null;
  40334. this.isbmp = !1;
  40335. this.outer = null;
  40336. this.xnull = !0;
  40337. this.xdet = 1;
  40338. this.width = a;
  40339. this.height = b;
  40340. this.viewport = c.geom.ZPP_AABB.get(0, 0, a, b);
  40341. this.iport = c.geom.ZPP_AABB.get(0, 0, a, b);
  40342. this.tmpab = new c.geom.ZPP_AABB
  40343. };
  40344. s["zpp_nape.util.ZPP_Debug"] = c.util.ZPP_Debug;
  40345. c.util.ZPP_Debug.__name__ = ["zpp_nape", "util", "ZPP_Debug"];
  40346. c.util.ZPP_Debug.prototype = {
  40347. sup_setbg: function (a) {
  40348. this.bg_r = a >> 16 & 255;
  40349. this.bg_g = a >> 8 & 255;
  40350. this.bg_b = a & 255;
  40351. this.bg_col = a
  40352. },
  40353. cull: function (a) {
  40354. if (this.xnull) return a.intersect(this.viewport);
  40355. var b = 0,
  40356. d = 0,
  40357. c = 0,
  40358. e = 0,
  40359. c = a.minx,
  40360. e = a.miny;
  40361. this.tmpab.minx = this.xform.a * c + this.xform.b * e + this.xform.tx;
  40362. this.tmpab.miny = this.xform.c * c + this.xform.d * e + this.xform.ty;
  40363. this.tmpab.maxx = this.tmpab.minx;
  40364. this.tmpab.maxy = this.tmpab.miny;
  40365. c = a.maxx;
  40366. b = this.xform.a * c + this.xform.b * e + this.xform.tx;
  40367. d = this.xform.c * c + this.xform.d * e + this.xform.ty;
  40368. this.tmpab.setExpandPoint(b, d);
  40369. e = a.maxy;
  40370. b = this.xform.a * c + this.xform.b * e + this.xform.tx;
  40371. d = this.xform.c * c + this.xform.d * e + this.xform.ty;
  40372. this.tmpab.setExpandPoint(b, d);
  40373. c = a.minx;
  40374. b = this.xform.a * c + this.xform.b * e + this.xform.tx;
  40375. d = this.xform.c * c + this.xform.d * e + this.xform.ty;
  40376. this.tmpab.setExpandPoint(b, d);
  40377. return this.tmpab.intersect(this.viewport)
  40378. },
  40379. setform: function () {
  40380. this.xform = (new h.geom.Mat23).zpp_inner;
  40381. this.xform._invalidate = A(this, this.xform_invalidate)
  40382. },
  40383. xform_invalidate: function () {
  40384. this.xdet = Math.sqrt(function (a) {
  40385. a = a.xform.outer.get_determinant();
  40386. return 0 > a ? -a : a
  40387. }(this));
  40388. this.xnull = 1 == this.xform.a && 0 == this.xform.b && 0 == this.xform.c && 1 == this.xform.d && 0 == this.xform.tx && 0 == this.xform.ty;
  40389. var a = this.xform.outer.inverse(),
  40390. b =
  40391. h.geom.Vec2.get(null, null, null),
  40392. d = a.transform(b),
  40393. c = this.iport;
  40394. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40395. d.zpp_inner.validate();
  40396. c.minx = d.zpp_inner.x;
  40397. c = this.iport;
  40398. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40399. d.zpp_inner.validate();
  40400. c.miny = d.zpp_inner.y;
  40401. this.iport.maxx = this.iport.minx;
  40402. this.iport.maxy = this.iport.miny;
  40403. d.dispose();
  40404. b.set_x(this.width);
  40405. d = a.transform(b);
  40406. this.iport.setExpandPoint(function (a) {
  40407. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40408. d.zpp_inner.validate();
  40409. return d.zpp_inner.x
  40410. }(this), function (a) {
  40411. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40412. d.zpp_inner.validate();
  40413. return d.zpp_inner.y
  40414. }(this));
  40415. d.dispose();
  40416. b.set_y(this.height);
  40417. d = a.transform(b);
  40418. this.iport.setExpandPoint(function (a) {
  40419. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40420. d.zpp_inner.validate();
  40421. return d.zpp_inner.x
  40422. }(this), function (a) {
  40423. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40424. d.zpp_inner.validate();
  40425. return d.zpp_inner.y
  40426. }(this));
  40427. d.dispose();
  40428. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40429. b.zpp_inner.immutable();
  40430. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40431. b.zpp_inner.validate();
  40432. 0 != b.zpp_inner.x && (b.zpp_inner.x = 0, b.zpp_inner.invalidate());
  40433. if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40434. b.zpp_inner.validate();
  40435. b.zpp_inner.x;
  40436. d = a.transform(b);
  40437. this.iport.setExpandPoint(function (a) {
  40438. if (null !=
  40439. d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40440. d.zpp_inner.validate();
  40441. return d.zpp_inner.x
  40442. }(this), function (a) {
  40443. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40444. d.zpp_inner.validate();
  40445. return d.zpp_inner.y
  40446. }(this));
  40447. d.dispose();
  40448. b.dispose()
  40449. },
  40450. __class__: c.util.ZPP_Debug
  40451. };
  40452. c.util.ZPP_ShapeDebug = function (a, b) {
  40453. this.outer_zn = this.shape = this.graphics = this.compoundstack = this.shapeList = this.bodyList = null;
  40454. c.util.ZPP_Debug.call(this, a, b);
  40455. this.shape = new k.display.Shape;
  40456. this.shape.set_scrollRect(new k.geom.Rectangle(0, 0, a, b));
  40457. this.graphics = this.shape.graphics;
  40458. this.isbmp = !1;
  40459. this.d_shape = this
  40460. };
  40461. s["zpp_nape.util.ZPP_ShapeDebug"] = c.util.ZPP_ShapeDebug;
  40462. c.util.ZPP_ShapeDebug.__name__ = ["zpp_nape", "util", "ZPP_ShapeDebug"];
  40463. c.util.ZPP_ShapeDebug.__super__ = c.util.ZPP_Debug;
  40464. c.util.ZPP_ShapeDebug.prototype = I(c.util.ZPP_Debug.prototype, {
  40465. draw_arbiter: function (a, b, d, g) {
  40466. var e = 0,
  40467. f = 0;
  40468. if (a.outer.zpp_inner.type == c.dynamics.ZPP_Arbiter.SENSOR) {
  40469. if (this.outer.drawSensorArbiters) {
  40470. a = a.outer;
  40471. this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
  40472. a = ~a.bg_col;
  40473. return -16777216 | (0 + (a >> 16 & 255) * (1 - 0.7) | 0) << 16 | (178.5 + (a >> 8 & 255) * (1 - 0.7) | 0) << 8 | 0 + (a & 255) * (1 - 0.7) | 0
  40474. }(this), 1);
  40475. if (g) {
  40476. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40477. e = (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws2.outer : a.zpp_inner.ws1.outer).get_worldCOM().get_x();
  40478. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40479. f = (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws2.outer : a.zpp_inner.ws1.outer).get_worldCOM().get_y()
  40480. } else {
  40481. d =
  40482. b.a;
  40483. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40484. d *= (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws2.outer : a.zpp_inner.ws1.outer).get_worldCOM().get_x();
  40485. var h = b.b;
  40486. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40487. e = d + h * (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws2.outer : a.zpp_inner.ws1.outer).get_worldCOM().get_y() + b.tx;
  40488. d = b.c;
  40489. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40490. d *= (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws2.outer :
  40491. a.zpp_inner.ws1.outer).get_worldCOM().get_x();
  40492. h = b.d;
  40493. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40494. f = d + h * (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws2.outer : a.zpp_inner.ws1.outer).get_worldCOM().get_y() + b.ty
  40495. }
  40496. this.graphics.moveTo(e, f);
  40497. if (g) {
  40498. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40499. e = (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws1.outer : a.zpp_inner.ws2.outer).get_worldCOM().get_x();
  40500. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40501. f = (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws1.outer : a.zpp_inner.ws2.outer).get_worldCOM().get_y()
  40502. } else {
  40503. g = b.a;
  40504. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40505. g *= (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws1.outer : a.zpp_inner.ws2.outer).get_worldCOM().get_x();
  40506. d = b.b;
  40507. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40508. e = g + d * (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws1.outer : a.zpp_inner.ws2.outer).get_worldCOM().get_y() + b.tx;
  40509. g = b.c;
  40510. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40511. g *= (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws1.outer : a.zpp_inner.ws2.outer).get_worldCOM().get_x();
  40512. d = b.d;
  40513. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40514. f = g + d * (a.zpp_inner.ws1.id > a.zpp_inner.ws2.id ? a.zpp_inner.ws1.outer : a.zpp_inner.ws2.outer).get_worldCOM().get_y() + b.ty
  40515. }
  40516. this.graphics.lineTo(e, f)
  40517. }
  40518. } else if (a.outer.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID) {
  40519. if (this.outer.drawFluidArbiters) {
  40520. a = a.outer.get_fluidArbiter();
  40521. this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
  40522. a = ~a.bg_col;
  40523. return -16777216 | (0 + (a >> 16 & 255) * (1 - 0.7) | 0) << 16 | (0 + (a >> 8 & 255) * (1 - 0.7) | 0) << 8 | 178.5 + (a & 255) * (1 - 0.7) | 0
  40524. }(this), 1);
  40525. if (g) {
  40526. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40527. null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
  40528. e = a.zpp_inner.fluidarb.wrap_position.get_x();
  40529. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40530. null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
  40531. f = a.zpp_inner.fluidarb.wrap_position.get_y()
  40532. } else {
  40533. g =
  40534. b.a;
  40535. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40536. null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
  40537. g *= a.zpp_inner.fluidarb.wrap_position.get_x();
  40538. d = b.b;
  40539. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40540. null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
  40541. e = g + d * a.zpp_inner.fluidarb.wrap_position.get_y() + b.tx;
  40542. g = b.c;
  40543. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40544. null == a.zpp_inner.fluidarb.wrap_position &&
  40545. a.zpp_inner.fluidarb.getposition();
  40546. g *= a.zpp_inner.fluidarb.wrap_position.get_x();
  40547. d = b.d;
  40548. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40549. null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
  40550. f = g + d * a.zpp_inner.fluidarb.wrap_position.get_y() + b.ty
  40551. }
  40552. this.graphics.drawCircle(e, f, 0.75)
  40553. }
  40554. } else if (this.outer.drawCollisionArbiters) {
  40555. a = a.outer.get_collisionArbiter();
  40556. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40557. null == a.zpp_inner.colarb.wrap_contacts &&
  40558. a.zpp_inner.colarb.setupcontacts();
  40559. if (!a.zpp_inner.colarb.wrap_contacts.empty()) {
  40560. var k = 0;
  40561. d = 0;
  40562. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40563. null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
  40564. if (2 == a.zpp_inner.colarb.wrap_contacts.get_length()) {
  40565. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40566. null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
  40567. h = a.zpp_inner.colarb.wrap_contacts.at(0).get_position();
  40568. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40569. null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
  40570. d = a.zpp_inner.colarb.wrap_contacts.at(1).get_position();
  40571. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40572. null == a.zpp_inner.colarb.wrap_normal && a.zpp_inner.colarb.getnormal();
  40573. var k = a.zpp_inner.colarb.wrap_normal,
  40574. n = 0.661437828,
  40575. p = 0.75;
  40576. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40577. k.zpp_inner.validate();
  40578. e = k.zpp_inner.y;
  40579. if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40580. h.zpp_inner.validate();
  40581. e *= h.zpp_inner.x;
  40582. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40583. k.zpp_inner.validate();
  40584. f = k.zpp_inner.x;
  40585. if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40586. h.zpp_inner.validate();
  40587. e -= f * h.zpp_inner.y;
  40588. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40589. k.zpp_inner.validate();
  40590. f = k.zpp_inner.y;
  40591. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40592. d.zpp_inner.validate();
  40593. var f = f * d.zpp_inner.x,
  40594. q;
  40595. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40596. k.zpp_inner.validate();
  40597. q = k.zpp_inner.x;
  40598. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40599. d.zpp_inner.validate();
  40600. e < f - q * d.zpp_inner.y && (n = -n, p = -p);
  40601. this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
  40602. a = ~a.bg_col;
  40603. return -16777216 | (0 + (a >> 16 & 255) * (1 - 0.7) | 0) << 16 | (0 + (a >> 8 & 255) * (1 - 0.7) | 0) << 8 | 178.5 + (a & 255) * (1 - 0.7) | 0
  40604. }(this), 1);
  40605. if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40606. h.zpp_inner.validate();
  40607. e = h.zpp_inner.x;
  40608. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40609. k.zpp_inner.validate();
  40610. e += k.zpp_inner.x * p;
  40611. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40612. k.zpp_inner.validate();
  40613. e -= k.zpp_inner.y * n;
  40614. if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40615. h.zpp_inner.validate();
  40616. f = h.zpp_inner.y;
  40617. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40618. k.zpp_inner.validate();
  40619. f += k.zpp_inner.y * p;
  40620. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40621. k.zpp_inner.validate();
  40622. f += k.zpp_inner.x * n;
  40623. g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
  40624. this.graphics.moveTo(e, f);
  40625. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40626. d.zpp_inner.validate();
  40627. e = d.zpp_inner.x;
  40628. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40629. k.zpp_inner.validate();
  40630. e += k.zpp_inner.x * p;
  40631. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40632. k.zpp_inner.validate();
  40633. e += k.zpp_inner.y * n;
  40634. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40635. d.zpp_inner.validate();
  40636. f = d.zpp_inner.y;
  40637. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40638. k.zpp_inner.validate();
  40639. f += k.zpp_inner.y * p;
  40640. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40641. k.zpp_inner.validate();
  40642. f -= k.zpp_inner.x * n;
  40643. g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
  40644. this.graphics.lineTo(e, f);
  40645. this.graphics.lineStyle(this.outer_zn.thickness,
  40646. function (a) {
  40647. a = ~a.bg_col;
  40648. return -16777216 | (178.5 + (a >> 16 & 255) * (1 - 0.7) | 0) << 16 | (0 + (a >> 8 & 255) * (1 - 0.7) | 0) << 8 | 0 + (a & 255) * (1 - 0.7) | 0
  40649. }(this), 1);
  40650. if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40651. h.zpp_inner.validate();
  40652. e = h.zpp_inner.x;
  40653. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40654. k.zpp_inner.validate();
  40655. e -= k.zpp_inner.x * p;
  40656. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40657. k.zpp_inner.validate();
  40658. e -= k.zpp_inner.y * n;
  40659. if (null !=
  40660. h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40661. h.zpp_inner.validate();
  40662. f = h.zpp_inner.y;
  40663. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40664. k.zpp_inner.validate();
  40665. f -= k.zpp_inner.y * p;
  40666. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40667. k.zpp_inner.validate();
  40668. f += k.zpp_inner.x * n;
  40669. g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
  40670. this.graphics.moveTo(e, f);
  40671. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40672. d.zpp_inner.validate();
  40673. e = d.zpp_inner.x;
  40674. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40675. k.zpp_inner.validate();
  40676. e -= k.zpp_inner.x * p;
  40677. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40678. k.zpp_inner.validate();
  40679. e += k.zpp_inner.y * n;
  40680. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40681. d.zpp_inner.validate();
  40682. f = d.zpp_inner.y;
  40683. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40684. k.zpp_inner.validate();
  40685. p = f - k.zpp_inner.y * p;
  40686. if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40687. k.zpp_inner.validate();
  40688. f = p - k.zpp_inner.x * n;
  40689. g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
  40690. this.graphics.lineTo(e, f);
  40691. if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40692. h.zpp_inner.validate();
  40693. k = h.zpp_inner.x;
  40694. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40695. d.zpp_inner.validate();
  40696. k = 0.5 * (k + d.zpp_inner.x);
  40697. if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40698. h.zpp_inner.validate();
  40699. h = h.zpp_inner.y;
  40700. if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
  40701. d.zpp_inner.validate();
  40702. d = 0.5 * (h + d.zpp_inner.y);
  40703. g || (q = b.a * k + b.b * d + b.tx, d = b.c * k + b.d * d + b.ty, k = q)
  40704. } else {
  40705. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40706. null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
  40707. k = a.zpp_inner.colarb.wrap_contacts.at(0).get_position().get_x();
  40708. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40709. null == a.zpp_inner.colarb.wrap_contacts &&
  40710. a.zpp_inner.colarb.setupcontacts();
  40711. d = a.zpp_inner.colarb.wrap_contacts.at(0).get_position().get_y();
  40712. g || (q = b.a * k + b.b * d + b.tx, d = b.c * k + b.d * d + b.ty, k = q);
  40713. this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
  40714. a = ~a.bg_col;
  40715. return -16777216 | (178.5 + (a >> 16 & 255) * (1 - 0.7) | 0) << 16 | (0 + (a >> 8 & 255) * (1 - 0.7) | 0) << 8 | 178.5 + (a & 255) * (1 - 0.7) | 0
  40716. }(this), 1);
  40717. this.graphics.drawCircle(k, d, 1)
  40718. }
  40719. this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
  40720. var b = ~a.bg_col;
  40721. a = a.bg_col;
  40722. return -16777216 | (0.7 * (b >> 16 & 255) + (a >> 16 & 255) * (1 - 0.7) |
  40723. 0) << 16 | (0.7 * (b >> 8 & 255) + (a >> 8 & 255) * (1 - 0.7) | 0) << 8 | 0.7 * (b & 255) + (a & 255) * (1 - 0.7) | 0
  40724. }(this), 1);
  40725. this.graphics.moveTo(k, d);
  40726. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40727. null == a.zpp_inner.colarb.wrap_normal && a.zpp_inner.colarb.getnormal();
  40728. e = 5 * a.zpp_inner.colarb.wrap_normal.get_x();
  40729. if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
  40730. null == a.zpp_inner.colarb.wrap_normal && a.zpp_inner.colarb.getnormal();
  40731. f = 5 * a.zpp_inner.colarb.wrap_normal.get_y();
  40732. g || (q = b.a * e + b.b * f, f = b.c * e + b.d * f,
  40733. e = q);
  40734. this.graphics.lineTo(k + e, d + f)
  40735. }
  40736. }
  40737. },
  40738. draw_shape: function (a, b, d, g) {
  40739. var e = function (b) {
  40740. b = null == b.outer.colour ? 16777215 * Math.exp(-(a.id % 500) / 1500) | 0 : b.outer.colour(a.id);
  40741. return -16777216 | (0.7 * ((b & 16711680) >> 16) | 0) << 16 | (0.7 * ((b & 65280) >> 8) | 0) << 8 | 0.7 * (b & 255) | 0
  40742. }(this),
  40743. f = a.body;
  40744. if (null != f) {
  40745. var h = function (a) {
  40746. var b;
  40747. b = null == a.outer.colour ? 16777215 * Math.exp(-(f.id % 500) / 1500) | 0 : a.outer.colour(f.id);
  40748. var d = 0.7 * ((b & 16711680) >> 16),
  40749. c = 0.7 * ((b & 65280) >> 8);
  40750. b = 0.7 * (b & 255);
  40751. null != f.space && f.outer.get_isSleeping() && (d = 0.4 * d +
  40752. 0.6 * a.bg_r, c = 0.4 * c + 0.6 * a.bg_g, b = 0.4 * b + 0.6 * a.bg_b);
  40753. return -16777216 | (d | 0) << 16 | (c | 0) << 8 | b | 0
  40754. }(this),
  40755. e = function (a) {
  40756. a = e;
  40757. return -16777216 | (0.2 * (a >> 16 & 255) + 0.8 * (h >> 16 & 255) | 0) << 16 | (0.2 * (a >> 8 & 255) + 0.8 * (h >> 8 & 255) | 0) << 8 | 0.2 * (a & 255) + 0.8 * (h & 255) | 0
  40758. }(this);
  40759. this.graphics.lineStyle(this.outer_zn.thickness, e, 1);
  40760. if (a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
  40761. var k = a.circle;
  40762. k.zip_worldCOM && null != k.body && (k.zip_worldCOM = !1, k.zip_localCOM && (k.zip_localCOM = !1, k.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && k.polygon.__validate_localCOM(),
  40763. null != k.wrap_localCOM && (k.wrap_localCOM.zpp_inner.x = k.localCOMx, k.wrap_localCOM.zpp_inner.y = k.localCOMy)), k.body.validate_axis(), k.worldCOMx = k.body.posx + (k.body.axisy * k.localCOMx - k.body.axisx * k.localCOMy), k.worldCOMy = k.body.posy + (k.localCOMx * k.body.axisx + k.localCOMy * k.body.axisy));
  40764. var n = k.worldCOMx,
  40765. p = k.worldCOMy;
  40766. if (!g) var q = b.a * n + b.b * p + b.tx,
  40767. p = b.c * n + b.d * p + b.ty,
  40768. n = q;
  40769. this.graphics.drawCircle(n, p, k.radius * d);
  40770. this.outer.drawShapeAngleIndicators && (n = k.worldCOMx + 0.3 * k.radius * f.axisy, p = k.worldCOMy + 0.3 * k.radius *
  40771. f.axisx, d = k.worldCOMx + k.radius * f.axisy, k = k.worldCOMy + k.radius * f.axisx, g || (q = b.a * n + b.b * p + b.tx, p = b.c * n + b.d * p + b.ty, n = q), g || (q = b.a * d + b.b * k + b.tx, k = b.c * d + b.d * k + b.ty, d = q), this.graphics.moveTo(n, p), this.graphics.lineTo(d, k))
  40772. } else {
  40773. k = a.polygon;
  40774. k.validate_gverts();
  40775. q = k.gverts.next;
  40776. n = q.x;
  40777. p = q.y;
  40778. g || (q = b.a * n + b.b * p + b.tx, p = b.c * n + b.d * p + b.ty, n = q);
  40779. this.graphics.moveTo(n, p);
  40780. d = n;
  40781. for (var r = p, s = k.gverts.next.next; null != s;) q = s, n = q.x, p = q.y, g || (q = b.a * n + b.b * p + b.tx, p = b.c * n + b.d * p + b.ty, n = q), this.graphics.lineTo(n, p), s = s.next;
  40782. this.graphics.lineTo(d,
  40783. r);
  40784. this.outer.drawShapeAngleIndicators && (k.zip_worldCOM && null != k.body && (k.zip_worldCOM = !1, k.zip_localCOM && (k.zip_localCOM = !1, k.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && k.polygon.__validate_localCOM(), null != k.wrap_localCOM && (k.wrap_localCOM.zpp_inner.x = k.localCOMx, k.wrap_localCOM.zpp_inner.y = k.localCOMy)), k.body.validate_axis(), k.worldCOMx = k.body.posx + (k.body.axisy * k.localCOMx - k.body.axisx * k.localCOMy), k.worldCOMy = k.body.posy + (k.localCOMx * k.body.axisx + k.localCOMy * k.body.axisy)), g ? (n = k.worldCOMx,
  40785. p = k.worldCOMy) : (n = b.a * k.worldCOMx + b.b * k.worldCOMy + b.tx, p = b.c * k.worldCOMx + b.d * k.worldCOMy + b.ty), this.graphics.moveTo(n, p), this.graphics.lineTo(d, r))
  40786. }
  40787. this.outer.drawShapeDetail && (a.zip_worldCOM && null != a.body && (a.zip_worldCOM = !1, a.zip_localCOM && (a.zip_localCOM = !1, a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.__validate_localCOM(), null != a.wrap_localCOM && (a.wrap_localCOM.zpp_inner.x = a.localCOMx, a.wrap_localCOM.zpp_inner.y = a.localCOMy)), a.body.validate_axis(), a.worldCOMx = a.body.posx + (a.body.axisy *
  40788. a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy)), this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
  40789. a = e;
  40790. return -16777216 | (0.8 * (a >> 16 & 255) + 255 * (1 - 0.8) | 0) << 16 | (0.8 * (a >> 8 & 255) + 0 * (1 - 0.8) | 0) << 8 | 0.8 * (a & 255) + 0 * (1 - 0.8) | 0
  40791. }(this), 1), p = n = 0, g ? (n = a.worldCOMx, p = a.worldCOMy) : (n = b.a * a.worldCOMx + b.b * a.worldCOMy + b.tx, p = b.c * a.worldCOMx + b.d * a.worldCOMy + b.ty), this.graphics.drawCircle(n, p, 1), a.zip_aabb && null != a.body && (a.zip_aabb = !1, a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ?
  40792. a.circle.__validate_aabb() : a.polygon.__validate_aabb()), g ? this.graphics.drawRect(a.aabb.minx, a.aabb.miny, a.aabb.width(), a.aabb.height()) : (n = g = 0, g = b.a * a.aabb.minx + b.b * a.aabb.miny + b.tx, n = b.c * a.aabb.minx + b.d * a.aabb.miny + b.ty, p = a.aabb.width(), k = 0, q = b.a * p + b.b * k, k = b.c * p + b.d * k, p = q, d = 0, r = a.aabb.height(), q = b.a * d + b.b * r, r = b.c * d + b.d * r, d = q, this.graphics.moveTo(g, n), this.graphics.lineTo(g + p, n + k), this.graphics.lineTo(g + p + d, n + k + r), this.graphics.lineTo(g + d, n + r), this.graphics.lineTo(g, n)))
  40793. }
  40794. },
  40795. draw_body: function (a, b,
  40796. d, c) {
  40797. for (var e = a.shapes.head; null != e;) this.draw_shape(e.elt, b, d, c), e = e.next;
  40798. if (this.outer.drawBodyDetail) {
  40799. var f;
  40800. f = null == this.outer.colour ? 16777215 * Math.exp(-(a.id % 500) / 1500) | 0 : this.outer.colour(a.id);
  40801. d = 0.7 * ((f & 16711680) >> 16);
  40802. e = 0.7 * ((f & 65280) >> 8);
  40803. f = 0.7 * (f & 255);
  40804. null != a.space && a.outer.get_isSleeping() && (d = 0.4 * d + 0.6 * this.bg_r, e = 0.4 * e + 0.6 * this.bg_g, f = 0.4 * f + 0.6 * this.bg_b);
  40805. d = -16777216 | (d | 0) << 16 | (e | 0) << 8 | f | 0;
  40806. this.graphics.lineStyle(this.outer_zn.thickness, -16777216 | (0.8 * (d >> 16 & 255) + 255 * (1 - 0.8) | 0) << 16 | (0.8 *
  40807. (d >> 8 & 255) + 0 * (1 - 0.8) | 0) << 8 | 0.8 * (d & 255) + 0 * (1 - 0.8) | 0, 1);
  40808. var h = f = e = d = 0;
  40809. if (null != a.shapes.head)
  40810. if (a.validate_worldCOM(), c ? (d = a.worldCOMx, e = a.worldCOMy) : (d = b.a * a.worldCOMx + b.b * a.worldCOMy + b.tx, e = b.c * a.worldCOMx + b.d * a.worldCOMy + b.ty), this.graphics.drawCircle(d, e, 1), a.validate_aabb(), c) this.graphics.drawRect(a.aabb.minx, a.aabb.miny, a.aabb.width(), a.aabb.height());
  40811. else {
  40812. e = d = 0;
  40813. d = b.a * a.aabb.minx + b.b * a.aabb.miny + b.tx;
  40814. e = b.c * a.aabb.minx + b.d * a.aabb.miny + b.ty;
  40815. f = a.aabb.width();
  40816. var h = 0,
  40817. k = b.a * f + b.b * h,
  40818. h = b.c * f + b.d * h;
  40819. f = k;
  40820. var n = 0,
  40821. p = a.aabb.height(),
  40822. k = b.a * n + b.b * p,
  40823. p = b.c * n + b.d * p,
  40824. n = k;
  40825. this.graphics.moveTo(d, e);
  40826. this.graphics.lineTo(d + f, e + h);
  40827. this.graphics.lineTo(d + f + n, e + h + p);
  40828. this.graphics.lineTo(d + n, e + p);
  40829. this.graphics.lineTo(d, e)
  40830. }
  40831. c ? (f = a.pre_posx, h = a.pre_posy) : (f = b.a * a.pre_posx + b.b * a.pre_posy + b.tx, h = b.c * a.pre_posx + b.d * a.pre_posy + b.ty);
  40832. c ? (d = a.posx, e = a.posy) : (d = b.a * a.posx + b.b * a.posy + b.tx, e = b.c * a.posx + b.d * a.posy + b.ty);
  40833. this.graphics.moveTo(f, h);
  40834. this.graphics.lineTo(d, e);
  40835. this.graphics.drawCircle(d, e, 1)
  40836. }
  40837. },
  40838. draw_space: function (a,
  40839. b, d, g) {
  40840. if (this.outer.cullingEnabled) {
  40841. if (this.outer.drawBodies)
  40842. if (this.outer.drawBodyDetail)
  40843. for (var e = this.bodyList = a.bphase.bodiesInAABB(this.iport, !1, !1, null, this.bodyList); null != e.zpp_inner.inner.head;) {
  40844. var f = e.shift();
  40845. f.debugDraw && this.draw_body(f.zpp_inner, b, d, g)
  40846. } else
  40847. for (f = this.shapeList = a.bphase.shapesInAABB(this.iport, !1, !1, null, this.shapeList); null != f.zpp_inner.inner.head;) e = f.shift(), (null != e.zpp_inner.body ? e.zpp_inner.body.outer : null).debugDraw && this.draw_shape(e.zpp_inner, b, d, g)
  40848. } else if (this.outer.drawBodies) {
  40849. null ==
  40850. this.compoundstack && (this.compoundstack = new c.util.ZNPList_ZPP_Compound);
  40851. for (e = a.bodies.head; null != e;) f = e.elt, f.outer.debugDraw && this.draw_body(f, b, d, g), e = e.next;
  40852. for (e = a.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next;
  40853. for (; null != this.compoundstack.head;) {
  40854. for (var h = this.compoundstack.pop_unsafe(), e = h.bodies.head; null != e;) f = e.elt, f.outer.debugDraw && this.draw_body(f, b, d, g), e = e.next;
  40855. for (e = h.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next
  40856. }
  40857. }
  40858. if (this.outer.drawCollisionArbiters ||
  40859. this.outer.drawFluidArbiters || this.outer.drawSensorArbiters)
  40860. for (f = a.outer.get_arbiters().iterator(); f.hasNext();) e = f.next(), this.draw_arbiter(e.zpp_inner, b, d, g);
  40861. if (this.outer.drawConstraints) {
  40862. null == this.compoundstack && (this.compoundstack = new c.util.ZNPList_ZPP_Compound);
  40863. for (e = a.constraints.head; null != e;) f = e.elt, f.active && f.outer.debugDraw && f.draw(this.outer), e = e.next;
  40864. for (e = a.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next;
  40865. for (; null != this.compoundstack.head;) {
  40866. h = this.compoundstack.pop_unsafe();
  40867. for (e = h.constraints.head; null != e;) f = e.elt, f.active && f.outer.debugDraw && f.draw(this.outer), e = e.next;
  40868. for (e = h.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next
  40869. }
  40870. }
  40871. },
  40872. draw_compound: function (a, b, d, c) {
  40873. for (var e = a.compounds.head; null != e;) {
  40874. var f = e.elt;
  40875. this.draw_compound(f, b, d, c);
  40876. e = e.next
  40877. }
  40878. for (e = a.bodies.head; null != e;) f = e.elt, f.outer.debugDraw && this.draw_body(f, b, d, c), e = e.next;
  40879. for (e = a.constraints.head; null != e;) f = e.elt, f.active && f.outer.debugDraw && f.draw(this.outer), e = e.next
  40880. },
  40881. setbg: function (a) {
  40882. this.sup_setbg(a)
  40883. },
  40884. __class__: c.util.ZPP_ShapeDebug
  40885. });
  40886. c.util.Hashable2_Boolfalse = function () {
  40887. this.id = this.di = 0;
  40888. this.next = this.hnext = null;
  40889. this.value = !1
  40890. };
  40891. s["zpp_nape.util.Hashable2_Boolfalse"] = c.util.Hashable2_Boolfalse;
  40892. c.util.Hashable2_Boolfalse.__name__ = ["zpp_nape", "util", "Hashable2_Boolfalse"];
  40893. c.util.Hashable2_Boolfalse.get = function (a, b, d) {
  40894. a = c.util.Hashable2_Boolfalse.getpersist(a, b);
  40895. a.value = d;
  40896. return a
  40897. };
  40898. c.util.Hashable2_Boolfalse.getpersist = function (a, b) {
  40899. var d;
  40900. null == c.util.Hashable2_Boolfalse.zpp_pool ? d = new c.util.Hashable2_Boolfalse :
  40901. (d = c.util.Hashable2_Boolfalse.zpp_pool, c.util.Hashable2_Boolfalse.zpp_pool = d.next, d.next = null);
  40902. null;
  40903. d.id = a;
  40904. d.di = b;
  40905. return d
  40906. };
  40907. c.util.Hashable2_Boolfalse.ordered_get = function (a, b, d) {
  40908. return a <= b ? c.util.Hashable2_Boolfalse.get(a, b, d) : c.util.Hashable2_Boolfalse.get(b, a, d)
  40909. };
  40910. c.util.Hashable2_Boolfalse.ordered_get_persist = function (a, b) {
  40911. return a <= b ? c.util.Hashable2_Boolfalse.getpersist(a, b) : c.util.Hashable2_Boolfalse.getpersist(b, a)
  40912. };
  40913. c.util.Hashable2_Boolfalse.prototype = {
  40914. alloc: function () {},
  40915. free: function () {},
  40916. __class__: c.util.Hashable2_Boolfalse
  40917. };
  40918. c.util.FastHash2_Hashable2_Boolfalse = function () {
  40919. this.cnt = 0;
  40920. this.table = null;
  40921. this.cnt = 0;
  40922. this.table = [];
  40923. for (var a = 0; 1048576 > a;) a++, this.table.push(null)
  40924. };
  40925. s["zpp_nape.util.FastHash2_Hashable2_Boolfalse"] = c.util.FastHash2_Hashable2_Boolfalse;
  40926. c.util.FastHash2_Hashable2_Boolfalse.__name__ = ["zpp_nape", "util", "FastHash2_Hashable2_Boolfalse"];
  40927. c.util.FastHash2_Hashable2_Boolfalse.prototype = {
  40928. hash: function (a, b) {
  40929. return 106039 * a + b & 1048575
  40930. },
  40931. remove: function (a) {
  40932. var b = 106039 * a.id +
  40933. a.di & 1048575,
  40934. d = this.table[b];
  40935. if (d == a) this.table[b] = d.hnext;
  40936. else if (null != d) {
  40937. do b = d, d = d.hnext; while (null != d && d != a);
  40938. b.hnext = d.hnext
  40939. }
  40940. a.hnext = null;
  40941. this.cnt--
  40942. },
  40943. add: function (a) {
  40944. var b = 106039 * a.id + a.di & 1048575,
  40945. d = this.table[b];
  40946. null == d ? (this.table[b] = a, a.hnext = null) : (a.hnext = d.hnext, d.hnext = a);
  40947. this.cnt++
  40948. },
  40949. maybeAdd: function (a) {
  40950. var b = 106039 * a.id + a.di & 1048575,
  40951. d = this.table[b];
  40952. null == d ? (this.table[b] = a, a.hnext = null) : (a.hnext = d.hnext, d.hnext = a);
  40953. this.cnt++
  40954. },
  40955. has: function (a, b) {
  40956. var d = this.table[106039 * a + b & 1048575];
  40957. if (null ==
  40958. d) return !1;
  40959. if (d.id == a && d.di == b) return !0;
  40960. do d = d.hnext; while (null != d && (d.id != a || d.di != b));
  40961. return null != d
  40962. },
  40963. ordered_get: function (a, b) {
  40964. if (a > b) {
  40965. var d = a;
  40966. a = b;
  40967. b = d
  40968. }
  40969. return this.get(a, b)
  40970. },
  40971. get: function (a, b) {
  40972. var d = this.table[106039 * a + b & 1048575];
  40973. if (null == d) return null;
  40974. if (d.id != a || d.di != b) {
  40975. do d = d.hnext; while (null != d && (d.id != a || d.di != b))
  40976. }
  40977. return d
  40978. },
  40979. clear: function () {
  40980. for (var a = 0, b = this.table.length; a < b;) {
  40981. var d = a++,
  40982. c = this.table[d];
  40983. if (null != c) {
  40984. for (; null != c;) {
  40985. var e = c.hnext;
  40986. c.hnext = null;
  40987. c;
  40988. c = e
  40989. }
  40990. this.table[d] = null
  40991. }
  40992. }
  40993. },
  40994. empty: function () {
  40995. return 0 ==
  40996. this.cnt
  40997. },
  40998. __class__: c.util.FastHash2_Hashable2_Boolfalse
  40999. };
  41000. c.util.ZNPList_ZPP_CallbackSet = function () {
  41001. this.length = 0;
  41002. this.modified = this.pushmod = !1;
  41003. this.head = null
  41004. };
  41005. s["zpp_nape.util.ZNPList_ZPP_CallbackSet"] = c.util.ZNPList_ZPP_CallbackSet;
  41006. c.util.ZNPList_ZPP_CallbackSet.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CallbackSet"];
  41007. c.util.ZNPList_ZPP_CallbackSet.prototype = {
  41008. at: function (a) {
  41009. a = this.iterator_at(a);
  41010. return null != a ? a.elt : null
  41011. },
  41012. iterator_at: function (a) {
  41013. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  41014. return b
  41015. },
  41016. back: function () {
  41017. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  41018. return a.elt
  41019. },
  41020. front: function () {
  41021. return this.head.elt
  41022. },
  41023. inlined_has: function (a) {
  41024. var b;
  41025. b = !1;
  41026. for (var d = this.head; null != d;) {
  41027. if (d.elt == a) {
  41028. b = !0;
  41029. break
  41030. }
  41031. d = d.next
  41032. }
  41033. return b
  41034. },
  41035. has: function (a) {
  41036. return this.inlined_has(a)
  41037. },
  41038. size: function () {
  41039. return this.length
  41040. },
  41041. empty: function () {
  41042. return null == this.head
  41043. },
  41044. reverse: function () {
  41045. for (var a = this.head, b = null; null != a;) {
  41046. var d = a.next;
  41047. a.next = b;
  41048. b = this.head = a;
  41049. a = d
  41050. }
  41051. this.pushmod = this.modified = !0
  41052. },
  41053. inlined_clear: function () {
  41054. for (; null !=
  41055. this.head;) this.inlined_pop();
  41056. this.pushmod = !0
  41057. },
  41058. clear: function () {
  41059. for (; null != this.head;) this.inlined_pop();
  41060. this.pushmod = !0
  41061. },
  41062. splice: function (a, b) {
  41063. for (; 0 < b-- && null != a.next;) this.erase(a);
  41064. return a.next
  41065. },
  41066. inlined_erase: function (a) {
  41067. var b, d;
  41068. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  41069. a = b;
  41070. a.elt = null;
  41071. a.next = c.util.ZNPNode_ZPP_CallbackSet.zpp_pool;
  41072. c.util.ZNPNode_ZPP_CallbackSet.zpp_pool = a;
  41073. this.modified = !0;
  41074. this.length--;
  41075. this.pushmod = !0;
  41076. return d
  41077. },
  41078. erase: function (a) {
  41079. return this.inlined_erase(a)
  41080. },
  41081. inlined_try_remove: function (a) {
  41082. for (var b = null, d = this.head, c = !1; null != d;) {
  41083. if (d.elt == a) {
  41084. this.inlined_erase(b);
  41085. c = !0;
  41086. break
  41087. }
  41088. b = d;
  41089. d = d.next
  41090. }
  41091. return c
  41092. },
  41093. inlined_remove: function (a) {
  41094. this.inlined_try_remove(a)
  41095. },
  41096. try_remove: function (a) {
  41097. for (var b = null, d = this.head, c = !1; null != d;) {
  41098. if (d.elt == a) {
  41099. this.erase(b);
  41100. c = !0;
  41101. break
  41102. }
  41103. b = d;
  41104. d = d.next
  41105. }
  41106. return c
  41107. },
  41108. remove: function (a) {
  41109. this.inlined_try_remove(a)
  41110. },
  41111. inlined_pop_unsafe: function () {
  41112. var a = this.head.elt;
  41113. this.pop();
  41114. return a
  41115. },
  41116. pop_unsafe: function () {
  41117. return this.inlined_pop_unsafe()
  41118. },
  41119. inlined_pop: function () {
  41120. var a = this.head;
  41121. this.head = a.next;
  41122. a.elt = null;
  41123. a.next = c.util.ZNPNode_ZPP_CallbackSet.zpp_pool;
  41124. c.util.ZNPNode_ZPP_CallbackSet.zpp_pool = a;
  41125. null == this.head && (this.pushmod = !0);
  41126. this.modified = !0;
  41127. this.length--
  41128. },
  41129. pop: function () {
  41130. this.inlined_pop()
  41131. },
  41132. inlined_insert: function (a, b) {
  41133. var d;
  41134. null == c.util.ZNPNode_ZPP_CallbackSet.zpp_pool ? d = new c.util.ZNPNode_ZPP_CallbackSet : (d = c.util.ZNPNode_ZPP_CallbackSet.zpp_pool, c.util.ZNPNode_ZPP_CallbackSet.zpp_pool =
  41135. d.next, d.next = null);
  41136. null;
  41137. d.elt = b;
  41138. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  41139. this.pushmod = this.modified = !0;
  41140. this.length++;
  41141. return d
  41142. },
  41143. insert: function (a, b) {
  41144. return this.inlined_insert(a, b)
  41145. },
  41146. addAll: function (a) {
  41147. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  41148. },
  41149. inlined_add: function (a) {
  41150. var b;
  41151. null == c.util.ZNPNode_ZPP_CallbackSet.zpp_pool ? b = new c.util.ZNPNode_ZPP_CallbackSet : (b = c.util.ZNPNode_ZPP_CallbackSet.zpp_pool, c.util.ZNPNode_ZPP_CallbackSet.zpp_pool = b.next, b.next = null);
  41152. null;
  41153. b.elt = a;
  41154. b.next = this.head;
  41155. this.head = b;
  41156. this.modified = !0;
  41157. this.length++;
  41158. return a
  41159. },
  41160. add: function (a) {
  41161. return this.inlined_add(a)
  41162. },
  41163. setbegin: function (a) {
  41164. this.head = a;
  41165. this.pushmod = this.modified = !0
  41166. },
  41167. begin: function () {
  41168. return this.head
  41169. },
  41170. __class__: c.util.ZNPList_ZPP_CallbackSet
  41171. };
  41172. c.util.ZNPList_ZPP_Shape = function () {
  41173. this.length = 0;
  41174. this.modified = this.pushmod = !1;
  41175. this.head = null
  41176. };
  41177. s["zpp_nape.util.ZNPList_ZPP_Shape"] = c.util.ZNPList_ZPP_Shape;
  41178. c.util.ZNPList_ZPP_Shape.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Shape"];
  41179. c.util.ZNPList_ZPP_Shape.prototype = {
  41180. at: function (a) {
  41181. a = this.iterator_at(a);
  41182. return null != a ? a.elt : null
  41183. },
  41184. iterator_at: function (a) {
  41185. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  41186. return b
  41187. },
  41188. back: function () {
  41189. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  41190. return a.elt
  41191. },
  41192. front: function () {
  41193. return this.head.elt
  41194. },
  41195. inlined_has: function (a) {
  41196. var b;
  41197. b = !1;
  41198. for (var d = this.head; null != d;) {
  41199. if (d.elt == a) {
  41200. b = !0;
  41201. break
  41202. }
  41203. d = d.next
  41204. }
  41205. return b
  41206. },
  41207. has: function (a) {
  41208. return this.inlined_has(a)
  41209. },
  41210. size: function () {
  41211. return this.length
  41212. },
  41213. empty: function () {
  41214. return null == this.head
  41215. },
  41216. reverse: function () {
  41217. for (var a =
  41218. this.head, b = null; null != a;) {
  41219. var d = a.next;
  41220. a.next = b;
  41221. b = this.head = a;
  41222. a = d
  41223. }
  41224. this.pushmod = this.modified = !0
  41225. },
  41226. inlined_clear: function () {
  41227. for (; null != this.head;) this.inlined_pop();
  41228. this.pushmod = !0
  41229. },
  41230. clear: function () {
  41231. for (; null != this.head;) this.inlined_pop();
  41232. this.pushmod = !0
  41233. },
  41234. splice: function (a, b) {
  41235. for (; 0 < b-- && null != a.next;) this.erase(a);
  41236. return a.next
  41237. },
  41238. inlined_erase: function (a) {
  41239. var b, d;
  41240. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  41241. a = b;
  41242. a.elt = null;
  41243. a.next = c.util.ZNPNode_ZPP_Shape.zpp_pool;
  41244. c.util.ZNPNode_ZPP_Shape.zpp_pool = a;
  41245. this.modified = !0;
  41246. this.length--;
  41247. this.pushmod = !0;
  41248. return d
  41249. },
  41250. erase: function (a) {
  41251. return this.inlined_erase(a)
  41252. },
  41253. inlined_try_remove: function (a) {
  41254. for (var b = null, d = this.head, c = !1; null != d;) {
  41255. if (d.elt == a) {
  41256. this.inlined_erase(b);
  41257. c = !0;
  41258. break
  41259. }
  41260. b = d;
  41261. d = d.next
  41262. }
  41263. return c
  41264. },
  41265. inlined_remove: function (a) {
  41266. this.inlined_try_remove(a)
  41267. },
  41268. try_remove: function (a) {
  41269. for (var b = null, d = this.head, c = !1; null != d;) {
  41270. if (d.elt == a) {
  41271. this.erase(b);
  41272. c = !0;
  41273. break
  41274. }
  41275. b = d;
  41276. d = d.next
  41277. }
  41278. return c
  41279. },
  41280. remove: function (a) {
  41281. this.inlined_try_remove(a)
  41282. },
  41283. inlined_pop_unsafe: function () {
  41284. var a = this.head.elt;
  41285. this.pop();
  41286. return a
  41287. },
  41288. pop_unsafe: function () {
  41289. return this.inlined_pop_unsafe()
  41290. },
  41291. inlined_pop: function () {
  41292. var a = this.head;
  41293. this.head = a.next;
  41294. a.elt = null;
  41295. a.next = c.util.ZNPNode_ZPP_Shape.zpp_pool;
  41296. c.util.ZNPNode_ZPP_Shape.zpp_pool = a;
  41297. null == this.head && (this.pushmod = !0);
  41298. this.modified = !0;
  41299. this.length--
  41300. },
  41301. pop: function () {
  41302. this.inlined_pop()
  41303. },
  41304. inlined_insert: function (a, b) {
  41305. var d;
  41306. null == c.util.ZNPNode_ZPP_Shape.zpp_pool ? d = new c.util.ZNPNode_ZPP_Shape :
  41307. (d = c.util.ZNPNode_ZPP_Shape.zpp_pool, c.util.ZNPNode_ZPP_Shape.zpp_pool = d.next, d.next = null);
  41308. null;
  41309. d.elt = b;
  41310. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  41311. this.pushmod = this.modified = !0;
  41312. this.length++;
  41313. return d
  41314. },
  41315. insert: function (a, b) {
  41316. return this.inlined_insert(a, b)
  41317. },
  41318. addAll: function (a) {
  41319. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  41320. },
  41321. inlined_add: function (a) {
  41322. var b;
  41323. null == c.util.ZNPNode_ZPP_Shape.zpp_pool ? b = new c.util.ZNPNode_ZPP_Shape : (b = c.util.ZNPNode_ZPP_Shape.zpp_pool, c.util.ZNPNode_ZPP_Shape.zpp_pool =
  41324. b.next, b.next = null);
  41325. null;
  41326. b.elt = a;
  41327. b.next = this.head;
  41328. this.head = b;
  41329. this.modified = !0;
  41330. this.length++;
  41331. return a
  41332. },
  41333. add: function (a) {
  41334. return this.inlined_add(a)
  41335. },
  41336. setbegin: function (a) {
  41337. this.head = a;
  41338. this.pushmod = this.modified = !0
  41339. },
  41340. begin: function () {
  41341. return this.head
  41342. },
  41343. __class__: c.util.ZNPList_ZPP_Shape
  41344. };
  41345. c.util.ZNPList_ZPP_Body = function () {
  41346. this.length = 0;
  41347. this.modified = this.pushmod = !1;
  41348. this.head = null
  41349. };
  41350. s["zpp_nape.util.ZNPList_ZPP_Body"] = c.util.ZNPList_ZPP_Body;
  41351. c.util.ZNPList_ZPP_Body.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Body"];
  41352. c.util.ZNPList_ZPP_Body.prototype = {
  41353. at: function (a) {
  41354. a = this.iterator_at(a);
  41355. return null != a ? a.elt : null
  41356. },
  41357. iterator_at: function (a) {
  41358. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  41359. return b
  41360. },
  41361. back: function () {
  41362. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  41363. return a.elt
  41364. },
  41365. front: function () {
  41366. return this.head.elt
  41367. },
  41368. inlined_has: function (a) {
  41369. var b;
  41370. b = !1;
  41371. for (var d = this.head; null != d;) {
  41372. if (d.elt == a) {
  41373. b = !0;
  41374. break
  41375. }
  41376. d = d.next
  41377. }
  41378. return b
  41379. },
  41380. has: function (a) {
  41381. return this.inlined_has(a)
  41382. },
  41383. size: function () {
  41384. return this.length
  41385. },
  41386. empty: function () {
  41387. return null ==
  41388. this.head
  41389. },
  41390. reverse: function () {
  41391. for (var a = this.head, b = null; null != a;) {
  41392. var d = a.next;
  41393. a.next = b;
  41394. b = this.head = a;
  41395. a = d
  41396. }
  41397. this.pushmod = this.modified = !0
  41398. },
  41399. inlined_clear: function () {
  41400. for (; null != this.head;) this.inlined_pop();
  41401. this.pushmod = !0
  41402. },
  41403. clear: function () {
  41404. for (; null != this.head;) this.inlined_pop();
  41405. this.pushmod = !0
  41406. },
  41407. splice: function (a, b) {
  41408. for (; 0 < b-- && null != a.next;) this.erase(a);
  41409. return a.next
  41410. },
  41411. inlined_erase: function (a) {
  41412. var b, d;
  41413. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next,
  41414. a.next = d, null == d && (this.pushmod = !0));
  41415. a = b;
  41416. a.elt = null;
  41417. a.next = c.util.ZNPNode_ZPP_Body.zpp_pool;
  41418. c.util.ZNPNode_ZPP_Body.zpp_pool = a;
  41419. this.modified = !0;
  41420. this.length--;
  41421. this.pushmod = !0;
  41422. return d
  41423. },
  41424. erase: function (a) {
  41425. return this.inlined_erase(a)
  41426. },
  41427. inlined_try_remove: function (a) {
  41428. for (var b = null, d = this.head, c = !1; null != d;) {
  41429. if (d.elt == a) {
  41430. this.inlined_erase(b);
  41431. c = !0;
  41432. break
  41433. }
  41434. b = d;
  41435. d = d.next
  41436. }
  41437. return c
  41438. },
  41439. inlined_remove: function (a) {
  41440. this.inlined_try_remove(a)
  41441. },
  41442. try_remove: function (a) {
  41443. for (var b = null, d = this.head, c = !1; null != d;) {
  41444. if (d.elt ==
  41445. a) {
  41446. this.erase(b);
  41447. c = !0;
  41448. break
  41449. }
  41450. b = d;
  41451. d = d.next
  41452. }
  41453. return c
  41454. },
  41455. remove: function (a) {
  41456. this.inlined_try_remove(a)
  41457. },
  41458. inlined_pop_unsafe: function () {
  41459. var a = this.head.elt;
  41460. this.pop();
  41461. return a
  41462. },
  41463. pop_unsafe: function () {
  41464. return this.inlined_pop_unsafe()
  41465. },
  41466. inlined_pop: function () {
  41467. var a = this.head;
  41468. this.head = a.next;
  41469. a.elt = null;
  41470. a.next = c.util.ZNPNode_ZPP_Body.zpp_pool;
  41471. c.util.ZNPNode_ZPP_Body.zpp_pool = a;
  41472. null == this.head && (this.pushmod = !0);
  41473. this.modified = !0;
  41474. this.length--
  41475. },
  41476. pop: function () {
  41477. this.inlined_pop()
  41478. },
  41479. inlined_insert: function (a, b) {
  41480. var d;
  41481. null == c.util.ZNPNode_ZPP_Body.zpp_pool ? d = new c.util.ZNPNode_ZPP_Body : (d = c.util.ZNPNode_ZPP_Body.zpp_pool, c.util.ZNPNode_ZPP_Body.zpp_pool = d.next, d.next = null);
  41482. null;
  41483. d.elt = b;
  41484. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  41485. this.pushmod = this.modified = !0;
  41486. this.length++;
  41487. return d
  41488. },
  41489. insert: function (a, b) {
  41490. return this.inlined_insert(a, b)
  41491. },
  41492. addAll: function (a) {
  41493. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  41494. },
  41495. inlined_add: function (a) {
  41496. var b;
  41497. null == c.util.ZNPNode_ZPP_Body.zpp_pool ? b = new c.util.ZNPNode_ZPP_Body :
  41498. (b = c.util.ZNPNode_ZPP_Body.zpp_pool, c.util.ZNPNode_ZPP_Body.zpp_pool = b.next, b.next = null);
  41499. null;
  41500. b.elt = a;
  41501. b.next = this.head;
  41502. this.head = b;
  41503. this.modified = !0;
  41504. this.length++;
  41505. return a
  41506. },
  41507. add: function (a) {
  41508. return this.inlined_add(a)
  41509. },
  41510. setbegin: function (a) {
  41511. this.head = a;
  41512. this.pushmod = this.modified = !0
  41513. },
  41514. begin: function () {
  41515. return this.head
  41516. },
  41517. __class__: c.util.ZNPList_ZPP_Body
  41518. };
  41519. c.util.ZNPList_ZPP_Compound = function () {
  41520. this.length = 0;
  41521. this.modified = this.pushmod = !1;
  41522. this.head = null
  41523. };
  41524. s["zpp_nape.util.ZNPList_ZPP_Compound"] = c.util.ZNPList_ZPP_Compound;
  41525. c.util.ZNPList_ZPP_Compound.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Compound"];
  41526. c.util.ZNPList_ZPP_Compound.prototype = {
  41527. at: function (a) {
  41528. a = this.iterator_at(a);
  41529. return null != a ? a.elt : null
  41530. },
  41531. iterator_at: function (a) {
  41532. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  41533. return b
  41534. },
  41535. back: function () {
  41536. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  41537. return a.elt
  41538. },
  41539. front: function () {
  41540. return this.head.elt
  41541. },
  41542. inlined_has: function (a) {
  41543. var b;
  41544. b = !1;
  41545. for (var d = this.head; null != d;) {
  41546. if (d.elt == a) {
  41547. b = !0;
  41548. break
  41549. }
  41550. d = d.next
  41551. }
  41552. return b
  41553. },
  41554. has: function (a) {
  41555. return this.inlined_has(a)
  41556. },
  41557. size: function () {
  41558. return this.length
  41559. },
  41560. empty: function () {
  41561. return null == this.head
  41562. },
  41563. reverse: function () {
  41564. for (var a = this.head, b = null; null != a;) {
  41565. var d = a.next;
  41566. a.next = b;
  41567. b = this.head = a;
  41568. a = d
  41569. }
  41570. this.pushmod = this.modified = !0
  41571. },
  41572. inlined_clear: function () {
  41573. for (; null != this.head;) this.inlined_pop();
  41574. this.pushmod = !0
  41575. },
  41576. clear: function () {
  41577. for (; null != this.head;) this.inlined_pop();
  41578. this.pushmod = !0
  41579. },
  41580. splice: function (a, b) {
  41581. for (; 0 < b-- && null != a.next;) this.erase(a);
  41582. return a.next
  41583. },
  41584. inlined_erase: function (a) {
  41585. var b, d;
  41586. null == a ? (b = this.head, this.head =
  41587. d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  41588. a = b;
  41589. a.elt = null;
  41590. a.next = c.util.ZNPNode_ZPP_Compound.zpp_pool;
  41591. c.util.ZNPNode_ZPP_Compound.zpp_pool = a;
  41592. this.modified = !0;
  41593. this.length--;
  41594. this.pushmod = !0;
  41595. return d
  41596. },
  41597. erase: function (a) {
  41598. return this.inlined_erase(a)
  41599. },
  41600. inlined_try_remove: function (a) {
  41601. for (var b = null, d = this.head, c = !1; null != d;) {
  41602. if (d.elt == a) {
  41603. this.inlined_erase(b);
  41604. c = !0;
  41605. break
  41606. }
  41607. b = d;
  41608. d = d.next
  41609. }
  41610. return c
  41611. },
  41612. inlined_remove: function (a) {
  41613. this.inlined_try_remove(a)
  41614. },
  41615. try_remove: function (a) {
  41616. for (var b = null, d = this.head, c = !1; null != d;) {
  41617. if (d.elt == a) {
  41618. this.erase(b);
  41619. c = !0;
  41620. break
  41621. }
  41622. b = d;
  41623. d = d.next
  41624. }
  41625. return c
  41626. },
  41627. remove: function (a) {
  41628. this.inlined_try_remove(a)
  41629. },
  41630. inlined_pop_unsafe: function () {
  41631. var a = this.head.elt;
  41632. this.pop();
  41633. return a
  41634. },
  41635. pop_unsafe: function () {
  41636. return this.inlined_pop_unsafe()
  41637. },
  41638. inlined_pop: function () {
  41639. var a = this.head;
  41640. this.head = a.next;
  41641. a.elt = null;
  41642. a.next = c.util.ZNPNode_ZPP_Compound.zpp_pool;
  41643. c.util.ZNPNode_ZPP_Compound.zpp_pool = a;
  41644. null == this.head && (this.pushmod = !0);
  41645. this.modified = !0;
  41646. this.length--
  41647. },
  41648. pop: function () {
  41649. this.inlined_pop()
  41650. },
  41651. inlined_insert: function (a, b) {
  41652. var d;
  41653. null == c.util.ZNPNode_ZPP_Compound.zpp_pool ? d = new c.util.ZNPNode_ZPP_Compound : (d = c.util.ZNPNode_ZPP_Compound.zpp_pool, c.util.ZNPNode_ZPP_Compound.zpp_pool = d.next, d.next = null);
  41654. null;
  41655. d.elt = b;
  41656. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  41657. this.pushmod = this.modified = !0;
  41658. this.length++;
  41659. return d
  41660. },
  41661. insert: function (a, b) {
  41662. return this.inlined_insert(a, b)
  41663. },
  41664. addAll: function (a) {
  41665. for (a = a.head; null != a;) this.add(a.elt),
  41666. a = a.next
  41667. },
  41668. inlined_add: function (a) {
  41669. var b;
  41670. null == c.util.ZNPNode_ZPP_Compound.zpp_pool ? b = new c.util.ZNPNode_ZPP_Compound : (b = c.util.ZNPNode_ZPP_Compound.zpp_pool, c.util.ZNPNode_ZPP_Compound.zpp_pool = b.next, b.next = null);
  41671. null;
  41672. b.elt = a;
  41673. b.next = this.head;
  41674. this.head = b;
  41675. this.modified = !0;
  41676. this.length++;
  41677. return a
  41678. },
  41679. add: function (a) {
  41680. return this.inlined_add(a)
  41681. },
  41682. setbegin: function (a) {
  41683. this.head = a;
  41684. this.pushmod = this.modified = !0
  41685. },
  41686. begin: function () {
  41687. return this.head
  41688. },
  41689. __class__: c.util.ZNPList_ZPP_Compound
  41690. };
  41691. c.util.ZNPList_ZPP_Arbiter =
  41692. function () {
  41693. this.length = 0;
  41694. this.modified = this.pushmod = !1;
  41695. this.head = null
  41696. };
  41697. s["zpp_nape.util.ZNPList_ZPP_Arbiter"] = c.util.ZNPList_ZPP_Arbiter;
  41698. c.util.ZNPList_ZPP_Arbiter.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Arbiter"];
  41699. c.util.ZNPList_ZPP_Arbiter.prototype = {
  41700. at: function (a) {
  41701. a = this.iterator_at(a);
  41702. return null != a ? a.elt : null
  41703. },
  41704. iterator_at: function (a) {
  41705. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  41706. return b
  41707. },
  41708. back: function () {
  41709. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  41710. return a.elt
  41711. },
  41712. front: function () {
  41713. return this.head.elt
  41714. },
  41715. inlined_has: function (a) {
  41716. var b;
  41717. b = !1;
  41718. for (var d = this.head; null != d;) {
  41719. if (d.elt == a) {
  41720. b = !0;
  41721. break
  41722. }
  41723. d = d.next
  41724. }
  41725. return b
  41726. },
  41727. has: function (a) {
  41728. return this.inlined_has(a)
  41729. },
  41730. size: function () {
  41731. return this.length
  41732. },
  41733. empty: function () {
  41734. return null == this.head
  41735. },
  41736. reverse: function () {
  41737. for (var a = this.head, b = null; null != a;) {
  41738. var d = a.next;
  41739. a.next = b;
  41740. b = this.head = a;
  41741. a = d
  41742. }
  41743. this.pushmod = this.modified = !0
  41744. },
  41745. inlined_clear: function () {
  41746. for (; null != this.head;) this.inlined_pop();
  41747. this.pushmod = !0
  41748. },
  41749. clear: function () {
  41750. for (; null != this.head;) this.inlined_pop();
  41751. this.pushmod = !0
  41752. },
  41753. splice: function (a, b) {
  41754. for (; 0 < b-- && null != a.next;) this.erase(a);
  41755. return a.next
  41756. },
  41757. inlined_erase: function (a) {
  41758. var b, d;
  41759. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  41760. a = b;
  41761. a.elt = null;
  41762. a.next = c.util.ZNPNode_ZPP_Arbiter.zpp_pool;
  41763. c.util.ZNPNode_ZPP_Arbiter.zpp_pool = a;
  41764. this.modified = !0;
  41765. this.length--;
  41766. this.pushmod = !0;
  41767. return d
  41768. },
  41769. erase: function (a) {
  41770. return this.inlined_erase(a)
  41771. },
  41772. inlined_try_remove: function (a) {
  41773. for (var b = null, d = this.head,
  41774. c = !1; null != d;) {
  41775. if (d.elt == a) {
  41776. this.inlined_erase(b);
  41777. c = !0;
  41778. break
  41779. }
  41780. b = d;
  41781. d = d.next
  41782. }
  41783. return c
  41784. },
  41785. inlined_remove: function (a) {
  41786. this.inlined_try_remove(a)
  41787. },
  41788. try_remove: function (a) {
  41789. for (var b = null, d = this.head, c = !1; null != d;) {
  41790. if (d.elt == a) {
  41791. this.erase(b);
  41792. c = !0;
  41793. break
  41794. }
  41795. b = d;
  41796. d = d.next
  41797. }
  41798. return c
  41799. },
  41800. remove: function (a) {
  41801. this.inlined_try_remove(a)
  41802. },
  41803. inlined_pop_unsafe: function () {
  41804. var a = this.head.elt;
  41805. this.pop();
  41806. return a
  41807. },
  41808. pop_unsafe: function () {
  41809. return this.inlined_pop_unsafe()
  41810. },
  41811. inlined_pop: function () {
  41812. var a = this.head;
  41813. this.head = a.next;
  41814. a.elt =
  41815. null;
  41816. a.next = c.util.ZNPNode_ZPP_Arbiter.zpp_pool;
  41817. c.util.ZNPNode_ZPP_Arbiter.zpp_pool = a;
  41818. null == this.head && (this.pushmod = !0);
  41819. this.modified = !0;
  41820. this.length--
  41821. },
  41822. pop: function () {
  41823. this.inlined_pop()
  41824. },
  41825. inlined_insert: function (a, b) {
  41826. var d;
  41827. null == c.util.ZNPNode_ZPP_Arbiter.zpp_pool ? d = new c.util.ZNPNode_ZPP_Arbiter : (d = c.util.ZNPNode_ZPP_Arbiter.zpp_pool, c.util.ZNPNode_ZPP_Arbiter.zpp_pool = d.next, d.next = null);
  41828. null;
  41829. d.elt = b;
  41830. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  41831. this.pushmod = this.modified = !0;
  41832. this.length++;
  41833. return d
  41834. },
  41835. insert: function (a, b) {
  41836. return this.inlined_insert(a, b)
  41837. },
  41838. addAll: function (a) {
  41839. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  41840. },
  41841. inlined_add: function (a) {
  41842. var b;
  41843. null == c.util.ZNPNode_ZPP_Arbiter.zpp_pool ? b = new c.util.ZNPNode_ZPP_Arbiter : (b = c.util.ZNPNode_ZPP_Arbiter.zpp_pool, c.util.ZNPNode_ZPP_Arbiter.zpp_pool = b.next, b.next = null);
  41844. null;
  41845. b.elt = a;
  41846. b.next = this.head;
  41847. this.head = b;
  41848. this.modified = !0;
  41849. this.length++;
  41850. return a
  41851. },
  41852. add: function (a) {
  41853. return this.inlined_add(a)
  41854. },
  41855. setbegin: function (a) {
  41856. this.head = a;
  41857. this.pushmod =
  41858. this.modified = !0
  41859. },
  41860. begin: function () {
  41861. return this.head
  41862. },
  41863. __class__: c.util.ZNPList_ZPP_Arbiter
  41864. };
  41865. c.util.ZNPList_ZPP_CbSetPair = function () {
  41866. this.length = 0;
  41867. this.modified = this.pushmod = !1;
  41868. this.head = null
  41869. };
  41870. s["zpp_nape.util.ZNPList_ZPP_CbSetPair"] = c.util.ZNPList_ZPP_CbSetPair;
  41871. c.util.ZNPList_ZPP_CbSetPair.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CbSetPair"];
  41872. c.util.ZNPList_ZPP_CbSetPair.prototype = {
  41873. at: function (a) {
  41874. a = this.iterator_at(a);
  41875. return null != a ? a.elt : null
  41876. },
  41877. iterator_at: function (a) {
  41878. for (var b = this.head; 0 < a-- && null !=
  41879. b;) b = b.next;
  41880. return b
  41881. },
  41882. back: function () {
  41883. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  41884. return a.elt
  41885. },
  41886. front: function () {
  41887. return this.head.elt
  41888. },
  41889. inlined_has: function (a) {
  41890. var b;
  41891. b = !1;
  41892. for (var d = this.head; null != d;) {
  41893. if (d.elt == a) {
  41894. b = !0;
  41895. break
  41896. }
  41897. d = d.next
  41898. }
  41899. return b
  41900. },
  41901. has: function (a) {
  41902. return this.inlined_has(a)
  41903. },
  41904. size: function () {
  41905. return this.length
  41906. },
  41907. empty: function () {
  41908. return null == this.head
  41909. },
  41910. reverse: function () {
  41911. for (var a = this.head, b = null; null != a;) {
  41912. var d = a.next;
  41913. a.next = b;
  41914. b = this.head = a;
  41915. a = d
  41916. }
  41917. this.pushmod = this.modified = !0
  41918. },
  41919. inlined_clear: function () {
  41920. for (; null !=
  41921. this.head;) this.inlined_pop();
  41922. this.pushmod = !0
  41923. },
  41924. clear: function () {
  41925. for (; null != this.head;) this.inlined_pop();
  41926. this.pushmod = !0
  41927. },
  41928. splice: function (a, b) {
  41929. for (; 0 < b-- && null != a.next;) this.erase(a);
  41930. return a.next
  41931. },
  41932. inlined_erase: function (a) {
  41933. var b, d;
  41934. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  41935. a = b;
  41936. a.elt = null;
  41937. a.next = c.util.ZNPNode_ZPP_CbSetPair.zpp_pool;
  41938. c.util.ZNPNode_ZPP_CbSetPair.zpp_pool = a;
  41939. this.modified = !0;
  41940. this.length--;
  41941. this.pushmod = !0;
  41942. return d
  41943. },
  41944. erase: function (a) {
  41945. return this.inlined_erase(a)
  41946. },
  41947. inlined_try_remove: function (a) {
  41948. for (var b = null, d = this.head, c = !1; null != d;) {
  41949. if (d.elt == a) {
  41950. this.inlined_erase(b);
  41951. c = !0;
  41952. break
  41953. }
  41954. b = d;
  41955. d = d.next
  41956. }
  41957. return c
  41958. },
  41959. inlined_remove: function (a) {
  41960. this.inlined_try_remove(a)
  41961. },
  41962. try_remove: function (a) {
  41963. for (var b = null, d = this.head, c = !1; null != d;) {
  41964. if (d.elt == a) {
  41965. this.erase(b);
  41966. c = !0;
  41967. break
  41968. }
  41969. b = d;
  41970. d = d.next
  41971. }
  41972. return c
  41973. },
  41974. remove: function (a) {
  41975. this.inlined_try_remove(a)
  41976. },
  41977. inlined_pop_unsafe: function () {
  41978. var a = this.head.elt;
  41979. this.pop();
  41980. return a
  41981. },
  41982. pop_unsafe: function () {
  41983. return this.inlined_pop_unsafe()
  41984. },
  41985. inlined_pop: function () {
  41986. var a = this.head;
  41987. this.head = a.next;
  41988. a.elt = null;
  41989. a.next = c.util.ZNPNode_ZPP_CbSetPair.zpp_pool;
  41990. c.util.ZNPNode_ZPP_CbSetPair.zpp_pool = a;
  41991. null == this.head && (this.pushmod = !0);
  41992. this.modified = !0;
  41993. this.length--
  41994. },
  41995. pop: function () {
  41996. this.inlined_pop()
  41997. },
  41998. inlined_insert: function (a, b) {
  41999. var d;
  42000. null == c.util.ZNPNode_ZPP_CbSetPair.zpp_pool ? d = new c.util.ZNPNode_ZPP_CbSetPair : (d = c.util.ZNPNode_ZPP_CbSetPair.zpp_pool, c.util.ZNPNode_ZPP_CbSetPair.zpp_pool =
  42001. d.next, d.next = null);
  42002. null;
  42003. d.elt = b;
  42004. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  42005. this.pushmod = this.modified = !0;
  42006. this.length++;
  42007. return d
  42008. },
  42009. insert: function (a, b) {
  42010. return this.inlined_insert(a, b)
  42011. },
  42012. addAll: function (a) {
  42013. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  42014. },
  42015. inlined_add: function (a) {
  42016. var b;
  42017. null == c.util.ZNPNode_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZNPNode_ZPP_CbSetPair : (b = c.util.ZNPNode_ZPP_CbSetPair.zpp_pool, c.util.ZNPNode_ZPP_CbSetPair.zpp_pool = b.next, b.next = null);
  42018. null;
  42019. b.elt = a;
  42020. b.next = this.head;
  42021. this.head = b;
  42022. this.modified = !0;
  42023. this.length++;
  42024. return a
  42025. },
  42026. add: function (a) {
  42027. return this.inlined_add(a)
  42028. },
  42029. setbegin: function (a) {
  42030. this.head = a;
  42031. this.pushmod = this.modified = !0
  42032. },
  42033. begin: function () {
  42034. return this.head
  42035. },
  42036. __class__: c.util.ZNPList_ZPP_CbSetPair
  42037. };
  42038. c.util.ZNPList_ZPP_CutInt = function () {
  42039. this.length = 0;
  42040. this.modified = this.pushmod = !1;
  42041. this.head = null
  42042. };
  42043. s["zpp_nape.util.ZNPList_ZPP_CutInt"] = c.util.ZNPList_ZPP_CutInt;
  42044. c.util.ZNPList_ZPP_CutInt.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CutInt"];
  42045. c.util.ZNPList_ZPP_CutInt.prototype = {
  42046. at: function (a) {
  42047. a = this.iterator_at(a);
  42048. return null != a ? a.elt : null
  42049. },
  42050. iterator_at: function (a) {
  42051. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  42052. return b
  42053. },
  42054. back: function () {
  42055. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  42056. return a.elt
  42057. },
  42058. front: function () {
  42059. return this.head.elt
  42060. },
  42061. inlined_has: function (a) {
  42062. var b;
  42063. b = !1;
  42064. for (var d = this.head; null != d;) {
  42065. if (d.elt == a) {
  42066. b = !0;
  42067. break
  42068. }
  42069. d = d.next
  42070. }
  42071. return b
  42072. },
  42073. has: function (a) {
  42074. return this.inlined_has(a)
  42075. },
  42076. size: function () {
  42077. return this.length
  42078. },
  42079. empty: function () {
  42080. return null == this.head
  42081. },
  42082. reverse: function () {
  42083. for (var a =
  42084. this.head, b = null; null != a;) {
  42085. var d = a.next;
  42086. a.next = b;
  42087. b = this.head = a;
  42088. a = d
  42089. }
  42090. this.pushmod = this.modified = !0
  42091. },
  42092. inlined_clear: function () {
  42093. for (; null != this.head;) this.inlined_pop();
  42094. this.pushmod = !0
  42095. },
  42096. clear: function () {
  42097. for (; null != this.head;) this.inlined_pop();
  42098. this.pushmod = !0
  42099. },
  42100. splice: function (a, b) {
  42101. for (; 0 < b-- && null != a.next;) this.erase(a);
  42102. return a.next
  42103. },
  42104. inlined_erase: function (a) {
  42105. var b, d;
  42106. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  42107. a = b;
  42108. a.elt = null;
  42109. a.next = c.util.ZNPNode_ZPP_CutInt.zpp_pool;
  42110. c.util.ZNPNode_ZPP_CutInt.zpp_pool = a;
  42111. this.modified = !0;
  42112. this.length--;
  42113. this.pushmod = !0;
  42114. return d
  42115. },
  42116. erase: function (a) {
  42117. return this.inlined_erase(a)
  42118. },
  42119. inlined_try_remove: function (a) {
  42120. for (var b = null, d = this.head, c = !1; null != d;) {
  42121. if (d.elt == a) {
  42122. this.inlined_erase(b);
  42123. c = !0;
  42124. break
  42125. }
  42126. b = d;
  42127. d = d.next
  42128. }
  42129. return c
  42130. },
  42131. inlined_remove: function (a) {
  42132. this.inlined_try_remove(a)
  42133. },
  42134. try_remove: function (a) {
  42135. for (var b = null, d = this.head, c = !1; null != d;) {
  42136. if (d.elt == a) {
  42137. this.erase(b);
  42138. c = !0;
  42139. break
  42140. }
  42141. b = d;
  42142. d =
  42143. d.next
  42144. }
  42145. return c
  42146. },
  42147. remove: function (a) {
  42148. this.inlined_try_remove(a)
  42149. },
  42150. inlined_pop_unsafe: function () {
  42151. var a = this.head.elt;
  42152. this.pop();
  42153. return a
  42154. },
  42155. pop_unsafe: function () {
  42156. return this.inlined_pop_unsafe()
  42157. },
  42158. inlined_pop: function () {
  42159. var a = this.head;
  42160. this.head = a.next;
  42161. a.elt = null;
  42162. a.next = c.util.ZNPNode_ZPP_CutInt.zpp_pool;
  42163. c.util.ZNPNode_ZPP_CutInt.zpp_pool = a;
  42164. null == this.head && (this.pushmod = !0);
  42165. this.modified = !0;
  42166. this.length--
  42167. },
  42168. pop: function () {
  42169. this.inlined_pop()
  42170. },
  42171. inlined_insert: function (a, b) {
  42172. var d;
  42173. null == c.util.ZNPNode_ZPP_CutInt.zpp_pool ?
  42174. d = new c.util.ZNPNode_ZPP_CutInt : (d = c.util.ZNPNode_ZPP_CutInt.zpp_pool, c.util.ZNPNode_ZPP_CutInt.zpp_pool = d.next, d.next = null);
  42175. null;
  42176. d.elt = b;
  42177. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  42178. this.pushmod = this.modified = !0;
  42179. this.length++;
  42180. return d
  42181. },
  42182. insert: function (a, b) {
  42183. return this.inlined_insert(a, b)
  42184. },
  42185. addAll: function (a) {
  42186. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  42187. },
  42188. inlined_add: function (a) {
  42189. var b;
  42190. null == c.util.ZNPNode_ZPP_CutInt.zpp_pool ? b = new c.util.ZNPNode_ZPP_CutInt : (b = c.util.ZNPNode_ZPP_CutInt.zpp_pool,
  42191. c.util.ZNPNode_ZPP_CutInt.zpp_pool = b.next, b.next = null);
  42192. null;
  42193. b.elt = a;
  42194. b.next = this.head;
  42195. this.head = b;
  42196. this.modified = !0;
  42197. this.length++;
  42198. return a
  42199. },
  42200. add: function (a) {
  42201. return this.inlined_add(a)
  42202. },
  42203. setbegin: function (a) {
  42204. this.head = a;
  42205. this.pushmod = this.modified = !0
  42206. },
  42207. begin: function () {
  42208. return this.head
  42209. },
  42210. __class__: c.util.ZNPList_ZPP_CutInt
  42211. };
  42212. c.util.ZNPList_ZPP_CutVert = function () {
  42213. this.length = 0;
  42214. this.modified = this.pushmod = !1;
  42215. this.head = null
  42216. };
  42217. s["zpp_nape.util.ZNPList_ZPP_CutVert"] = c.util.ZNPList_ZPP_CutVert;
  42218. c.util.ZNPList_ZPP_CutVert.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CutVert"];
  42219. c.util.ZNPList_ZPP_CutVert.prototype = {
  42220. at: function (a) {
  42221. a = this.iterator_at(a);
  42222. return null != a ? a.elt : null
  42223. },
  42224. iterator_at: function (a) {
  42225. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  42226. return b
  42227. },
  42228. back: function () {
  42229. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  42230. return a.elt
  42231. },
  42232. front: function () {
  42233. return this.head.elt
  42234. },
  42235. inlined_has: function (a) {
  42236. var b;
  42237. b = !1;
  42238. for (var d = this.head; null != d;) {
  42239. if (d.elt == a) {
  42240. b = !0;
  42241. break
  42242. }
  42243. d = d.next
  42244. }
  42245. return b
  42246. },
  42247. has: function (a) {
  42248. return this.inlined_has(a)
  42249. },
  42250. size: function () {
  42251. return this.length
  42252. },
  42253. empty: function () {
  42254. return null == this.head
  42255. },
  42256. reverse: function () {
  42257. for (var a = this.head, b = null; null != a;) {
  42258. var d = a.next;
  42259. a.next = b;
  42260. b = this.head = a;
  42261. a = d
  42262. }
  42263. this.pushmod = this.modified = !0
  42264. },
  42265. inlined_clear: function () {
  42266. for (; null != this.head;) this.inlined_pop();
  42267. this.pushmod = !0
  42268. },
  42269. clear: function () {
  42270. for (; null != this.head;) this.inlined_pop();
  42271. this.pushmod = !0
  42272. },
  42273. splice: function (a, b) {
  42274. for (; 0 < b-- && null != a.next;) this.erase(a);
  42275. return a.next
  42276. },
  42277. inlined_erase: function (a) {
  42278. var b, d;
  42279. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  42280. a = b;
  42281. a.elt = null;
  42282. a.next = c.util.ZNPNode_ZPP_CutVert.zpp_pool;
  42283. c.util.ZNPNode_ZPP_CutVert.zpp_pool = a;
  42284. this.modified = !0;
  42285. this.length--;
  42286. this.pushmod = !0;
  42287. return d
  42288. },
  42289. erase: function (a) {
  42290. return this.inlined_erase(a)
  42291. },
  42292. inlined_try_remove: function (a) {
  42293. for (var b = null, d = this.head, c = !1; null != d;) {
  42294. if (d.elt == a) {
  42295. this.inlined_erase(b);
  42296. c = !0;
  42297. break
  42298. }
  42299. b = d;
  42300. d = d.next
  42301. }
  42302. return c
  42303. },
  42304. inlined_remove: function (a) {
  42305. this.inlined_try_remove(a)
  42306. },
  42307. try_remove: function (a) {
  42308. for (var b = null, d = this.head,
  42309. c = !1; null != d;) {
  42310. if (d.elt == a) {
  42311. this.erase(b);
  42312. c = !0;
  42313. break
  42314. }
  42315. b = d;
  42316. d = d.next
  42317. }
  42318. return c
  42319. },
  42320. remove: function (a) {
  42321. this.inlined_try_remove(a)
  42322. },
  42323. inlined_pop_unsafe: function () {
  42324. var a = this.head.elt;
  42325. this.pop();
  42326. return a
  42327. },
  42328. pop_unsafe: function () {
  42329. return this.inlined_pop_unsafe()
  42330. },
  42331. inlined_pop: function () {
  42332. var a = this.head;
  42333. this.head = a.next;
  42334. a.elt = null;
  42335. a.next = c.util.ZNPNode_ZPP_CutVert.zpp_pool;
  42336. c.util.ZNPNode_ZPP_CutVert.zpp_pool = a;
  42337. null == this.head && (this.pushmod = !0);
  42338. this.modified = !0;
  42339. this.length--
  42340. },
  42341. pop: function () {
  42342. this.inlined_pop()
  42343. },
  42344. inlined_insert: function (a,
  42345. b) {
  42346. var d;
  42347. null == c.util.ZNPNode_ZPP_CutVert.zpp_pool ? d = new c.util.ZNPNode_ZPP_CutVert : (d = c.util.ZNPNode_ZPP_CutVert.zpp_pool, c.util.ZNPNode_ZPP_CutVert.zpp_pool = d.next, d.next = null);
  42348. null;
  42349. d.elt = b;
  42350. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  42351. this.pushmod = this.modified = !0;
  42352. this.length++;
  42353. return d
  42354. },
  42355. insert: function (a, b) {
  42356. return this.inlined_insert(a, b)
  42357. },
  42358. addAll: function (a) {
  42359. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  42360. },
  42361. inlined_add: function (a) {
  42362. var b;
  42363. null == c.util.ZNPNode_ZPP_CutVert.zpp_pool ?
  42364. b = new c.util.ZNPNode_ZPP_CutVert : (b = c.util.ZNPNode_ZPP_CutVert.zpp_pool, c.util.ZNPNode_ZPP_CutVert.zpp_pool = b.next, b.next = null);
  42365. null;
  42366. b.elt = a;
  42367. b.next = this.head;
  42368. this.head = b;
  42369. this.modified = !0;
  42370. this.length++;
  42371. return a
  42372. },
  42373. add: function (a) {
  42374. return this.inlined_add(a)
  42375. },
  42376. setbegin: function (a) {
  42377. this.head = a;
  42378. this.pushmod = this.modified = !0
  42379. },
  42380. begin: function () {
  42381. return this.head
  42382. },
  42383. __class__: c.util.ZNPList_ZPP_CutVert
  42384. };
  42385. c.util.ZNPList_ZPP_PartitionVertex = function () {
  42386. this.length = 0;
  42387. this.modified = this.pushmod = !1;
  42388. this.head = null
  42389. };
  42390. s["zpp_nape.util.ZNPList_ZPP_PartitionVertex"] =
  42391. c.util.ZNPList_ZPP_PartitionVertex;
  42392. c.util.ZNPList_ZPP_PartitionVertex.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_PartitionVertex"];
  42393. c.util.ZNPList_ZPP_PartitionVertex.prototype = {
  42394. at: function (a) {
  42395. a = this.iterator_at(a);
  42396. return null != a ? a.elt : null
  42397. },
  42398. iterator_at: function (a) {
  42399. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  42400. return b
  42401. },
  42402. back: function () {
  42403. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  42404. return a.elt
  42405. },
  42406. front: function () {
  42407. return this.head.elt
  42408. },
  42409. inlined_has: function (a) {
  42410. var b;
  42411. b = !1;
  42412. for (var d = this.head; null != d;) {
  42413. if (d.elt ==
  42414. a) {
  42415. b = !0;
  42416. break
  42417. }
  42418. d = d.next
  42419. }
  42420. return b
  42421. },
  42422. has: function (a) {
  42423. return this.inlined_has(a)
  42424. },
  42425. size: function () {
  42426. return this.length
  42427. },
  42428. empty: function () {
  42429. return null == this.head
  42430. },
  42431. reverse: function () {
  42432. for (var a = this.head, b = null; null != a;) {
  42433. var d = a.next;
  42434. a.next = b;
  42435. b = this.head = a;
  42436. a = d
  42437. }
  42438. this.pushmod = this.modified = !0
  42439. },
  42440. inlined_clear: function () {
  42441. for (; null != this.head;) this.inlined_pop();
  42442. this.pushmod = !0
  42443. },
  42444. clear: function () {
  42445. for (; null != this.head;) this.inlined_pop();
  42446. this.pushmod = !0
  42447. },
  42448. splice: function (a, b) {
  42449. for (; 0 < b-- && null != a.next;) this.erase(a);
  42450. return a.next
  42451. },
  42452. inlined_erase: function (a) {
  42453. var b, d;
  42454. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  42455. a = b;
  42456. a.elt = null;
  42457. a.next = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool;
  42458. c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool = a;
  42459. this.modified = !0;
  42460. this.length--;
  42461. this.pushmod = !0;
  42462. return d
  42463. },
  42464. erase: function (a) {
  42465. return this.inlined_erase(a)
  42466. },
  42467. inlined_try_remove: function (a) {
  42468. for (var b = null, d = this.head, c = !1; null != d;) {
  42469. if (d.elt == a) {
  42470. this.inlined_erase(b);
  42471. c = !0;
  42472. break
  42473. }
  42474. b =
  42475. d;
  42476. d = d.next
  42477. }
  42478. return c
  42479. },
  42480. inlined_remove: function (a) {
  42481. this.inlined_try_remove(a)
  42482. },
  42483. try_remove: function (a) {
  42484. for (var b = null, d = this.head, c = !1; null != d;) {
  42485. if (d.elt == a) {
  42486. this.erase(b);
  42487. c = !0;
  42488. break
  42489. }
  42490. b = d;
  42491. d = d.next
  42492. }
  42493. return c
  42494. },
  42495. remove: function (a) {
  42496. this.inlined_try_remove(a)
  42497. },
  42498. inlined_pop_unsafe: function () {
  42499. var a = this.head.elt;
  42500. this.pop();
  42501. return a
  42502. },
  42503. pop_unsafe: function () {
  42504. return this.inlined_pop_unsafe()
  42505. },
  42506. inlined_pop: function () {
  42507. var a = this.head;
  42508. this.head = a.next;
  42509. a.elt = null;
  42510. a.next = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool;
  42511. c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool =
  42512. a;
  42513. null == this.head && (this.pushmod = !0);
  42514. this.modified = !0;
  42515. this.length--
  42516. },
  42517. pop: function () {
  42518. this.inlined_pop()
  42519. },
  42520. inlined_insert: function (a, b) {
  42521. var d;
  42522. null == c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool ? d = new c.util.ZNPNode_ZPP_PartitionVertex : (d = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool, c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool = d.next, d.next = null);
  42523. null;
  42524. d.elt = b;
  42525. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  42526. this.pushmod = this.modified = !0;
  42527. this.length++;
  42528. return d
  42529. },
  42530. insert: function (a, b) {
  42531. return this.inlined_insert(a,
  42532. b)
  42533. },
  42534. addAll: function (a) {
  42535. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  42536. },
  42537. inlined_add: function (a) {
  42538. var b;
  42539. null == c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZNPNode_ZPP_PartitionVertex : (b = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool, c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool = b.next, b.next = null);
  42540. null;
  42541. b.elt = a;
  42542. b.next = this.head;
  42543. this.head = b;
  42544. this.modified = !0;
  42545. this.length++;
  42546. return a
  42547. },
  42548. add: function (a) {
  42549. return this.inlined_add(a)
  42550. },
  42551. setbegin: function (a) {
  42552. this.head = a;
  42553. this.pushmod = this.modified = !0
  42554. },
  42555. begin: function () {
  42556. return this.head
  42557. },
  42558. __class__: c.util.ZNPList_ZPP_PartitionVertex
  42559. };
  42560. c.util.ZNPList_ZPP_PartitionedPoly = function () {
  42561. this.length = 0;
  42562. this.modified = this.pushmod = !1;
  42563. this.head = null
  42564. };
  42565. s["zpp_nape.util.ZNPList_ZPP_PartitionedPoly"] = c.util.ZNPList_ZPP_PartitionedPoly;
  42566. c.util.ZNPList_ZPP_PartitionedPoly.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_PartitionedPoly"];
  42567. c.util.ZNPList_ZPP_PartitionedPoly.prototype = {
  42568. at: function (a) {
  42569. a = this.iterator_at(a);
  42570. return null != a ? a.elt : null
  42571. },
  42572. iterator_at: function (a) {
  42573. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  42574. return b
  42575. },
  42576. back: function () {
  42577. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  42578. return a.elt
  42579. },
  42580. front: function () {
  42581. return this.head.elt
  42582. },
  42583. inlined_has: function (a) {
  42584. var b;
  42585. b = !1;
  42586. for (var d = this.head; null != d;) {
  42587. if (d.elt == a) {
  42588. b = !0;
  42589. break
  42590. }
  42591. d = d.next
  42592. }
  42593. return b
  42594. },
  42595. has: function (a) {
  42596. return this.inlined_has(a)
  42597. },
  42598. size: function () {
  42599. return this.length
  42600. },
  42601. empty: function () {
  42602. return null == this.head
  42603. },
  42604. reverse: function () {
  42605. for (var a = this.head, b = null; null != a;) {
  42606. var d = a.next;
  42607. a.next = b;
  42608. b = this.head = a;
  42609. a = d
  42610. }
  42611. this.pushmod = this.modified = !0
  42612. },
  42613. inlined_clear: function () {
  42614. for (; null !=
  42615. this.head;) this.inlined_pop();
  42616. this.pushmod = !0
  42617. },
  42618. clear: function () {
  42619. for (; null != this.head;) this.inlined_pop();
  42620. this.pushmod = !0
  42621. },
  42622. splice: function (a, b) {
  42623. for (; 0 < b-- && null != a.next;) this.erase(a);
  42624. return a.next
  42625. },
  42626. inlined_erase: function (a) {
  42627. var b, d;
  42628. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  42629. a = b;
  42630. a.elt = null;
  42631. a.next = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool;
  42632. c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool = a;
  42633. this.modified = !0;
  42634. this.length--;
  42635. this.pushmod = !0;
  42636. return d
  42637. },
  42638. erase: function (a) {
  42639. return this.inlined_erase(a)
  42640. },
  42641. inlined_try_remove: function (a) {
  42642. for (var b = null, d = this.head, c = !1; null != d;) {
  42643. if (d.elt == a) {
  42644. this.inlined_erase(b);
  42645. c = !0;
  42646. break
  42647. }
  42648. b = d;
  42649. d = d.next
  42650. }
  42651. return c
  42652. },
  42653. inlined_remove: function (a) {
  42654. this.inlined_try_remove(a)
  42655. },
  42656. try_remove: function (a) {
  42657. for (var b = null, d = this.head, c = !1; null != d;) {
  42658. if (d.elt == a) {
  42659. this.erase(b);
  42660. c = !0;
  42661. break
  42662. }
  42663. b = d;
  42664. d = d.next
  42665. }
  42666. return c
  42667. },
  42668. remove: function (a) {
  42669. this.inlined_try_remove(a)
  42670. },
  42671. inlined_pop_unsafe: function () {
  42672. var a = this.head.elt;
  42673. this.pop();
  42674. return a
  42675. },
  42676. pop_unsafe: function () {
  42677. return this.inlined_pop_unsafe()
  42678. },
  42679. inlined_pop: function () {
  42680. var a = this.head;
  42681. this.head = a.next;
  42682. a.elt = null;
  42683. a.next = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool;
  42684. c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool = a;
  42685. null == this.head && (this.pushmod = !0);
  42686. this.modified = !0;
  42687. this.length--
  42688. },
  42689. pop: function () {
  42690. this.inlined_pop()
  42691. },
  42692. inlined_insert: function (a, b) {
  42693. var d;
  42694. null == c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool ? d = new c.util.ZNPNode_ZPP_PartitionedPoly : (d = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool,
  42695. c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool = d.next, d.next = null);
  42696. null;
  42697. d.elt = b;
  42698. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  42699. this.pushmod = this.modified = !0;
  42700. this.length++;
  42701. return d
  42702. },
  42703. insert: function (a, b) {
  42704. return this.inlined_insert(a, b)
  42705. },
  42706. addAll: function (a) {
  42707. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  42708. },
  42709. inlined_add: function (a) {
  42710. var b;
  42711. null == c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool ? b = new c.util.ZNPNode_ZPP_PartitionedPoly : (b = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool, c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool =
  42712. b.next, b.next = null);
  42713. null;
  42714. b.elt = a;
  42715. b.next = this.head;
  42716. this.head = b;
  42717. this.modified = !0;
  42718. this.length++;
  42719. return a
  42720. },
  42721. add: function (a) {
  42722. return this.inlined_add(a)
  42723. },
  42724. setbegin: function (a) {
  42725. this.head = a;
  42726. this.pushmod = this.modified = !0
  42727. },
  42728. begin: function () {
  42729. return this.head
  42730. },
  42731. __class__: c.util.ZNPList_ZPP_PartitionedPoly
  42732. };
  42733. c.util.ZNPList_ZPP_GeomVert = function () {
  42734. this.length = 0;
  42735. this.modified = this.pushmod = !1;
  42736. this.head = null
  42737. };
  42738. s["zpp_nape.util.ZNPList_ZPP_GeomVert"] = c.util.ZNPList_ZPP_GeomVert;
  42739. c.util.ZNPList_ZPP_GeomVert.__name__ = ["zpp_nape",
  42740. "util", "ZNPList_ZPP_GeomVert"
  42741. ];
  42742. c.util.ZNPList_ZPP_GeomVert.prototype = {
  42743. at: function (a) {
  42744. a = this.iterator_at(a);
  42745. return null != a ? a.elt : null
  42746. },
  42747. iterator_at: function (a) {
  42748. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  42749. return b
  42750. },
  42751. back: function () {
  42752. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  42753. return a.elt
  42754. },
  42755. front: function () {
  42756. return this.head.elt
  42757. },
  42758. inlined_has: function (a) {
  42759. var b;
  42760. b = !1;
  42761. for (var d = this.head; null != d;) {
  42762. if (d.elt == a) {
  42763. b = !0;
  42764. break
  42765. }
  42766. d = d.next
  42767. }
  42768. return b
  42769. },
  42770. has: function (a) {
  42771. return this.inlined_has(a)
  42772. },
  42773. size: function () {
  42774. return this.length
  42775. },
  42776. empty: function () {
  42777. return null == this.head
  42778. },
  42779. reverse: function () {
  42780. for (var a = this.head, b = null; null != a;) {
  42781. var d = a.next;
  42782. a.next = b;
  42783. b = this.head = a;
  42784. a = d
  42785. }
  42786. this.pushmod = this.modified = !0
  42787. },
  42788. inlined_clear: function () {
  42789. for (; null != this.head;) this.inlined_pop();
  42790. this.pushmod = !0
  42791. },
  42792. clear: function () {
  42793. for (; null != this.head;) this.inlined_pop();
  42794. this.pushmod = !0
  42795. },
  42796. splice: function (a, b) {
  42797. for (; 0 < b-- && null != a.next;) this.erase(a);
  42798. return a.next
  42799. },
  42800. inlined_erase: function (a) {
  42801. var b, d;
  42802. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  42803. a = b;
  42804. a.elt = null;
  42805. a.next = c.util.ZNPNode_ZPP_GeomVert.zpp_pool;
  42806. c.util.ZNPNode_ZPP_GeomVert.zpp_pool = a;
  42807. this.modified = !0;
  42808. this.length--;
  42809. this.pushmod = !0;
  42810. return d
  42811. },
  42812. erase: function (a) {
  42813. return this.inlined_erase(a)
  42814. },
  42815. inlined_try_remove: function (a) {
  42816. for (var b = null, d = this.head, c = !1; null != d;) {
  42817. if (d.elt == a) {
  42818. this.inlined_erase(b);
  42819. c = !0;
  42820. break
  42821. }
  42822. b = d;
  42823. d = d.next
  42824. }
  42825. return c
  42826. },
  42827. inlined_remove: function (a) {
  42828. this.inlined_try_remove(a)
  42829. },
  42830. try_remove: function (a) {
  42831. for (var b = null, d =
  42832. this.head, c = !1; null != d;) {
  42833. if (d.elt == a) {
  42834. this.erase(b);
  42835. c = !0;
  42836. break
  42837. }
  42838. b = d;
  42839. d = d.next
  42840. }
  42841. return c
  42842. },
  42843. remove: function (a) {
  42844. this.inlined_try_remove(a)
  42845. },
  42846. inlined_pop_unsafe: function () {
  42847. var a = this.head.elt;
  42848. this.pop();
  42849. return a
  42850. },
  42851. pop_unsafe: function () {
  42852. return this.inlined_pop_unsafe()
  42853. },
  42854. inlined_pop: function () {
  42855. var a = this.head;
  42856. this.head = a.next;
  42857. a.elt = null;
  42858. a.next = c.util.ZNPNode_ZPP_GeomVert.zpp_pool;
  42859. c.util.ZNPNode_ZPP_GeomVert.zpp_pool = a;
  42860. null == this.head && (this.pushmod = !0);
  42861. this.modified = !0;
  42862. this.length--
  42863. },
  42864. pop: function () {
  42865. this.inlined_pop()
  42866. },
  42867. inlined_insert: function (a, b) {
  42868. var d;
  42869. null == c.util.ZNPNode_ZPP_GeomVert.zpp_pool ? d = new c.util.ZNPNode_ZPP_GeomVert : (d = c.util.ZNPNode_ZPP_GeomVert.zpp_pool, c.util.ZNPNode_ZPP_GeomVert.zpp_pool = d.next, d.next = null);
  42870. null;
  42871. d.elt = b;
  42872. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  42873. this.pushmod = this.modified = !0;
  42874. this.length++;
  42875. return d
  42876. },
  42877. insert: function (a, b) {
  42878. return this.inlined_insert(a, b)
  42879. },
  42880. addAll: function (a) {
  42881. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  42882. },
  42883. inlined_add: function (a) {
  42884. var b;
  42885. null == c.util.ZNPNode_ZPP_GeomVert.zpp_pool ?
  42886. b = new c.util.ZNPNode_ZPP_GeomVert : (b = c.util.ZNPNode_ZPP_GeomVert.zpp_pool, c.util.ZNPNode_ZPP_GeomVert.zpp_pool = b.next, b.next = null);
  42887. null;
  42888. b.elt = a;
  42889. b.next = this.head;
  42890. this.head = b;
  42891. this.modified = !0;
  42892. this.length++;
  42893. return a
  42894. },
  42895. add: function (a) {
  42896. return this.inlined_add(a)
  42897. },
  42898. setbegin: function (a) {
  42899. this.head = a;
  42900. this.pushmod = this.modified = !0
  42901. },
  42902. begin: function () {
  42903. return this.head
  42904. },
  42905. __class__: c.util.ZNPList_ZPP_GeomVert
  42906. };
  42907. c.util.ZNPList_ZPP_SimplifyP = function () {
  42908. this.length = 0;
  42909. this.modified = this.pushmod = !1;
  42910. this.head = null
  42911. };
  42912. s["zpp_nape.util.ZNPList_ZPP_SimplifyP"] =
  42913. c.util.ZNPList_ZPP_SimplifyP;
  42914. c.util.ZNPList_ZPP_SimplifyP.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SimplifyP"];
  42915. c.util.ZNPList_ZPP_SimplifyP.prototype = {
  42916. at: function (a) {
  42917. a = this.iterator_at(a);
  42918. return null != a ? a.elt : null
  42919. },
  42920. iterator_at: function (a) {
  42921. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  42922. return b
  42923. },
  42924. back: function () {
  42925. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  42926. return a.elt
  42927. },
  42928. front: function () {
  42929. return this.head.elt
  42930. },
  42931. inlined_has: function (a) {
  42932. var b;
  42933. b = !1;
  42934. for (var d = this.head; null != d;) {
  42935. if (d.elt == a) {
  42936. b = !0;
  42937. break
  42938. }
  42939. d = d.next
  42940. }
  42941. return b
  42942. },
  42943. has: function (a) {
  42944. return this.inlined_has(a)
  42945. },
  42946. size: function () {
  42947. return this.length
  42948. },
  42949. empty: function () {
  42950. return null == this.head
  42951. },
  42952. reverse: function () {
  42953. for (var a = this.head, b = null; null != a;) {
  42954. var d = a.next;
  42955. a.next = b;
  42956. b = this.head = a;
  42957. a = d
  42958. }
  42959. this.pushmod = this.modified = !0
  42960. },
  42961. inlined_clear: function () {
  42962. for (; null != this.head;) this.inlined_pop();
  42963. this.pushmod = !0
  42964. },
  42965. clear: function () {
  42966. for (; null != this.head;) this.inlined_pop();
  42967. this.pushmod = !0
  42968. },
  42969. splice: function (a, b) {
  42970. for (; 0 < b-- && null != a.next;) this.erase(a);
  42971. return a.next
  42972. },
  42973. inlined_erase: function (a) {
  42974. var b,
  42975. d;
  42976. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  42977. a = b;
  42978. a.elt = null;
  42979. a.next = c.util.ZNPNode_ZPP_SimplifyP.zpp_pool;
  42980. c.util.ZNPNode_ZPP_SimplifyP.zpp_pool = a;
  42981. this.modified = !0;
  42982. this.length--;
  42983. this.pushmod = !0;
  42984. return d
  42985. },
  42986. erase: function (a) {
  42987. return this.inlined_erase(a)
  42988. },
  42989. inlined_try_remove: function (a) {
  42990. for (var b = null, d = this.head, c = !1; null != d;) {
  42991. if (d.elt == a) {
  42992. this.inlined_erase(b);
  42993. c = !0;
  42994. break
  42995. }
  42996. b = d;
  42997. d = d.next
  42998. }
  42999. return c
  43000. },
  43001. inlined_remove: function (a) {
  43002. this.inlined_try_remove(a)
  43003. },
  43004. try_remove: function (a) {
  43005. for (var b = null, d = this.head, c = !1; null != d;) {
  43006. if (d.elt == a) {
  43007. this.erase(b);
  43008. c = !0;
  43009. break
  43010. }
  43011. b = d;
  43012. d = d.next
  43013. }
  43014. return c
  43015. },
  43016. remove: function (a) {
  43017. this.inlined_try_remove(a)
  43018. },
  43019. inlined_pop_unsafe: function () {
  43020. var a = this.head.elt;
  43021. this.pop();
  43022. return a
  43023. },
  43024. pop_unsafe: function () {
  43025. return this.inlined_pop_unsafe()
  43026. },
  43027. inlined_pop: function () {
  43028. var a = this.head;
  43029. this.head = a.next;
  43030. a.elt = null;
  43031. a.next = c.util.ZNPNode_ZPP_SimplifyP.zpp_pool;
  43032. c.util.ZNPNode_ZPP_SimplifyP.zpp_pool = a;
  43033. null == this.head && (this.pushmod = !0);
  43034. this.modified = !0;
  43035. this.length--
  43036. },
  43037. pop: function () {
  43038. this.inlined_pop()
  43039. },
  43040. inlined_insert: function (a, b) {
  43041. var d;
  43042. null == c.util.ZNPNode_ZPP_SimplifyP.zpp_pool ? d = new c.util.ZNPNode_ZPP_SimplifyP : (d = c.util.ZNPNode_ZPP_SimplifyP.zpp_pool, c.util.ZNPNode_ZPP_SimplifyP.zpp_pool = d.next, d.next = null);
  43043. null;
  43044. d.elt = b;
  43045. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  43046. this.pushmod = this.modified = !0;
  43047. this.length++;
  43048. return d
  43049. },
  43050. insert: function (a, b) {
  43051. return this.inlined_insert(a, b)
  43052. },
  43053. addAll: function (a) {
  43054. for (a = a.head; null != a;) this.add(a.elt),
  43055. a = a.next
  43056. },
  43057. inlined_add: function (a) {
  43058. var b;
  43059. null == c.util.ZNPNode_ZPP_SimplifyP.zpp_pool ? b = new c.util.ZNPNode_ZPP_SimplifyP : (b = c.util.ZNPNode_ZPP_SimplifyP.zpp_pool, c.util.ZNPNode_ZPP_SimplifyP.zpp_pool = b.next, b.next = null);
  43060. null;
  43061. b.elt = a;
  43062. b.next = this.head;
  43063. this.head = b;
  43064. this.modified = !0;
  43065. this.length++;
  43066. return a
  43067. },
  43068. add: function (a) {
  43069. return this.inlined_add(a)
  43070. },
  43071. setbegin: function (a) {
  43072. this.head = a;
  43073. this.pushmod = this.modified = !0
  43074. },
  43075. begin: function () {
  43076. return this.head
  43077. },
  43078. __class__: c.util.ZNPList_ZPP_SimplifyP
  43079. };
  43080. c.util.ZNPList_ZPP_SimpleVert =
  43081. function () {
  43082. this.length = 0;
  43083. this.modified = this.pushmod = !1;
  43084. this.head = null
  43085. };
  43086. s["zpp_nape.util.ZNPList_ZPP_SimpleVert"] = c.util.ZNPList_ZPP_SimpleVert;
  43087. c.util.ZNPList_ZPP_SimpleVert.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SimpleVert"];
  43088. c.util.ZNPList_ZPP_SimpleVert.prototype = {
  43089. at: function (a) {
  43090. a = this.iterator_at(a);
  43091. return null != a ? a.elt : null
  43092. },
  43093. iterator_at: function (a) {
  43094. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  43095. return b
  43096. },
  43097. back: function () {
  43098. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  43099. return a.elt
  43100. },
  43101. front: function () {
  43102. return this.head.elt
  43103. },
  43104. inlined_has: function (a) {
  43105. var b;
  43106. b = !1;
  43107. for (var d = this.head; null != d;) {
  43108. if (d.elt == a) {
  43109. b = !0;
  43110. break
  43111. }
  43112. d = d.next
  43113. }
  43114. return b
  43115. },
  43116. has: function (a) {
  43117. return this.inlined_has(a)
  43118. },
  43119. size: function () {
  43120. return this.length
  43121. },
  43122. empty: function () {
  43123. return null == this.head
  43124. },
  43125. reverse: function () {
  43126. for (var a = this.head, b = null; null != a;) {
  43127. var d = a.next;
  43128. a.next = b;
  43129. b = this.head = a;
  43130. a = d
  43131. }
  43132. this.pushmod = this.modified = !0
  43133. },
  43134. inlined_clear: function () {
  43135. for (; null != this.head;) this.inlined_pop();
  43136. this.pushmod = !0
  43137. },
  43138. clear: function () {
  43139. for (; null != this.head;) this.inlined_pop();
  43140. this.pushmod = !0
  43141. },
  43142. splice: function (a, b) {
  43143. for (; 0 < b-- && null != a.next;) this.erase(a);
  43144. return a.next
  43145. },
  43146. inlined_erase: function (a) {
  43147. var b, d;
  43148. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  43149. a = b;
  43150. a.elt = null;
  43151. a.next = c.util.ZNPNode_ZPP_SimpleVert.zpp_pool;
  43152. c.util.ZNPNode_ZPP_SimpleVert.zpp_pool = a;
  43153. this.modified = !0;
  43154. this.length--;
  43155. this.pushmod = !0;
  43156. return d
  43157. },
  43158. erase: function (a) {
  43159. return this.inlined_erase(a)
  43160. },
  43161. inlined_try_remove: function (a) {
  43162. for (var b = null, d =
  43163. this.head, c = !1; null != d;) {
  43164. if (d.elt == a) {
  43165. this.inlined_erase(b);
  43166. c = !0;
  43167. break
  43168. }
  43169. b = d;
  43170. d = d.next
  43171. }
  43172. return c
  43173. },
  43174. inlined_remove: function (a) {
  43175. this.inlined_try_remove(a)
  43176. },
  43177. try_remove: function (a) {
  43178. for (var b = null, d = this.head, c = !1; null != d;) {
  43179. if (d.elt == a) {
  43180. this.erase(b);
  43181. c = !0;
  43182. break
  43183. }
  43184. b = d;
  43185. d = d.next
  43186. }
  43187. return c
  43188. },
  43189. remove: function (a) {
  43190. this.inlined_try_remove(a)
  43191. },
  43192. inlined_pop_unsafe: function () {
  43193. var a = this.head.elt;
  43194. this.pop();
  43195. return a
  43196. },
  43197. pop_unsafe: function () {
  43198. return this.inlined_pop_unsafe()
  43199. },
  43200. inlined_pop: function () {
  43201. var a = this.head;
  43202. this.head = a.next;
  43203. a.elt = null;
  43204. a.next = c.util.ZNPNode_ZPP_SimpleVert.zpp_pool;
  43205. c.util.ZNPNode_ZPP_SimpleVert.zpp_pool = a;
  43206. null == this.head && (this.pushmod = !0);
  43207. this.modified = !0;
  43208. this.length--
  43209. },
  43210. pop: function () {
  43211. this.inlined_pop()
  43212. },
  43213. inlined_insert: function (a, b) {
  43214. var d;
  43215. null == c.util.ZNPNode_ZPP_SimpleVert.zpp_pool ? d = new c.util.ZNPNode_ZPP_SimpleVert : (d = c.util.ZNPNode_ZPP_SimpleVert.zpp_pool, c.util.ZNPNode_ZPP_SimpleVert.zpp_pool = d.next, d.next = null);
  43216. null;
  43217. d.elt = b;
  43218. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  43219. this.pushmod =
  43220. this.modified = !0;
  43221. this.length++;
  43222. return d
  43223. },
  43224. insert: function (a, b) {
  43225. return this.inlined_insert(a, b)
  43226. },
  43227. addAll: function (a) {
  43228. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  43229. },
  43230. inlined_add: function (a) {
  43231. var b;
  43232. null == c.util.ZNPNode_ZPP_SimpleVert.zpp_pool ? b = new c.util.ZNPNode_ZPP_SimpleVert : (b = c.util.ZNPNode_ZPP_SimpleVert.zpp_pool, c.util.ZNPNode_ZPP_SimpleVert.zpp_pool = b.next, b.next = null);
  43233. null;
  43234. b.elt = a;
  43235. b.next = this.head;
  43236. this.head = b;
  43237. this.modified = !0;
  43238. this.length++;
  43239. return a
  43240. },
  43241. add: function (a) {
  43242. return this.inlined_add(a)
  43243. },
  43244. setbegin: function (a) {
  43245. this.head = a;
  43246. this.pushmod = this.modified = !0
  43247. },
  43248. begin: function () {
  43249. return this.head
  43250. },
  43251. __class__: c.util.ZNPList_ZPP_SimpleVert
  43252. };
  43253. c.util.ZNPList_ZPP_SimpleEvent = function () {
  43254. this.length = 0;
  43255. this.modified = this.pushmod = !1;
  43256. this.head = null
  43257. };
  43258. s["zpp_nape.util.ZNPList_ZPP_SimpleEvent"] = c.util.ZNPList_ZPP_SimpleEvent;
  43259. c.util.ZNPList_ZPP_SimpleEvent.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SimpleEvent"];
  43260. c.util.ZNPList_ZPP_SimpleEvent.prototype = {
  43261. at: function (a) {
  43262. a = this.iterator_at(a);
  43263. return null != a ? a.elt :
  43264. null
  43265. },
  43266. iterator_at: function (a) {
  43267. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  43268. return b
  43269. },
  43270. back: function () {
  43271. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  43272. return a.elt
  43273. },
  43274. front: function () {
  43275. return this.head.elt
  43276. },
  43277. inlined_has: function (a) {
  43278. var b;
  43279. b = !1;
  43280. for (var d = this.head; null != d;) {
  43281. if (d.elt == a) {
  43282. b = !0;
  43283. break
  43284. }
  43285. d = d.next
  43286. }
  43287. return b
  43288. },
  43289. has: function (a) {
  43290. return this.inlined_has(a)
  43291. },
  43292. size: function () {
  43293. return this.length
  43294. },
  43295. empty: function () {
  43296. return null == this.head
  43297. },
  43298. reverse: function () {
  43299. for (var a = this.head, b = null; null != a;) {
  43300. var d = a.next;
  43301. a.next =
  43302. b;
  43303. b = this.head = a;
  43304. a = d
  43305. }
  43306. this.pushmod = this.modified = !0
  43307. },
  43308. inlined_clear: function () {
  43309. for (; null != this.head;) this.inlined_pop();
  43310. this.pushmod = !0
  43311. },
  43312. clear: function () {
  43313. for (; null != this.head;) this.inlined_pop();
  43314. this.pushmod = !0
  43315. },
  43316. splice: function (a, b) {
  43317. for (; 0 < b-- && null != a.next;) this.erase(a);
  43318. return a.next
  43319. },
  43320. inlined_erase: function (a) {
  43321. var b, d;
  43322. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  43323. a = b;
  43324. a.elt = null;
  43325. a.next = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool;
  43326. c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = a;
  43327. this.modified = !0;
  43328. this.length--;
  43329. this.pushmod = !0;
  43330. return d
  43331. },
  43332. erase: function (a) {
  43333. return this.inlined_erase(a)
  43334. },
  43335. inlined_try_remove: function (a) {
  43336. for (var b = null, d = this.head, c = !1; null != d;) {
  43337. if (d.elt == a) {
  43338. this.inlined_erase(b);
  43339. c = !0;
  43340. break
  43341. }
  43342. b = d;
  43343. d = d.next
  43344. }
  43345. return c
  43346. },
  43347. inlined_remove: function (a) {
  43348. this.inlined_try_remove(a)
  43349. },
  43350. try_remove: function (a) {
  43351. for (var b = null, c = this.head, g = !1; null != c;) {
  43352. if (c.elt == a) {
  43353. this.erase(b);
  43354. g = !0;
  43355. break
  43356. }
  43357. b = c;
  43358. c = c.next
  43359. }
  43360. return g
  43361. },
  43362. remove: function (a) {
  43363. this.inlined_try_remove(a)
  43364. },
  43365. inlined_pop_unsafe: function () {
  43366. var a = this.head.elt;
  43367. this.pop();
  43368. return a
  43369. },
  43370. pop_unsafe: function () {
  43371. return this.inlined_pop_unsafe()
  43372. },
  43373. inlined_pop: function () {
  43374. var a = this.head;
  43375. this.head = a.next;
  43376. a.elt = null;
  43377. a.next = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool;
  43378. c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = a;
  43379. null == this.head && (this.pushmod = !0);
  43380. this.modified = !0;
  43381. this.length--
  43382. },
  43383. pop: function () {
  43384. this.inlined_pop()
  43385. },
  43386. inlined_insert: function (a, b) {
  43387. var d;
  43388. null == c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool ? d = new c.util.ZNPNode_ZPP_SimpleEvent :
  43389. (d = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool, c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = d.next, d.next = null);
  43390. null;
  43391. d.elt = b;
  43392. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  43393. this.pushmod = this.modified = !0;
  43394. this.length++;
  43395. return d
  43396. },
  43397. insert: function (a, b) {
  43398. return this.inlined_insert(a, b)
  43399. },
  43400. addAll: function (a) {
  43401. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  43402. },
  43403. inlined_add: function (a) {
  43404. var b;
  43405. null == c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZNPNode_ZPP_SimpleEvent : (b = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool,
  43406. c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = b.next, b.next = null);
  43407. null;
  43408. b.elt = a;
  43409. b.next = this.head;
  43410. this.head = b;
  43411. this.modified = !0;
  43412. this.length++;
  43413. return a
  43414. },
  43415. add: function (a) {
  43416. return this.inlined_add(a)
  43417. },
  43418. setbegin: function (a) {
  43419. this.head = a;
  43420. this.pushmod = this.modified = !0
  43421. },
  43422. begin: function () {
  43423. return this.head
  43424. },
  43425. __class__: c.util.ZNPList_ZPP_SimpleEvent
  43426. };
  43427. c.util.ZNPList_ZPP_AABBPair = function () {
  43428. this.length = 0;
  43429. this.modified = this.pushmod = !1;
  43430. this.head = null
  43431. };
  43432. s["zpp_nape.util.ZNPList_ZPP_AABBPair"] = c.util.ZNPList_ZPP_AABBPair;
  43433. c.util.ZNPList_ZPP_AABBPair.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_AABBPair"];
  43434. c.util.ZNPList_ZPP_AABBPair.prototype = {
  43435. at: function (a) {
  43436. a = this.iterator_at(a);
  43437. return null != a ? a.elt : null
  43438. },
  43439. iterator_at: function (a) {
  43440. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  43441. return b
  43442. },
  43443. back: function () {
  43444. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  43445. return a.elt
  43446. },
  43447. front: function () {
  43448. return this.head.elt
  43449. },
  43450. inlined_has: function (a) {
  43451. var b;
  43452. b = !1;
  43453. for (var c = this.head; null != c;) {
  43454. if (c.elt == a) {
  43455. b = !0;
  43456. break
  43457. }
  43458. c = c.next
  43459. }
  43460. return b
  43461. },
  43462. has: function (a) {
  43463. return this.inlined_has(a)
  43464. },
  43465. size: function () {
  43466. return this.length
  43467. },
  43468. empty: function () {
  43469. return null == this.head
  43470. },
  43471. reverse: function () {
  43472. for (var a = this.head, b = null; null != a;) {
  43473. var c = a.next;
  43474. a.next = b;
  43475. b = this.head = a;
  43476. a = c
  43477. }
  43478. this.pushmod = this.modified = !0
  43479. },
  43480. inlined_clear: function () {
  43481. for (; null != this.head;) this.inlined_pop();
  43482. this.pushmod = !0
  43483. },
  43484. clear: function () {
  43485. for (; null != this.head;) this.inlined_pop();
  43486. this.pushmod = !0
  43487. },
  43488. splice: function (a, b) {
  43489. for (; 0 < b-- && null != a.next;) this.erase(a);
  43490. return a.next
  43491. },
  43492. inlined_erase: function (a) {
  43493. var b, d;
  43494. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  43495. a = b;
  43496. a.elt = null;
  43497. a.next = c.util.ZNPNode_ZPP_AABBPair.zpp_pool;
  43498. c.util.ZNPNode_ZPP_AABBPair.zpp_pool = a;
  43499. this.modified = !0;
  43500. this.length--;
  43501. this.pushmod = !0;
  43502. return d
  43503. },
  43504. erase: function (a) {
  43505. return this.inlined_erase(a)
  43506. },
  43507. inlined_try_remove: function (a) {
  43508. for (var b = null, c = this.head, g = !1; null != c;) {
  43509. if (c.elt == a) {
  43510. this.inlined_erase(b);
  43511. g = !0;
  43512. break
  43513. }
  43514. b = c;
  43515. c = c.next
  43516. }
  43517. return g
  43518. },
  43519. inlined_remove: function (a) {
  43520. this.inlined_try_remove(a)
  43521. },
  43522. try_remove: function (a) {
  43523. for (var b = null, c =
  43524. this.head, g = !1; null != c;) {
  43525. if (c.elt == a) {
  43526. this.erase(b);
  43527. g = !0;
  43528. break
  43529. }
  43530. b = c;
  43531. c = c.next
  43532. }
  43533. return g
  43534. },
  43535. remove: function (a) {
  43536. this.inlined_try_remove(a)
  43537. },
  43538. inlined_pop_unsafe: function () {
  43539. var a = this.head.elt;
  43540. this.pop();
  43541. return a
  43542. },
  43543. pop_unsafe: function () {
  43544. return this.inlined_pop_unsafe()
  43545. },
  43546. inlined_pop: function () {
  43547. var a = this.head;
  43548. this.head = a.next;
  43549. a.elt = null;
  43550. a.next = c.util.ZNPNode_ZPP_AABBPair.zpp_pool;
  43551. c.util.ZNPNode_ZPP_AABBPair.zpp_pool = a;
  43552. null == this.head && (this.pushmod = !0);
  43553. this.modified = !0;
  43554. this.length--
  43555. },
  43556. pop: function () {
  43557. this.inlined_pop()
  43558. },
  43559. inlined_insert: function (a, b) {
  43560. var d;
  43561. null == c.util.ZNPNode_ZPP_AABBPair.zpp_pool ? d = new c.util.ZNPNode_ZPP_AABBPair : (d = c.util.ZNPNode_ZPP_AABBPair.zpp_pool, c.util.ZNPNode_ZPP_AABBPair.zpp_pool = d.next, d.next = null);
  43562. null;
  43563. d.elt = b;
  43564. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  43565. this.pushmod = this.modified = !0;
  43566. this.length++;
  43567. return d
  43568. },
  43569. insert: function (a, b) {
  43570. return this.inlined_insert(a, b)
  43571. },
  43572. addAll: function (a) {
  43573. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  43574. },
  43575. inlined_add: function (a) {
  43576. var b;
  43577. null == c.util.ZNPNode_ZPP_AABBPair.zpp_pool ?
  43578. b = new c.util.ZNPNode_ZPP_AABBPair : (b = c.util.ZNPNode_ZPP_AABBPair.zpp_pool, c.util.ZNPNode_ZPP_AABBPair.zpp_pool = b.next, b.next = null);
  43579. null;
  43580. b.elt = a;
  43581. b.next = this.head;
  43582. this.head = b;
  43583. this.modified = !0;
  43584. this.length++;
  43585. return a
  43586. },
  43587. add: function (a) {
  43588. return this.inlined_add(a)
  43589. },
  43590. setbegin: function (a) {
  43591. this.head = a;
  43592. this.pushmod = this.modified = !0
  43593. },
  43594. begin: function () {
  43595. return this.head
  43596. },
  43597. __class__: c.util.ZNPList_ZPP_AABBPair
  43598. };
  43599. c.util.ZNPList_ZPP_Edge = function () {
  43600. this.length = 0;
  43601. this.modified = this.pushmod = !1;
  43602. this.head = null
  43603. };
  43604. s["zpp_nape.util.ZNPList_ZPP_Edge"] =
  43605. c.util.ZNPList_ZPP_Edge;
  43606. c.util.ZNPList_ZPP_Edge.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Edge"];
  43607. c.util.ZNPList_ZPP_Edge.prototype = {
  43608. at: function (a) {
  43609. a = this.iterator_at(a);
  43610. return null != a ? a.elt : null
  43611. },
  43612. iterator_at: function (a) {
  43613. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  43614. return b
  43615. },
  43616. back: function () {
  43617. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  43618. return a.elt
  43619. },
  43620. front: function () {
  43621. return this.head.elt
  43622. },
  43623. inlined_has: function (a) {
  43624. var b;
  43625. b = !1;
  43626. for (var c = this.head; null != c;) {
  43627. if (c.elt == a) {
  43628. b = !0;
  43629. break
  43630. }
  43631. c = c.next
  43632. }
  43633. return b
  43634. },
  43635. has: function (a) {
  43636. return this.inlined_has(a)
  43637. },
  43638. size: function () {
  43639. return this.length
  43640. },
  43641. empty: function () {
  43642. return null == this.head
  43643. },
  43644. reverse: function () {
  43645. for (var a = this.head, b = null; null != a;) {
  43646. var c = a.next;
  43647. a.next = b;
  43648. b = this.head = a;
  43649. a = c
  43650. }
  43651. this.pushmod = this.modified = !0
  43652. },
  43653. inlined_clear: function () {
  43654. for (; null != this.head;) this.inlined_pop();
  43655. this.pushmod = !0
  43656. },
  43657. clear: function () {
  43658. for (; null != this.head;) this.inlined_pop();
  43659. this.pushmod = !0
  43660. },
  43661. splice: function (a, b) {
  43662. for (; 0 < b-- && null != a.next;) this.erase(a);
  43663. return a.next
  43664. },
  43665. inlined_erase: function (a) {
  43666. var b, d;
  43667. null == a ? (b = this.head, this.head =
  43668. d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  43669. a = b;
  43670. a.elt = null;
  43671. a.next = c.util.ZNPNode_ZPP_Edge.zpp_pool;
  43672. c.util.ZNPNode_ZPP_Edge.zpp_pool = a;
  43673. this.modified = !0;
  43674. this.length--;
  43675. this.pushmod = !0;
  43676. return d
  43677. },
  43678. erase: function (a) {
  43679. return this.inlined_erase(a)
  43680. },
  43681. inlined_try_remove: function (a) {
  43682. for (var b = null, c = this.head, g = !1; null != c;) {
  43683. if (c.elt == a) {
  43684. this.inlined_erase(b);
  43685. g = !0;
  43686. break
  43687. }
  43688. b = c;
  43689. c = c.next
  43690. }
  43691. return g
  43692. },
  43693. inlined_remove: function (a) {
  43694. this.inlined_try_remove(a)
  43695. },
  43696. try_remove: function (a) {
  43697. for (var b =
  43698. null, c = this.head, g = !1; null != c;) {
  43699. if (c.elt == a) {
  43700. this.erase(b);
  43701. g = !0;
  43702. break
  43703. }
  43704. b = c;
  43705. c = c.next
  43706. }
  43707. return g
  43708. },
  43709. remove: function (a) {
  43710. this.inlined_try_remove(a)
  43711. },
  43712. inlined_pop_unsafe: function () {
  43713. var a = this.head.elt;
  43714. this.pop();
  43715. return a
  43716. },
  43717. pop_unsafe: function () {
  43718. return this.inlined_pop_unsafe()
  43719. },
  43720. inlined_pop: function () {
  43721. var a = this.head;
  43722. this.head = a.next;
  43723. a.elt = null;
  43724. a.next = c.util.ZNPNode_ZPP_Edge.zpp_pool;
  43725. c.util.ZNPNode_ZPP_Edge.zpp_pool = a;
  43726. null == this.head && (this.pushmod = !0);
  43727. this.modified = !0;
  43728. this.length--
  43729. },
  43730. pop: function () {
  43731. this.inlined_pop()
  43732. },
  43733. inlined_insert: function (a, b) {
  43734. var d;
  43735. null == c.util.ZNPNode_ZPP_Edge.zpp_pool ? d = new c.util.ZNPNode_ZPP_Edge : (d = c.util.ZNPNode_ZPP_Edge.zpp_pool, c.util.ZNPNode_ZPP_Edge.zpp_pool = d.next, d.next = null);
  43736. null;
  43737. d.elt = b;
  43738. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  43739. this.pushmod = this.modified = !0;
  43740. this.length++;
  43741. return d
  43742. },
  43743. insert: function (a, b) {
  43744. return this.inlined_insert(a, b)
  43745. },
  43746. addAll: function (a) {
  43747. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  43748. },
  43749. inlined_add: function (a) {
  43750. var b;
  43751. null == c.util.ZNPNode_ZPP_Edge.zpp_pool ?
  43752. b = new c.util.ZNPNode_ZPP_Edge : (b = c.util.ZNPNode_ZPP_Edge.zpp_pool, c.util.ZNPNode_ZPP_Edge.zpp_pool = b.next, b.next = null);
  43753. null;
  43754. b.elt = a;
  43755. b.next = this.head;
  43756. this.head = b;
  43757. this.modified = !0;
  43758. this.length++;
  43759. return a
  43760. },
  43761. add: function (a) {
  43762. return this.inlined_add(a)
  43763. },
  43764. setbegin: function (a) {
  43765. this.head = a;
  43766. this.pushmod = this.modified = !0
  43767. },
  43768. begin: function () {
  43769. return this.head
  43770. },
  43771. __class__: c.util.ZNPList_ZPP_Edge
  43772. };
  43773. c.util.ZNPList_ZPP_Component = function () {
  43774. this.length = 0;
  43775. this.modified = this.pushmod = !1;
  43776. this.head = null
  43777. };
  43778. s["zpp_nape.util.ZNPList_ZPP_Component"] =
  43779. c.util.ZNPList_ZPP_Component;
  43780. c.util.ZNPList_ZPP_Component.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Component"];
  43781. c.util.ZNPList_ZPP_Component.prototype = {
  43782. at: function (a) {
  43783. a = this.iterator_at(a);
  43784. return null != a ? a.elt : null
  43785. },
  43786. iterator_at: function (a) {
  43787. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  43788. return b
  43789. },
  43790. back: function () {
  43791. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  43792. return a.elt
  43793. },
  43794. front: function () {
  43795. return this.head.elt
  43796. },
  43797. inlined_has: function (a) {
  43798. var b;
  43799. b = !1;
  43800. for (var c = this.head; null != c;) {
  43801. if (c.elt == a) {
  43802. b = !0;
  43803. break
  43804. }
  43805. c = c.next
  43806. }
  43807. return b
  43808. },
  43809. has: function (a) {
  43810. return this.inlined_has(a)
  43811. },
  43812. size: function () {
  43813. return this.length
  43814. },
  43815. empty: function () {
  43816. return null == this.head
  43817. },
  43818. reverse: function () {
  43819. for (var a = this.head, b = null; null != a;) {
  43820. var c = a.next;
  43821. a.next = b;
  43822. b = this.head = a;
  43823. a = c
  43824. }
  43825. this.pushmod = this.modified = !0
  43826. },
  43827. inlined_clear: function () {
  43828. for (; null != this.head;) this.inlined_pop();
  43829. this.pushmod = !0
  43830. },
  43831. clear: function () {
  43832. for (; null != this.head;) this.inlined_pop();
  43833. this.pushmod = !0
  43834. },
  43835. splice: function (a, b) {
  43836. for (; 0 < b-- && null != a.next;) this.erase(a);
  43837. return a.next
  43838. },
  43839. inlined_erase: function (a) {
  43840. var b,
  43841. d;
  43842. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  43843. a = b;
  43844. a.elt = null;
  43845. a.next = c.util.ZNPNode_ZPP_Component.zpp_pool;
  43846. c.util.ZNPNode_ZPP_Component.zpp_pool = a;
  43847. this.modified = !0;
  43848. this.length--;
  43849. this.pushmod = !0;
  43850. return d
  43851. },
  43852. erase: function (a) {
  43853. return this.inlined_erase(a)
  43854. },
  43855. inlined_try_remove: function (a) {
  43856. for (var b = null, c = this.head, g = !1; null != c;) {
  43857. if (c.elt == a) {
  43858. this.inlined_erase(b);
  43859. g = !0;
  43860. break
  43861. }
  43862. b = c;
  43863. c = c.next
  43864. }
  43865. return g
  43866. },
  43867. inlined_remove: function (a) {
  43868. this.inlined_try_remove(a)
  43869. },
  43870. try_remove: function (a) {
  43871. for (var b = null, c = this.head, g = !1; null != c;) {
  43872. if (c.elt == a) {
  43873. this.erase(b);
  43874. g = !0;
  43875. break
  43876. }
  43877. b = c;
  43878. c = c.next
  43879. }
  43880. return g
  43881. },
  43882. remove: function (a) {
  43883. this.inlined_try_remove(a)
  43884. },
  43885. inlined_pop_unsafe: function () {
  43886. var a = this.head.elt;
  43887. this.pop();
  43888. return a
  43889. },
  43890. pop_unsafe: function () {
  43891. return this.inlined_pop_unsafe()
  43892. },
  43893. inlined_pop: function () {
  43894. var a = this.head;
  43895. this.head = a.next;
  43896. a.elt = null;
  43897. a.next = c.util.ZNPNode_ZPP_Component.zpp_pool;
  43898. c.util.ZNPNode_ZPP_Component.zpp_pool = a;
  43899. null == this.head && (this.pushmod = !0);
  43900. this.modified = !0;
  43901. this.length--
  43902. },
  43903. pop: function () {
  43904. this.inlined_pop()
  43905. },
  43906. inlined_insert: function (a, b) {
  43907. var d;
  43908. null == c.util.ZNPNode_ZPP_Component.zpp_pool ? d = new c.util.ZNPNode_ZPP_Component : (d = c.util.ZNPNode_ZPP_Component.zpp_pool, c.util.ZNPNode_ZPP_Component.zpp_pool = d.next, d.next = null);
  43909. null;
  43910. d.elt = b;
  43911. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  43912. this.pushmod = this.modified = !0;
  43913. this.length++;
  43914. return d
  43915. },
  43916. insert: function (a, b) {
  43917. return this.inlined_insert(a, b)
  43918. },
  43919. addAll: function (a) {
  43920. for (a = a.head; null != a;) this.add(a.elt),
  43921. a = a.next
  43922. },
  43923. inlined_add: function (a) {
  43924. var b;
  43925. null == c.util.ZNPNode_ZPP_Component.zpp_pool ? b = new c.util.ZNPNode_ZPP_Component : (b = c.util.ZNPNode_ZPP_Component.zpp_pool, c.util.ZNPNode_ZPP_Component.zpp_pool = b.next, b.next = null);
  43926. null;
  43927. b.elt = a;
  43928. b.next = this.head;
  43929. this.head = b;
  43930. this.modified = !0;
  43931. this.length++;
  43932. return a
  43933. },
  43934. add: function (a) {
  43935. return this.inlined_add(a)
  43936. },
  43937. setbegin: function (a) {
  43938. this.head = a;
  43939. this.pushmod = this.modified = !0
  43940. },
  43941. begin: function () {
  43942. return this.head
  43943. },
  43944. __class__: c.util.ZNPList_ZPP_Component
  43945. };
  43946. c.util.ZNPList_ZPP_AABBNode =
  43947. function () {
  43948. this.length = 0;
  43949. this.modified = this.pushmod = !1;
  43950. this.head = null
  43951. };
  43952. s["zpp_nape.util.ZNPList_ZPP_AABBNode"] = c.util.ZNPList_ZPP_AABBNode;
  43953. c.util.ZNPList_ZPP_AABBNode.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_AABBNode"];
  43954. c.util.ZNPList_ZPP_AABBNode.prototype = {
  43955. at: function (a) {
  43956. a = this.iterator_at(a);
  43957. return null != a ? a.elt : null
  43958. },
  43959. iterator_at: function (a) {
  43960. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  43961. return b
  43962. },
  43963. back: function () {
  43964. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  43965. return a.elt
  43966. },
  43967. front: function () {
  43968. return this.head.elt
  43969. },
  43970. inlined_has: function (a) {
  43971. var b;
  43972. b = !1;
  43973. for (var c = this.head; null != c;) {
  43974. if (c.elt == a) {
  43975. b = !0;
  43976. break
  43977. }
  43978. c = c.next
  43979. }
  43980. return b
  43981. },
  43982. has: function (a) {
  43983. return this.inlined_has(a)
  43984. },
  43985. size: function () {
  43986. return this.length
  43987. },
  43988. empty: function () {
  43989. return null == this.head
  43990. },
  43991. reverse: function () {
  43992. for (var a = this.head, b = null; null != a;) {
  43993. var c = a.next;
  43994. a.next = b;
  43995. b = this.head = a;
  43996. a = c
  43997. }
  43998. this.pushmod = this.modified = !0
  43999. },
  44000. inlined_clear: function () {
  44001. for (; null != this.head;) this.inlined_pop();
  44002. this.pushmod = !0
  44003. },
  44004. clear: function () {
  44005. for (; null != this.head;) this.inlined_pop();
  44006. this.pushmod = !0
  44007. },
  44008. splice: function (a, b) {
  44009. for (; 0 < b-- && null != a.next;) this.erase(a);
  44010. return a.next
  44011. },
  44012. inlined_erase: function (a) {
  44013. var b, d;
  44014. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  44015. a = b;
  44016. a.elt = null;
  44017. a.next = c.util.ZNPNode_ZPP_AABBNode.zpp_pool;
  44018. c.util.ZNPNode_ZPP_AABBNode.zpp_pool = a;
  44019. this.modified = !0;
  44020. this.length--;
  44021. this.pushmod = !0;
  44022. return d
  44023. },
  44024. erase: function (a) {
  44025. return this.inlined_erase(a)
  44026. },
  44027. inlined_try_remove: function (a) {
  44028. for (var b = null, c = this.head,
  44029. g = !1; null != c;) {
  44030. if (c.elt == a) {
  44031. this.inlined_erase(b);
  44032. g = !0;
  44033. break
  44034. }
  44035. b = c;
  44036. c = c.next
  44037. }
  44038. return g
  44039. },
  44040. inlined_remove: function (a) {
  44041. this.inlined_try_remove(a)
  44042. },
  44043. try_remove: function (a) {
  44044. for (var b = null, c = this.head, g = !1; null != c;) {
  44045. if (c.elt == a) {
  44046. this.erase(b);
  44047. g = !0;
  44048. break
  44049. }
  44050. b = c;
  44051. c = c.next
  44052. }
  44053. return g
  44054. },
  44055. remove: function (a) {
  44056. this.inlined_try_remove(a)
  44057. },
  44058. inlined_pop_unsafe: function () {
  44059. var a = this.head.elt;
  44060. this.pop();
  44061. return a
  44062. },
  44063. pop_unsafe: function () {
  44064. return this.inlined_pop_unsafe()
  44065. },
  44066. inlined_pop: function () {
  44067. var a = this.head;
  44068. this.head = a.next;
  44069. a.elt =
  44070. null;
  44071. a.next = c.util.ZNPNode_ZPP_AABBNode.zpp_pool;
  44072. c.util.ZNPNode_ZPP_AABBNode.zpp_pool = a;
  44073. null == this.head && (this.pushmod = !0);
  44074. this.modified = !0;
  44075. this.length--
  44076. },
  44077. pop: function () {
  44078. this.inlined_pop()
  44079. },
  44080. inlined_insert: function (a, b) {
  44081. var d;
  44082. null == c.util.ZNPNode_ZPP_AABBNode.zpp_pool ? d = new c.util.ZNPNode_ZPP_AABBNode : (d = c.util.ZNPNode_ZPP_AABBNode.zpp_pool, c.util.ZNPNode_ZPP_AABBNode.zpp_pool = d.next, d.next = null);
  44083. null;
  44084. d.elt = b;
  44085. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  44086. this.pushmod = this.modified = !0;
  44087. this.length++;
  44088. return d
  44089. },
  44090. insert: function (a, b) {
  44091. return this.inlined_insert(a, b)
  44092. },
  44093. addAll: function (a) {
  44094. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  44095. },
  44096. inlined_add: function (a) {
  44097. var b;
  44098. null == c.util.ZNPNode_ZPP_AABBNode.zpp_pool ? b = new c.util.ZNPNode_ZPP_AABBNode : (b = c.util.ZNPNode_ZPP_AABBNode.zpp_pool, c.util.ZNPNode_ZPP_AABBNode.zpp_pool = b.next, b.next = null);
  44099. null;
  44100. b.elt = a;
  44101. b.next = this.head;
  44102. this.head = b;
  44103. this.modified = !0;
  44104. this.length++;
  44105. return a
  44106. },
  44107. add: function (a) {
  44108. return this.inlined_add(a)
  44109. },
  44110. setbegin: function (a) {
  44111. this.head =
  44112. a;
  44113. this.pushmod = this.modified = !0
  44114. },
  44115. begin: function () {
  44116. return this.head
  44117. },
  44118. __class__: c.util.ZNPList_ZPP_AABBNode
  44119. };
  44120. c.util.ZNPList_ZPP_InteractionGroup = function () {
  44121. this.length = 0;
  44122. this.modified = this.pushmod = !1;
  44123. this.head = null
  44124. };
  44125. s["zpp_nape.util.ZNPList_ZPP_InteractionGroup"] = c.util.ZNPList_ZPP_InteractionGroup;
  44126. c.util.ZNPList_ZPP_InteractionGroup.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_InteractionGroup"];
  44127. c.util.ZNPList_ZPP_InteractionGroup.prototype = {
  44128. at: function (a) {
  44129. a = this.iterator_at(a);
  44130. return null != a ? a.elt : null
  44131. },
  44132. iterator_at: function (a) {
  44133. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  44134. return b
  44135. },
  44136. back: function () {
  44137. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  44138. return a.elt
  44139. },
  44140. front: function () {
  44141. return this.head.elt
  44142. },
  44143. inlined_has: function (a) {
  44144. var b;
  44145. b = !1;
  44146. for (var c = this.head; null != c;) {
  44147. if (c.elt == a) {
  44148. b = !0;
  44149. break
  44150. }
  44151. c = c.next
  44152. }
  44153. return b
  44154. },
  44155. has: function (a) {
  44156. return this.inlined_has(a)
  44157. },
  44158. size: function () {
  44159. return this.length
  44160. },
  44161. empty: function () {
  44162. return null == this.head
  44163. },
  44164. reverse: function () {
  44165. for (var a = this.head, b = null; null != a;) {
  44166. var c = a.next;
  44167. a.next = b;
  44168. b = this.head = a;
  44169. a = c
  44170. }
  44171. this.pushmod = this.modified = !0
  44172. },
  44173. inlined_clear: function () {
  44174. for (; null != this.head;) this.inlined_pop();
  44175. this.pushmod = !0
  44176. },
  44177. clear: function () {
  44178. for (; null != this.head;) this.inlined_pop();
  44179. this.pushmod = !0
  44180. },
  44181. splice: function (a, b) {
  44182. for (; 0 < b-- && null != a.next;) this.erase(a);
  44183. return a.next
  44184. },
  44185. inlined_erase: function (a) {
  44186. var b, d;
  44187. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  44188. a = b;
  44189. a.elt = null;
  44190. a.next = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool;
  44191. c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = a;
  44192. this.modified = !0;
  44193. this.length--;
  44194. this.pushmod = !0;
  44195. return d
  44196. },
  44197. erase: function (a) {
  44198. return this.inlined_erase(a)
  44199. },
  44200. inlined_try_remove: function (a) {
  44201. for (var b = null, c = this.head, g = !1; null != c;) {
  44202. if (c.elt == a) {
  44203. this.inlined_erase(b);
  44204. g = !0;
  44205. break
  44206. }
  44207. b = c;
  44208. c = c.next
  44209. }
  44210. return g
  44211. },
  44212. inlined_remove: function (a) {
  44213. this.inlined_try_remove(a)
  44214. },
  44215. try_remove: function (a) {
  44216. for (var b = null, c = this.head, g = !1; null != c;) {
  44217. if (c.elt == a) {
  44218. this.erase(b);
  44219. g = !0;
  44220. break
  44221. }
  44222. b = c;
  44223. c = c.next
  44224. }
  44225. return g
  44226. },
  44227. remove: function (a) {
  44228. this.inlined_try_remove(a)
  44229. },
  44230. inlined_pop_unsafe: function () {
  44231. var a = this.head.elt;
  44232. this.pop();
  44233. return a
  44234. },
  44235. pop_unsafe: function () {
  44236. return this.inlined_pop_unsafe()
  44237. },
  44238. inlined_pop: function () {
  44239. var a = this.head;
  44240. this.head = a.next;
  44241. a.elt = null;
  44242. a.next = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool;
  44243. c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = a;
  44244. null == this.head && (this.pushmod = !0);
  44245. this.modified = !0;
  44246. this.length--
  44247. },
  44248. pop: function () {
  44249. this.inlined_pop()
  44250. },
  44251. inlined_insert: function (a, b) {
  44252. var d;
  44253. null == c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool ? d = new c.util.ZNPNode_ZPP_InteractionGroup :
  44254. (d = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool, c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = d.next, d.next = null);
  44255. null;
  44256. d.elt = b;
  44257. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  44258. this.pushmod = this.modified = !0;
  44259. this.length++;
  44260. return d
  44261. },
  44262. insert: function (a, b) {
  44263. return this.inlined_insert(a, b)
  44264. },
  44265. addAll: function (a) {
  44266. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  44267. },
  44268. inlined_add: function (a) {
  44269. var b;
  44270. null == c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool ? b = new c.util.ZNPNode_ZPP_InteractionGroup : (b = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool,
  44271. c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = b.next, b.next = null);
  44272. null;
  44273. b.elt = a;
  44274. b.next = this.head;
  44275. this.head = b;
  44276. this.modified = !0;
  44277. this.length++;
  44278. return a
  44279. },
  44280. add: function (a) {
  44281. return this.inlined_add(a)
  44282. },
  44283. setbegin: function (a) {
  44284. this.head = a;
  44285. this.pushmod = this.modified = !0
  44286. },
  44287. begin: function () {
  44288. return this.head
  44289. },
  44290. __class__: c.util.ZNPList_ZPP_InteractionGroup
  44291. };
  44292. c.util.ZNPList_ZPP_FluidArbiter = function () {
  44293. this.length = 0;
  44294. this.modified = this.pushmod = !1;
  44295. this.head = null
  44296. };
  44297. s["zpp_nape.util.ZNPList_ZPP_FluidArbiter"] = c.util.ZNPList_ZPP_FluidArbiter;
  44298. c.util.ZNPList_ZPP_FluidArbiter.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_FluidArbiter"];
  44299. c.util.ZNPList_ZPP_FluidArbiter.prototype = {
  44300. at: function (a) {
  44301. a = this.iterator_at(a);
  44302. return null != a ? a.elt : null
  44303. },
  44304. iterator_at: function (a) {
  44305. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  44306. return b
  44307. },
  44308. back: function () {
  44309. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  44310. return a.elt
  44311. },
  44312. front: function () {
  44313. return this.head.elt
  44314. },
  44315. inlined_has: function (a) {
  44316. var b;
  44317. b = !1;
  44318. for (var c = this.head; null != c;) {
  44319. if (c.elt == a) {
  44320. b = !0;
  44321. break
  44322. }
  44323. c = c.next
  44324. }
  44325. return b
  44326. },
  44327. has: function (a) {
  44328. return this.inlined_has(a)
  44329. },
  44330. size: function () {
  44331. return this.length
  44332. },
  44333. empty: function () {
  44334. return null == this.head
  44335. },
  44336. reverse: function () {
  44337. for (var a = this.head, b = null; null != a;) {
  44338. var c = a.next;
  44339. a.next = b;
  44340. b = this.head = a;
  44341. a = c
  44342. }
  44343. this.pushmod = this.modified = !0
  44344. },
  44345. inlined_clear: function () {
  44346. for (; null != this.head;) this.inlined_pop();
  44347. this.pushmod = !0
  44348. },
  44349. clear: function () {
  44350. for (; null != this.head;) this.inlined_pop();
  44351. this.pushmod = !0
  44352. },
  44353. splice: function (a, b) {
  44354. for (; 0 < b-- && null != a.next;) this.erase(a);
  44355. return a.next
  44356. },
  44357. inlined_erase: function (a) {
  44358. var b, d;
  44359. null == a ? (b = this.head, this.head =
  44360. d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  44361. a = b;
  44362. a.elt = null;
  44363. a.next = c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool;
  44364. c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool = a;
  44365. this.modified = !0;
  44366. this.length--;
  44367. this.pushmod = !0;
  44368. return d
  44369. },
  44370. erase: function (a) {
  44371. return this.inlined_erase(a)
  44372. },
  44373. inlined_try_remove: function (a) {
  44374. for (var b = null, c = this.head, g = !1; null != c;) {
  44375. if (c.elt == a) {
  44376. this.inlined_erase(b);
  44377. g = !0;
  44378. break
  44379. }
  44380. b = c;
  44381. c = c.next
  44382. }
  44383. return g
  44384. },
  44385. inlined_remove: function (a) {
  44386. this.inlined_try_remove(a)
  44387. },
  44388. try_remove: function (a) {
  44389. for (var b = null, c = this.head, g = !1; null != c;) {
  44390. if (c.elt == a) {
  44391. this.erase(b);
  44392. g = !0;
  44393. break
  44394. }
  44395. b = c;
  44396. c = c.next
  44397. }
  44398. return g
  44399. },
  44400. remove: function (a) {
  44401. this.inlined_try_remove(a)
  44402. },
  44403. inlined_pop_unsafe: function () {
  44404. var a = this.head.elt;
  44405. this.pop();
  44406. return a
  44407. },
  44408. pop_unsafe: function () {
  44409. return this.inlined_pop_unsafe()
  44410. },
  44411. inlined_pop: function () {
  44412. var a = this.head;
  44413. this.head = a.next;
  44414. a.elt = null;
  44415. a.next = c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool;
  44416. c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool = a;
  44417. null == this.head && (this.pushmod = !0);
  44418. this.modified = !0;
  44419. this.length--
  44420. },
  44421. pop: function () {
  44422. this.inlined_pop()
  44423. },
  44424. inlined_insert: function (a, b) {
  44425. var d;
  44426. null == c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool ? d = new c.util.ZNPNode_ZPP_FluidArbiter : (d = c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool, c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool = d.next, d.next = null);
  44427. null;
  44428. d.elt = b;
  44429. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  44430. this.pushmod = this.modified = !0;
  44431. this.length++;
  44432. return d
  44433. },
  44434. insert: function (a, b) {
  44435. return this.inlined_insert(a, b)
  44436. },
  44437. addAll: function (a) {
  44438. for (a = a.head; null !=
  44439. a;) this.add(a.elt), a = a.next
  44440. },
  44441. inlined_add: function (a) {
  44442. var b;
  44443. null == c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool ? b = new c.util.ZNPNode_ZPP_FluidArbiter : (b = c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool, c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool = b.next, b.next = null);
  44444. null;
  44445. b.elt = a;
  44446. b.next = this.head;
  44447. this.head = b;
  44448. this.modified = !0;
  44449. this.length++;
  44450. return a
  44451. },
  44452. add: function (a) {
  44453. return this.inlined_add(a)
  44454. },
  44455. setbegin: function (a) {
  44456. this.head = a;
  44457. this.pushmod = this.modified = !0
  44458. },
  44459. begin: function () {
  44460. return this.head
  44461. },
  44462. __class__: c.util.ZNPList_ZPP_FluidArbiter
  44463. };
  44464. c.util.ZNPList_ZPP_SensorArbiter = function () {
  44465. this.length = 0;
  44466. this.modified = this.pushmod = !1;
  44467. this.head = null
  44468. };
  44469. s["zpp_nape.util.ZNPList_ZPP_SensorArbiter"] = c.util.ZNPList_ZPP_SensorArbiter;
  44470. c.util.ZNPList_ZPP_SensorArbiter.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SensorArbiter"];
  44471. c.util.ZNPList_ZPP_SensorArbiter.prototype = {
  44472. at: function (a) {
  44473. a = this.iterator_at(a);
  44474. return null != a ? a.elt : null
  44475. },
  44476. iterator_at: function (a) {
  44477. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  44478. return b
  44479. },
  44480. back: function () {
  44481. for (var a = this.head, b = a; null !=
  44482. b;) a = b, b = b.next;
  44483. return a.elt
  44484. },
  44485. front: function () {
  44486. return this.head.elt
  44487. },
  44488. inlined_has: function (a) {
  44489. var b;
  44490. b = !1;
  44491. for (var c = this.head; null != c;) {
  44492. if (c.elt == a) {
  44493. b = !0;
  44494. break
  44495. }
  44496. c = c.next
  44497. }
  44498. return b
  44499. },
  44500. has: function (a) {
  44501. return this.inlined_has(a)
  44502. },
  44503. size: function () {
  44504. return this.length
  44505. },
  44506. empty: function () {
  44507. return null == this.head
  44508. },
  44509. reverse: function () {
  44510. for (var a = this.head, b = null; null != a;) {
  44511. var c = a.next;
  44512. a.next = b;
  44513. b = this.head = a;
  44514. a = c
  44515. }
  44516. this.pushmod = this.modified = !0
  44517. },
  44518. inlined_clear: function () {
  44519. for (; null != this.head;) this.inlined_pop();
  44520. this.pushmod = !0
  44521. },
  44522. clear: function () {
  44523. for (; null != this.head;) this.inlined_pop();
  44524. this.pushmod = !0
  44525. },
  44526. splice: function (a, b) {
  44527. for (; 0 < b-- && null != a.next;) this.erase(a);
  44528. return a.next
  44529. },
  44530. inlined_erase: function (a) {
  44531. var b, d;
  44532. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  44533. a = b;
  44534. a.elt = null;
  44535. a.next = c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool;
  44536. c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool = a;
  44537. this.modified = !0;
  44538. this.length--;
  44539. this.pushmod = !0;
  44540. return d
  44541. },
  44542. erase: function (a) {
  44543. return this.inlined_erase(a)
  44544. },
  44545. inlined_try_remove: function (a) {
  44546. for (var b = null, c = this.head, g = !1; null != c;) {
  44547. if (c.elt == a) {
  44548. this.inlined_erase(b);
  44549. g = !0;
  44550. break
  44551. }
  44552. b = c;
  44553. c = c.next
  44554. }
  44555. return g
  44556. },
  44557. inlined_remove: function (a) {
  44558. this.inlined_try_remove(a)
  44559. },
  44560. try_remove: function (a) {
  44561. for (var b = null, c = this.head, g = !1; null != c;) {
  44562. if (c.elt == a) {
  44563. this.erase(b);
  44564. g = !0;
  44565. break
  44566. }
  44567. b = c;
  44568. c = c.next
  44569. }
  44570. return g
  44571. },
  44572. remove: function (a) {
  44573. this.inlined_try_remove(a)
  44574. },
  44575. inlined_pop_unsafe: function () {
  44576. var a = this.head.elt;
  44577. this.pop();
  44578. return a
  44579. },
  44580. pop_unsafe: function () {
  44581. return this.inlined_pop_unsafe()
  44582. },
  44583. inlined_pop: function () {
  44584. var a =
  44585. this.head;
  44586. this.head = a.next;
  44587. a.elt = null;
  44588. a.next = c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool;
  44589. c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool = a;
  44590. null == this.head && (this.pushmod = !0);
  44591. this.modified = !0;
  44592. this.length--
  44593. },
  44594. pop: function () {
  44595. this.inlined_pop()
  44596. },
  44597. inlined_insert: function (a, b) {
  44598. var d;
  44599. null == c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool ? d = new c.util.ZNPNode_ZPP_SensorArbiter : (d = c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool, c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool = d.next, d.next = null);
  44600. null;
  44601. d.elt = b;
  44602. null == a ? (d.next = this.head,
  44603. this.head = d) : (d.next = a.next, a.next = d);
  44604. this.pushmod = this.modified = !0;
  44605. this.length++;
  44606. return d
  44607. },
  44608. insert: function (a, b) {
  44609. return this.inlined_insert(a, b)
  44610. },
  44611. addAll: function (a) {
  44612. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  44613. },
  44614. inlined_add: function (a) {
  44615. var b;
  44616. null == c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool ? b = new c.util.ZNPNode_ZPP_SensorArbiter : (b = c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool, c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool = b.next, b.next = null);
  44617. null;
  44618. b.elt = a;
  44619. b.next = this.head;
  44620. this.head = b;
  44621. this.modified = !0;
  44622. this.length++;
  44623. return a
  44624. },
  44625. add: function (a) {
  44626. return this.inlined_add(a)
  44627. },
  44628. setbegin: function (a) {
  44629. this.head = a;
  44630. this.pushmod = this.modified = !0
  44631. },
  44632. begin: function () {
  44633. return this.head
  44634. },
  44635. __class__: c.util.ZNPList_ZPP_SensorArbiter
  44636. };
  44637. c.util.ZNPList_ZPP_Listener = function () {
  44638. this.length = 0;
  44639. this.modified = this.pushmod = !1;
  44640. this.head = null
  44641. };
  44642. s["zpp_nape.util.ZNPList_ZPP_Listener"] = c.util.ZNPList_ZPP_Listener;
  44643. c.util.ZNPList_ZPP_Listener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Listener"];
  44644. c.util.ZNPList_ZPP_Listener.prototype = {
  44645. at: function (a) {
  44646. a = this.iterator_at(a);
  44647. return null != a ? a.elt : null
  44648. },
  44649. iterator_at: function (a) {
  44650. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  44651. return b
  44652. },
  44653. back: function () {
  44654. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  44655. return a.elt
  44656. },
  44657. front: function () {
  44658. return this.head.elt
  44659. },
  44660. inlined_has: function (a) {
  44661. var b;
  44662. b = !1;
  44663. for (var c = this.head; null != c;) {
  44664. if (c.elt == a) {
  44665. b = !0;
  44666. break
  44667. }
  44668. c = c.next
  44669. }
  44670. return b
  44671. },
  44672. has: function (a) {
  44673. return this.inlined_has(a)
  44674. },
  44675. size: function () {
  44676. return this.length
  44677. },
  44678. empty: function () {
  44679. return null == this.head
  44680. },
  44681. reverse: function () {
  44682. for (var a = this.head, b = null; null !=
  44683. a;) {
  44684. var c = a.next;
  44685. a.next = b;
  44686. b = this.head = a;
  44687. a = c
  44688. }
  44689. this.pushmod = this.modified = !0
  44690. },
  44691. inlined_clear: function () {
  44692. for (; null != this.head;) this.inlined_pop();
  44693. this.pushmod = !0
  44694. },
  44695. clear: function () {
  44696. for (; null != this.head;) this.inlined_pop();
  44697. this.pushmod = !0
  44698. },
  44699. splice: function (a, b) {
  44700. for (; 0 < b-- && null != a.next;) this.erase(a);
  44701. return a.next
  44702. },
  44703. inlined_erase: function (a) {
  44704. var b, d;
  44705. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  44706. a = b;
  44707. a.elt = null;
  44708. a.next = c.util.ZNPNode_ZPP_Listener.zpp_pool;
  44709. c.util.ZNPNode_ZPP_Listener.zpp_pool = a;
  44710. this.modified = !0;
  44711. this.length--;
  44712. this.pushmod = !0;
  44713. return d
  44714. },
  44715. erase: function (a) {
  44716. return this.inlined_erase(a)
  44717. },
  44718. inlined_try_remove: function (a) {
  44719. for (var b = null, c = this.head, g = !1; null != c;) {
  44720. if (c.elt == a) {
  44721. this.inlined_erase(b);
  44722. g = !0;
  44723. break
  44724. }
  44725. b = c;
  44726. c = c.next
  44727. }
  44728. return g
  44729. },
  44730. inlined_remove: function (a) {
  44731. this.inlined_try_remove(a)
  44732. },
  44733. try_remove: function (a) {
  44734. for (var b = null, c = this.head, g = !1; null != c;) {
  44735. if (c.elt == a) {
  44736. this.erase(b);
  44737. g = !0;
  44738. break
  44739. }
  44740. b = c;
  44741. c = c.next
  44742. }
  44743. return g
  44744. },
  44745. remove: function (a) {
  44746. this.inlined_try_remove(a)
  44747. },
  44748. inlined_pop_unsafe: function () {
  44749. var a = this.head.elt;
  44750. this.pop();
  44751. return a
  44752. },
  44753. pop_unsafe: function () {
  44754. return this.inlined_pop_unsafe()
  44755. },
  44756. inlined_pop: function () {
  44757. var a = this.head;
  44758. this.head = a.next;
  44759. a.elt = null;
  44760. a.next = c.util.ZNPNode_ZPP_Listener.zpp_pool;
  44761. c.util.ZNPNode_ZPP_Listener.zpp_pool = a;
  44762. null == this.head && (this.pushmod = !0);
  44763. this.modified = !0;
  44764. this.length--
  44765. },
  44766. pop: function () {
  44767. this.inlined_pop()
  44768. },
  44769. inlined_insert: function (a, b) {
  44770. var d;
  44771. null == c.util.ZNPNode_ZPP_Listener.zpp_pool ? d = new c.util.ZNPNode_ZPP_Listener : (d = c.util.ZNPNode_ZPP_Listener.zpp_pool,
  44772. c.util.ZNPNode_ZPP_Listener.zpp_pool = d.next, d.next = null);
  44773. null;
  44774. d.elt = b;
  44775. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  44776. this.pushmod = this.modified = !0;
  44777. this.length++;
  44778. return d
  44779. },
  44780. insert: function (a, b) {
  44781. return this.inlined_insert(a, b)
  44782. },
  44783. addAll: function (a) {
  44784. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  44785. },
  44786. inlined_add: function (a) {
  44787. var b;
  44788. null == c.util.ZNPNode_ZPP_Listener.zpp_pool ? b = new c.util.ZNPNode_ZPP_Listener : (b = c.util.ZNPNode_ZPP_Listener.zpp_pool, c.util.ZNPNode_ZPP_Listener.zpp_pool = b.next, b.next =
  44789. null);
  44790. null;
  44791. b.elt = a;
  44792. b.next = this.head;
  44793. this.head = b;
  44794. this.modified = !0;
  44795. this.length++;
  44796. return a
  44797. },
  44798. add: function (a) {
  44799. return this.inlined_add(a)
  44800. },
  44801. setbegin: function (a) {
  44802. this.head = a;
  44803. this.pushmod = this.modified = !0
  44804. },
  44805. begin: function () {
  44806. return this.head
  44807. },
  44808. __class__: c.util.ZNPList_ZPP_Listener
  44809. };
  44810. c.util.ZNPList_ZPP_ColArbiter = function () {
  44811. this.length = 0;
  44812. this.modified = this.pushmod = !1;
  44813. this.head = null
  44814. };
  44815. s["zpp_nape.util.ZNPList_ZPP_ColArbiter"] = c.util.ZNPList_ZPP_ColArbiter;
  44816. c.util.ZNPList_ZPP_ColArbiter.__name__ = ["zpp_nape", "util",
  44817. "ZNPList_ZPP_ColArbiter"
  44818. ];
  44819. c.util.ZNPList_ZPP_ColArbiter.prototype = {
  44820. at: function (a) {
  44821. a = this.iterator_at(a);
  44822. return null != a ? a.elt : null
  44823. },
  44824. iterator_at: function (a) {
  44825. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  44826. return b
  44827. },
  44828. back: function () {
  44829. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  44830. return a.elt
  44831. },
  44832. front: function () {
  44833. return this.head.elt
  44834. },
  44835. inlined_has: function (a) {
  44836. var b;
  44837. b = !1;
  44838. for (var c = this.head; null != c;) {
  44839. if (c.elt == a) {
  44840. b = !0;
  44841. break
  44842. }
  44843. c = c.next
  44844. }
  44845. return b
  44846. },
  44847. has: function (a) {
  44848. return this.inlined_has(a)
  44849. },
  44850. size: function () {
  44851. return this.length
  44852. },
  44853. empty: function () {
  44854. return null == this.head
  44855. },
  44856. reverse: function () {
  44857. for (var a = this.head, b = null; null != a;) {
  44858. var c = a.next;
  44859. a.next = b;
  44860. b = this.head = a;
  44861. a = c
  44862. }
  44863. this.pushmod = this.modified = !0
  44864. },
  44865. inlined_clear: function () {
  44866. for (; null != this.head;) this.inlined_pop();
  44867. this.pushmod = !0
  44868. },
  44869. clear: function () {
  44870. for (; null != this.head;) this.inlined_pop();
  44871. this.pushmod = !0
  44872. },
  44873. splice: function (a, b) {
  44874. for (; 0 < b-- && null != a.next;) this.erase(a);
  44875. return a.next
  44876. },
  44877. inlined_erase: function (a) {
  44878. var b, d;
  44879. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  44880. a = b;
  44881. a.elt = null;
  44882. a.next = c.util.ZNPNode_ZPP_ColArbiter.zpp_pool;
  44883. c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = a;
  44884. this.modified = !0;
  44885. this.length--;
  44886. this.pushmod = !0;
  44887. return d
  44888. },
  44889. erase: function (a) {
  44890. return this.inlined_erase(a)
  44891. },
  44892. inlined_try_remove: function (a) {
  44893. for (var b = null, c = this.head, g = !1; null != c;) {
  44894. if (c.elt == a) {
  44895. this.inlined_erase(b);
  44896. g = !0;
  44897. break
  44898. }
  44899. b = c;
  44900. c = c.next
  44901. }
  44902. return g
  44903. },
  44904. inlined_remove: function (a) {
  44905. this.inlined_try_remove(a)
  44906. },
  44907. try_remove: function (a) {
  44908. for (var b = null,
  44909. c = this.head, g = !1; null != c;) {
  44910. if (c.elt == a) {
  44911. this.erase(b);
  44912. g = !0;
  44913. break
  44914. }
  44915. b = c;
  44916. c = c.next
  44917. }
  44918. return g
  44919. },
  44920. remove: function (a) {
  44921. this.inlined_try_remove(a)
  44922. },
  44923. inlined_pop_unsafe: function () {
  44924. var a = this.head.elt;
  44925. this.pop();
  44926. return a
  44927. },
  44928. pop_unsafe: function () {
  44929. return this.inlined_pop_unsafe()
  44930. },
  44931. inlined_pop: function () {
  44932. var a = this.head;
  44933. this.head = a.next;
  44934. a.elt = null;
  44935. a.next = c.util.ZNPNode_ZPP_ColArbiter.zpp_pool;
  44936. c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = a;
  44937. null == this.head && (this.pushmod = !0);
  44938. this.modified = !0;
  44939. this.length--
  44940. },
  44941. pop: function () {
  44942. this.inlined_pop()
  44943. },
  44944. inlined_insert: function (a, b) {
  44945. var d;
  44946. null == c.util.ZNPNode_ZPP_ColArbiter.zpp_pool ? d = new c.util.ZNPNode_ZPP_ColArbiter : (d = c.util.ZNPNode_ZPP_ColArbiter.zpp_pool, c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = d.next, d.next = null);
  44947. null;
  44948. d.elt = b;
  44949. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  44950. this.pushmod = this.modified = !0;
  44951. this.length++;
  44952. return d
  44953. },
  44954. insert: function (a, b) {
  44955. return this.inlined_insert(a, b)
  44956. },
  44957. addAll: function (a) {
  44958. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  44959. },
  44960. inlined_add: function (a) {
  44961. var b;
  44962. null ==
  44963. c.util.ZNPNode_ZPP_ColArbiter.zpp_pool ? b = new c.util.ZNPNode_ZPP_ColArbiter : (b = c.util.ZNPNode_ZPP_ColArbiter.zpp_pool, c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = b.next, b.next = null);
  44964. null;
  44965. b.elt = a;
  44966. b.next = this.head;
  44967. this.head = b;
  44968. this.modified = !0;
  44969. this.length++;
  44970. return a
  44971. },
  44972. add: function (a) {
  44973. return this.inlined_add(a)
  44974. },
  44975. setbegin: function (a) {
  44976. this.head = a;
  44977. this.pushmod = this.modified = !0
  44978. },
  44979. begin: function () {
  44980. return this.head
  44981. },
  44982. __class__: c.util.ZNPList_ZPP_ColArbiter
  44983. };
  44984. c.util.ZNPList_ZPP_ToiEvent = function () {
  44985. this.length = 0;
  44986. this.modified =
  44987. this.pushmod = !1;
  44988. this.head = null
  44989. };
  44990. s["zpp_nape.util.ZNPList_ZPP_ToiEvent"] = c.util.ZNPList_ZPP_ToiEvent;
  44991. c.util.ZNPList_ZPP_ToiEvent.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_ToiEvent"];
  44992. c.util.ZNPList_ZPP_ToiEvent.prototype = {
  44993. at: function (a) {
  44994. a = this.iterator_at(a);
  44995. return null != a ? a.elt : null
  44996. },
  44997. iterator_at: function (a) {
  44998. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  44999. return b
  45000. },
  45001. back: function () {
  45002. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  45003. return a.elt
  45004. },
  45005. front: function () {
  45006. return this.head.elt
  45007. },
  45008. inlined_has: function (a) {
  45009. var b;
  45010. b = !1;
  45011. for (var c = this.head; null != c;) {
  45012. if (c.elt == a) {
  45013. b = !0;
  45014. break
  45015. }
  45016. c = c.next
  45017. }
  45018. return b
  45019. },
  45020. has: function (a) {
  45021. return this.inlined_has(a)
  45022. },
  45023. size: function () {
  45024. return this.length
  45025. },
  45026. empty: function () {
  45027. return null == this.head
  45028. },
  45029. reverse: function () {
  45030. for (var a = this.head, b = null; null != a;) {
  45031. var c = a.next;
  45032. a.next = b;
  45033. b = this.head = a;
  45034. a = c
  45035. }
  45036. this.pushmod = this.modified = !0
  45037. },
  45038. inlined_clear: function () {
  45039. for (; null != this.head;) this.inlined_pop();
  45040. this.pushmod = !0
  45041. },
  45042. clear: function () {
  45043. for (; null != this.head;) this.inlined_pop();
  45044. this.pushmod = !0
  45045. },
  45046. splice: function (a,
  45047. b) {
  45048. for (; 0 < b-- && null != a.next;) this.erase(a);
  45049. return a.next
  45050. },
  45051. inlined_erase: function (a) {
  45052. var b, d;
  45053. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  45054. a = b;
  45055. a.elt = null;
  45056. a.next = c.util.ZNPNode_ZPP_ToiEvent.zpp_pool;
  45057. c.util.ZNPNode_ZPP_ToiEvent.zpp_pool = a;
  45058. this.modified = !0;
  45059. this.length--;
  45060. this.pushmod = !0;
  45061. return d
  45062. },
  45063. erase: function (a) {
  45064. return this.inlined_erase(a)
  45065. },
  45066. inlined_try_remove: function (a) {
  45067. for (var b = null, c = this.head, g = !1; null != c;) {
  45068. if (c.elt ==
  45069. a) {
  45070. this.inlined_erase(b);
  45071. g = !0;
  45072. break
  45073. }
  45074. b = c;
  45075. c = c.next
  45076. }
  45077. return g
  45078. },
  45079. inlined_remove: function (a) {
  45080. this.inlined_try_remove(a)
  45081. },
  45082. try_remove: function (a) {
  45083. for (var b = null, c = this.head, g = !1; null != c;) {
  45084. if (c.elt == a) {
  45085. this.erase(b);
  45086. g = !0;
  45087. break
  45088. }
  45089. b = c;
  45090. c = c.next
  45091. }
  45092. return g
  45093. },
  45094. remove: function (a) {
  45095. this.inlined_try_remove(a)
  45096. },
  45097. inlined_pop_unsafe: function () {
  45098. var a = this.head.elt;
  45099. this.pop();
  45100. return a
  45101. },
  45102. pop_unsafe: function () {
  45103. return this.inlined_pop_unsafe()
  45104. },
  45105. inlined_pop: function () {
  45106. var a = this.head;
  45107. this.head = a.next;
  45108. a.elt = null;
  45109. a.next = c.util.ZNPNode_ZPP_ToiEvent.zpp_pool;
  45110. c.util.ZNPNode_ZPP_ToiEvent.zpp_pool = a;
  45111. null == this.head && (this.pushmod = !0);
  45112. this.modified = !0;
  45113. this.length--
  45114. },
  45115. pop: function () {
  45116. this.inlined_pop()
  45117. },
  45118. inlined_insert: function (a, b) {
  45119. var d;
  45120. null == c.util.ZNPNode_ZPP_ToiEvent.zpp_pool ? d = new c.util.ZNPNode_ZPP_ToiEvent : (d = c.util.ZNPNode_ZPP_ToiEvent.zpp_pool, c.util.ZNPNode_ZPP_ToiEvent.zpp_pool = d.next, d.next = null);
  45121. null;
  45122. d.elt = b;
  45123. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  45124. this.pushmod = this.modified = !0;
  45125. this.length++;
  45126. return d
  45127. },
  45128. insert: function (a, b) {
  45129. return this.inlined_insert(a,
  45130. b)
  45131. },
  45132. addAll: function (a) {
  45133. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  45134. },
  45135. inlined_add: function (a) {
  45136. var b;
  45137. null == c.util.ZNPNode_ZPP_ToiEvent.zpp_pool ? b = new c.util.ZNPNode_ZPP_ToiEvent : (b = c.util.ZNPNode_ZPP_ToiEvent.zpp_pool, c.util.ZNPNode_ZPP_ToiEvent.zpp_pool = b.next, b.next = null);
  45138. null;
  45139. b.elt = a;
  45140. b.next = this.head;
  45141. this.head = b;
  45142. this.modified = !0;
  45143. this.length++;
  45144. return a
  45145. },
  45146. add: function (a) {
  45147. return this.inlined_add(a)
  45148. },
  45149. setbegin: function (a) {
  45150. this.head = a;
  45151. this.pushmod = this.modified = !0
  45152. },
  45153. begin: function () {
  45154. return this.head
  45155. },
  45156. __class__: c.util.ZNPList_ZPP_ToiEvent
  45157. };
  45158. c.util.ZNPList_ConvexResult = function () {
  45159. this.length = 0;
  45160. this.modified = this.pushmod = !1;
  45161. this.head = null
  45162. };
  45163. s["zpp_nape.util.ZNPList_ConvexResult"] = c.util.ZNPList_ConvexResult;
  45164. c.util.ZNPList_ConvexResult.__name__ = ["zpp_nape", "util", "ZNPList_ConvexResult"];
  45165. c.util.ZNPList_ConvexResult.prototype = {
  45166. at: function (a) {
  45167. a = this.iterator_at(a);
  45168. return null != a ? a.elt : null
  45169. },
  45170. iterator_at: function (a) {
  45171. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  45172. return b
  45173. },
  45174. back: function () {
  45175. for (var a = this.head,
  45176. b = a; null != b;) a = b, b = b.next;
  45177. return a.elt
  45178. },
  45179. front: function () {
  45180. return this.head.elt
  45181. },
  45182. inlined_has: function (a) {
  45183. var b;
  45184. b = !1;
  45185. for (var c = this.head; null != c;) {
  45186. if (c.elt == a) {
  45187. b = !0;
  45188. break
  45189. }
  45190. c = c.next
  45191. }
  45192. return b
  45193. },
  45194. has: function (a) {
  45195. return this.inlined_has(a)
  45196. },
  45197. size: function () {
  45198. return this.length
  45199. },
  45200. empty: function () {
  45201. return null == this.head
  45202. },
  45203. reverse: function () {
  45204. for (var a = this.head, b = null; null != a;) {
  45205. var c = a.next;
  45206. a.next = b;
  45207. b = this.head = a;
  45208. a = c
  45209. }
  45210. this.pushmod = this.modified = !0
  45211. },
  45212. inlined_clear: function () {
  45213. for (; null != this.head;) this.inlined_pop();
  45214. this.pushmod = !0
  45215. },
  45216. clear: function () {
  45217. for (; null != this.head;) this.inlined_pop();
  45218. this.pushmod = !0
  45219. },
  45220. splice: function (a, b) {
  45221. for (; 0 < b-- && null != a.next;) this.erase(a);
  45222. return a.next
  45223. },
  45224. inlined_erase: function (a) {
  45225. var b, d;
  45226. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  45227. a = b;
  45228. a.elt = null;
  45229. a.next = c.util.ZNPNode_ConvexResult.zpp_pool;
  45230. c.util.ZNPNode_ConvexResult.zpp_pool = a;
  45231. this.modified = !0;
  45232. this.length--;
  45233. this.pushmod = !0;
  45234. return d
  45235. },
  45236. erase: function (a) {
  45237. return this.inlined_erase(a)
  45238. },
  45239. inlined_try_remove: function (a) {
  45240. for (var b = null, c = this.head, g = !1; null != c;) {
  45241. if (c.elt == a) {
  45242. this.inlined_erase(b);
  45243. g = !0;
  45244. break
  45245. }
  45246. b = c;
  45247. c = c.next
  45248. }
  45249. return g
  45250. },
  45251. inlined_remove: function (a) {
  45252. this.inlined_try_remove(a)
  45253. },
  45254. try_remove: function (a) {
  45255. for (var b = null, c = this.head, g = !1; null != c;) {
  45256. if (c.elt == a) {
  45257. this.erase(b);
  45258. g = !0;
  45259. break
  45260. }
  45261. b = c;
  45262. c = c.next
  45263. }
  45264. return g
  45265. },
  45266. remove: function (a) {
  45267. this.inlined_try_remove(a)
  45268. },
  45269. inlined_pop_unsafe: function () {
  45270. var a = this.head.elt;
  45271. this.pop();
  45272. return a
  45273. },
  45274. pop_unsafe: function () {
  45275. return this.inlined_pop_unsafe()
  45276. },
  45277. inlined_pop: function () {
  45278. var a =
  45279. this.head;
  45280. this.head = a.next;
  45281. a.elt = null;
  45282. a.next = c.util.ZNPNode_ConvexResult.zpp_pool;
  45283. c.util.ZNPNode_ConvexResult.zpp_pool = a;
  45284. null == this.head && (this.pushmod = !0);
  45285. this.modified = !0;
  45286. this.length--
  45287. },
  45288. pop: function () {
  45289. this.inlined_pop()
  45290. },
  45291. inlined_insert: function (a, b) {
  45292. var d;
  45293. null == c.util.ZNPNode_ConvexResult.zpp_pool ? d = new c.util.ZNPNode_ConvexResult : (d = c.util.ZNPNode_ConvexResult.zpp_pool, c.util.ZNPNode_ConvexResult.zpp_pool = d.next, d.next = null);
  45294. null;
  45295. d.elt = b;
  45296. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next =
  45297. d);
  45298. this.pushmod = this.modified = !0;
  45299. this.length++;
  45300. return d
  45301. },
  45302. insert: function (a, b) {
  45303. return this.inlined_insert(a, b)
  45304. },
  45305. addAll: function (a) {
  45306. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  45307. },
  45308. inlined_add: function (a) {
  45309. var b;
  45310. null == c.util.ZNPNode_ConvexResult.zpp_pool ? b = new c.util.ZNPNode_ConvexResult : (b = c.util.ZNPNode_ConvexResult.zpp_pool, c.util.ZNPNode_ConvexResult.zpp_pool = b.next, b.next = null);
  45311. null;
  45312. b.elt = a;
  45313. b.next = this.head;
  45314. this.head = b;
  45315. this.modified = !0;
  45316. this.length++;
  45317. return a
  45318. },
  45319. add: function (a) {
  45320. return this.inlined_add(a)
  45321. },
  45322. setbegin: function (a) {
  45323. this.head = a;
  45324. this.pushmod = this.modified = !0
  45325. },
  45326. begin: function () {
  45327. return this.head
  45328. },
  45329. __class__: c.util.ZNPList_ConvexResult
  45330. };
  45331. c.util.ZNPList_ZPP_GeomPoly = function () {
  45332. this.length = 0;
  45333. this.modified = this.pushmod = !1;
  45334. this.head = null
  45335. };
  45336. s["zpp_nape.util.ZNPList_ZPP_GeomPoly"] = c.util.ZNPList_ZPP_GeomPoly;
  45337. c.util.ZNPList_ZPP_GeomPoly.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_GeomPoly"];
  45338. c.util.ZNPList_ZPP_GeomPoly.prototype = {
  45339. at: function (a) {
  45340. a = this.iterator_at(a);
  45341. return null != a ? a.elt : null
  45342. },
  45343. iterator_at: function (a) {
  45344. for (var b =
  45345. this.head; 0 < a-- && null != b;) b = b.next;
  45346. return b
  45347. },
  45348. back: function () {
  45349. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  45350. return a.elt
  45351. },
  45352. front: function () {
  45353. return this.head.elt
  45354. },
  45355. inlined_has: function (a) {
  45356. var b;
  45357. b = !1;
  45358. for (var c = this.head; null != c;) {
  45359. if (c.elt == a) {
  45360. b = !0;
  45361. break
  45362. }
  45363. c = c.next
  45364. }
  45365. return b
  45366. },
  45367. has: function (a) {
  45368. return this.inlined_has(a)
  45369. },
  45370. size: function () {
  45371. return this.length
  45372. },
  45373. empty: function () {
  45374. return null == this.head
  45375. },
  45376. reverse: function () {
  45377. for (var a = this.head, b = null; null != a;) {
  45378. var c = a.next;
  45379. a.next = b;
  45380. b = this.head = a;
  45381. a = c
  45382. }
  45383. this.pushmod = this.modified = !0
  45384. },
  45385. inlined_clear: function () {
  45386. for (; null != this.head;) this.inlined_pop();
  45387. this.pushmod = !0
  45388. },
  45389. clear: function () {
  45390. for (; null != this.head;) this.inlined_pop();
  45391. this.pushmod = !0
  45392. },
  45393. splice: function (a, b) {
  45394. for (; 0 < b-- && null != a.next;) this.erase(a);
  45395. return a.next
  45396. },
  45397. inlined_erase: function (a) {
  45398. var b, d;
  45399. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  45400. a = b;
  45401. a.elt = null;
  45402. a.next = c.util.ZNPNode_ZPP_GeomPoly.zpp_pool;
  45403. c.util.ZNPNode_ZPP_GeomPoly.zpp_pool = a;
  45404. this.modified = !0;
  45405. this.length--;
  45406. this.pushmod = !0;
  45407. return d
  45408. },
  45409. erase: function (a) {
  45410. return this.inlined_erase(a)
  45411. },
  45412. inlined_try_remove: function (a) {
  45413. for (var b = null, c = this.head, g = !1; null != c;) {
  45414. if (c.elt == a) {
  45415. this.inlined_erase(b);
  45416. g = !0;
  45417. break
  45418. }
  45419. b = c;
  45420. c = c.next
  45421. }
  45422. return g
  45423. },
  45424. inlined_remove: function (a) {
  45425. this.inlined_try_remove(a)
  45426. },
  45427. try_remove: function (a) {
  45428. for (var b = null, c = this.head, g = !1; null != c;) {
  45429. if (c.elt == a) {
  45430. this.erase(b);
  45431. g = !0;
  45432. break
  45433. }
  45434. b = c;
  45435. c = c.next
  45436. }
  45437. return g
  45438. },
  45439. remove: function (a) {
  45440. this.inlined_try_remove(a)
  45441. },
  45442. inlined_pop_unsafe: function () {
  45443. var a =
  45444. this.head.elt;
  45445. this.pop();
  45446. return a
  45447. },
  45448. pop_unsafe: function () {
  45449. return this.inlined_pop_unsafe()
  45450. },
  45451. inlined_pop: function () {
  45452. var a = this.head;
  45453. this.head = a.next;
  45454. a.elt = null;
  45455. a.next = c.util.ZNPNode_ZPP_GeomPoly.zpp_pool;
  45456. c.util.ZNPNode_ZPP_GeomPoly.zpp_pool = a;
  45457. null == this.head && (this.pushmod = !0);
  45458. this.modified = !0;
  45459. this.length--
  45460. },
  45461. pop: function () {
  45462. this.inlined_pop()
  45463. },
  45464. inlined_insert: function (a, b) {
  45465. var d;
  45466. null == c.util.ZNPNode_ZPP_GeomPoly.zpp_pool ? d = new c.util.ZNPNode_ZPP_GeomPoly : (d = c.util.ZNPNode_ZPP_GeomPoly.zpp_pool, c.util.ZNPNode_ZPP_GeomPoly.zpp_pool =
  45467. d.next, d.next = null);
  45468. null;
  45469. d.elt = b;
  45470. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  45471. this.pushmod = this.modified = !0;
  45472. this.length++;
  45473. return d
  45474. },
  45475. insert: function (a, b) {
  45476. return this.inlined_insert(a, b)
  45477. },
  45478. addAll: function (a) {
  45479. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  45480. },
  45481. inlined_add: function (a) {
  45482. var b;
  45483. null == c.util.ZNPNode_ZPP_GeomPoly.zpp_pool ? b = new c.util.ZNPNode_ZPP_GeomPoly : (b = c.util.ZNPNode_ZPP_GeomPoly.zpp_pool, c.util.ZNPNode_ZPP_GeomPoly.zpp_pool = b.next, b.next = null);
  45484. null;
  45485. b.elt = a;
  45486. b.next = this.head;
  45487. this.head = b;
  45488. this.modified = !0;
  45489. this.length++;
  45490. return a
  45491. },
  45492. add: function (a) {
  45493. return this.inlined_add(a)
  45494. },
  45495. setbegin: function (a) {
  45496. this.head = a;
  45497. this.pushmod = this.modified = !0
  45498. },
  45499. begin: function () {
  45500. return this.head
  45501. },
  45502. __class__: c.util.ZNPList_ZPP_GeomPoly
  45503. };
  45504. c.util.ZNPList_RayResult = function () {
  45505. this.length = 0;
  45506. this.modified = this.pushmod = !1;
  45507. this.head = null
  45508. };
  45509. s["zpp_nape.util.ZNPList_RayResult"] = c.util.ZNPList_RayResult;
  45510. c.util.ZNPList_RayResult.__name__ = ["zpp_nape", "util", "ZNPList_RayResult"];
  45511. c.util.ZNPList_RayResult.prototype = {
  45512. at: function (a) {
  45513. a = this.iterator_at(a);
  45514. return null != a ? a.elt : null
  45515. },
  45516. iterator_at: function (a) {
  45517. for (var b = this.head; 0 < a-- && null != b;) b = b.next;
  45518. return b
  45519. },
  45520. back: function () {
  45521. for (var a = this.head, b = a; null != b;) a = b, b = b.next;
  45522. return a.elt
  45523. },
  45524. front: function () {
  45525. return this.head.elt
  45526. },
  45527. inlined_has: function (a) {
  45528. var b;
  45529. b = !1;
  45530. for (var c = this.head; null != c;) {
  45531. if (c.elt == a) {
  45532. b = !0;
  45533. break
  45534. }
  45535. c = c.next
  45536. }
  45537. return b
  45538. },
  45539. has: function (a) {
  45540. return this.inlined_has(a)
  45541. },
  45542. size: function () {
  45543. return this.length
  45544. },
  45545. empty: function () {
  45546. return null == this.head
  45547. },
  45548. reverse: function () {
  45549. for (var a =
  45550. this.head, b = null; null != a;) {
  45551. var c = a.next;
  45552. a.next = b;
  45553. b = this.head = a;
  45554. a = c
  45555. }
  45556. this.pushmod = this.modified = !0
  45557. },
  45558. inlined_clear: function () {
  45559. for (; null != this.head;) this.inlined_pop();
  45560. this.pushmod = !0
  45561. },
  45562. clear: function () {
  45563. for (; null != this.head;) this.inlined_pop();
  45564. this.pushmod = !0
  45565. },
  45566. splice: function (a, b) {
  45567. for (; 0 < b-- && null != a.next;) this.erase(a);
  45568. return a.next
  45569. },
  45570. inlined_erase: function (a) {
  45571. var b, d;
  45572. null == a ? (b = this.head, this.head = d = b.next, null == this.head && (this.pushmod = !0)) : (b = a.next, d = b.next, a.next = d, null == d && (this.pushmod = !0));
  45573. a = b;
  45574. a.elt = null;
  45575. a.next = c.util.ZNPNode_RayResult.zpp_pool;
  45576. c.util.ZNPNode_RayResult.zpp_pool = a;
  45577. this.modified = !0;
  45578. this.length--;
  45579. this.pushmod = !0;
  45580. return d
  45581. },
  45582. erase: function (a) {
  45583. return this.inlined_erase(a)
  45584. },
  45585. inlined_try_remove: function (a) {
  45586. for (var b = null, c = this.head, g = !1; null != c;) {
  45587. if (c.elt == a) {
  45588. this.inlined_erase(b);
  45589. g = !0;
  45590. break
  45591. }
  45592. b = c;
  45593. c = c.next
  45594. }
  45595. return g
  45596. },
  45597. inlined_remove: function (a) {
  45598. this.inlined_try_remove(a)
  45599. },
  45600. try_remove: function (a) {
  45601. for (var b = null, c = this.head, g = !1; null != c;) {
  45602. if (c.elt == a) {
  45603. this.erase(b);
  45604. g = !0;
  45605. break
  45606. }
  45607. b = c;
  45608. c = c.next
  45609. }
  45610. return g
  45611. },
  45612. remove: function (a) {
  45613. this.inlined_try_remove(a)
  45614. },
  45615. inlined_pop_unsafe: function () {
  45616. var a = this.head.elt;
  45617. this.pop();
  45618. return a
  45619. },
  45620. pop_unsafe: function () {
  45621. return this.inlined_pop_unsafe()
  45622. },
  45623. inlined_pop: function () {
  45624. var a = this.head;
  45625. this.head = a.next;
  45626. a.elt = null;
  45627. a.next = c.util.ZNPNode_RayResult.zpp_pool;
  45628. c.util.ZNPNode_RayResult.zpp_pool = a;
  45629. null == this.head && (this.pushmod = !0);
  45630. this.modified = !0;
  45631. this.length--
  45632. },
  45633. pop: function () {
  45634. this.inlined_pop()
  45635. },
  45636. inlined_insert: function (a, b) {
  45637. var d;
  45638. null == c.util.ZNPNode_RayResult.zpp_pool ? d = new c.util.ZNPNode_RayResult :
  45639. (d = c.util.ZNPNode_RayResult.zpp_pool, c.util.ZNPNode_RayResult.zpp_pool = d.next, d.next = null);
  45640. null;
  45641. d.elt = b;
  45642. null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
  45643. this.pushmod = this.modified = !0;
  45644. this.length++;
  45645. return d
  45646. },
  45647. insert: function (a, b) {
  45648. return this.inlined_insert(a, b)
  45649. },
  45650. addAll: function (a) {
  45651. for (a = a.head; null != a;) this.add(a.elt), a = a.next
  45652. },
  45653. inlined_add: function (a) {
  45654. var b;
  45655. null == c.util.ZNPNode_RayResult.zpp_pool ? b = new c.util.ZNPNode_RayResult : (b = c.util.ZNPNode_RayResult.zpp_pool, c.util.ZNPNode_RayResult.zpp_pool =
  45656. b.next, b.next = null);
  45657. null;
  45658. b.elt = a;
  45659. b.next = this.head;
  45660. this.head = b;
  45661. this.modified = !0;
  45662. this.length++;
  45663. return a
  45664. },
  45665. add: function (a) {
  45666. return this.inlined_add(a)
  45667. },
  45668. setbegin: function (a) {
  45669. this.head = a;
  45670. this.pushmod = this.modified = !0
  45671. },
  45672. begin: function () {
  45673. return this.head
  45674. },
  45675. __class__: c.util.ZNPList_RayResult
  45676. };
  45677. c.util.ZNPNode_ZPP_CbType = function () {
  45678. this.next = this.elt = null
  45679. };
  45680. s["zpp_nape.util.ZNPNode_ZPP_CbType"] = c.util.ZNPNode_ZPP_CbType;
  45681. c.util.ZNPNode_ZPP_CbType.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CbType"];
  45682. c.util.ZNPNode_ZPP_CbType.prototype = {
  45683. elem: function () {
  45684. return this.elt
  45685. },
  45686. free: function () {
  45687. this.elt = null
  45688. },
  45689. alloc: function () {},
  45690. __class__: c.util.ZNPNode_ZPP_CbType
  45691. };
  45692. c.util.ZNPNode_ZPP_CallbackSet = function () {
  45693. this.next = this.elt = null
  45694. };
  45695. s["zpp_nape.util.ZNPNode_ZPP_CallbackSet"] = c.util.ZNPNode_ZPP_CallbackSet;
  45696. c.util.ZNPNode_ZPP_CallbackSet.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CallbackSet"];
  45697. c.util.ZNPNode_ZPP_CallbackSet.prototype = {
  45698. elem: function () {
  45699. return this.elt
  45700. },
  45701. free: function () {
  45702. this.elt = null
  45703. },
  45704. alloc: function () {},
  45705. __class__: c.util.ZNPNode_ZPP_CallbackSet
  45706. };
  45707. c.util.ZNPNode_ZPP_Shape = function () {
  45708. this.next = this.elt = null
  45709. };
  45710. s["zpp_nape.util.ZNPNode_ZPP_Shape"] = c.util.ZNPNode_ZPP_Shape;
  45711. c.util.ZNPNode_ZPP_Shape.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Shape"];
  45712. c.util.ZNPNode_ZPP_Shape.prototype = {
  45713. elem: function () {
  45714. return this.elt
  45715. },
  45716. free: function () {
  45717. this.elt = null
  45718. },
  45719. alloc: function () {},
  45720. __class__: c.util.ZNPNode_ZPP_Shape
  45721. };
  45722. c.util.ZNPNode_ZPP_Body = function () {
  45723. this.next = this.elt = null
  45724. };
  45725. s["zpp_nape.util.ZNPNode_ZPP_Body"] = c.util.ZNPNode_ZPP_Body;
  45726. c.util.ZNPNode_ZPP_Body.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Body"];
  45727. c.util.ZNPNode_ZPP_Body.prototype = {
  45728. elem: function () {
  45729. return this.elt
  45730. },
  45731. free: function () {
  45732. this.elt = null
  45733. },
  45734. alloc: function () {},
  45735. __class__: c.util.ZNPNode_ZPP_Body
  45736. };
  45737. c.util.ZNPNode_ZPP_Constraint = function () {
  45738. this.next = this.elt = null
  45739. };
  45740. s["zpp_nape.util.ZNPNode_ZPP_Constraint"] = c.util.ZNPNode_ZPP_Constraint;
  45741. c.util.ZNPNode_ZPP_Constraint.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Constraint"];
  45742. c.util.ZNPNode_ZPP_Constraint.prototype = {
  45743. elem: function () {
  45744. return this.elt
  45745. },
  45746. free: function () {
  45747. this.elt =
  45748. null
  45749. },
  45750. alloc: function () {},
  45751. __class__: c.util.ZNPNode_ZPP_Constraint
  45752. };
  45753. c.util.ZNPNode_ZPP_Compound = function () {
  45754. this.next = this.elt = null
  45755. };
  45756. s["zpp_nape.util.ZNPNode_ZPP_Compound"] = c.util.ZNPNode_ZPP_Compound;
  45757. c.util.ZNPNode_ZPP_Compound.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Compound"];
  45758. c.util.ZNPNode_ZPP_Compound.prototype = {
  45759. elem: function () {
  45760. return this.elt
  45761. },
  45762. free: function () {
  45763. this.elt = null
  45764. },
  45765. alloc: function () {},
  45766. __class__: c.util.ZNPNode_ZPP_Compound
  45767. };
  45768. c.util.ZNPNode_ZPP_InteractionListener = function () {
  45769. this.next = this.elt =
  45770. null
  45771. };
  45772. s["zpp_nape.util.ZNPNode_ZPP_InteractionListener"] = c.util.ZNPNode_ZPP_InteractionListener;
  45773. c.util.ZNPNode_ZPP_InteractionListener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_InteractionListener"];
  45774. c.util.ZNPNode_ZPP_InteractionListener.prototype = {
  45775. elem: function () {
  45776. return this.elt
  45777. },
  45778. free: function () {
  45779. this.elt = null
  45780. },
  45781. alloc: function () {},
  45782. __class__: c.util.ZNPNode_ZPP_InteractionListener
  45783. };
  45784. c.util.ZNPNode_ZPP_CbSet = function () {
  45785. this.next = this.elt = null
  45786. };
  45787. s["zpp_nape.util.ZNPNode_ZPP_CbSet"] = c.util.ZNPNode_ZPP_CbSet;
  45788. c.util.ZNPNode_ZPP_CbSet.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CbSet"];
  45789. c.util.ZNPNode_ZPP_CbSet.prototype = {
  45790. elem: function () {
  45791. return this.elt
  45792. },
  45793. free: function () {
  45794. this.elt = null
  45795. },
  45796. alloc: function () {},
  45797. __class__: c.util.ZNPNode_ZPP_CbSet
  45798. };
  45799. c.util.ZNPNode_ZPP_Interactor = function () {
  45800. this.next = this.elt = null
  45801. };
  45802. s["zpp_nape.util.ZNPNode_ZPP_Interactor"] = c.util.ZNPNode_ZPP_Interactor;
  45803. c.util.ZNPNode_ZPP_Interactor.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Interactor"];
  45804. c.util.ZNPNode_ZPP_Interactor.prototype = {
  45805. elem: function () {
  45806. return this.elt
  45807. },
  45808. free: function () {
  45809. this.elt = null
  45810. },
  45811. alloc: function () {},
  45812. __class__: c.util.ZNPNode_ZPP_Interactor
  45813. };
  45814. c.util.ZNPNode_ZPP_Arbiter = function () {
  45815. this.next = this.elt = null
  45816. };
  45817. s["zpp_nape.util.ZNPNode_ZPP_Arbiter"] = c.util.ZNPNode_ZPP_Arbiter;
  45818. c.util.ZNPNode_ZPP_Arbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Arbiter"];
  45819. c.util.ZNPNode_ZPP_Arbiter.prototype = {
  45820. elem: function () {
  45821. return this.elt
  45822. },
  45823. free: function () {
  45824. this.elt = null
  45825. },
  45826. alloc: function () {},
  45827. __class__: c.util.ZNPNode_ZPP_Arbiter
  45828. };
  45829. c.util.ZNPNode_ZPP_BodyListener = function () {
  45830. this.next =
  45831. this.elt = null
  45832. };
  45833. s["zpp_nape.util.ZNPNode_ZPP_BodyListener"] = c.util.ZNPNode_ZPP_BodyListener;
  45834. c.util.ZNPNode_ZPP_BodyListener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_BodyListener"];
  45835. c.util.ZNPNode_ZPP_BodyListener.prototype = {
  45836. elem: function () {
  45837. return this.elt
  45838. },
  45839. free: function () {
  45840. this.elt = null
  45841. },
  45842. alloc: function () {},
  45843. __class__: c.util.ZNPNode_ZPP_BodyListener
  45844. };
  45845. c.util.ZNPNode_ZPP_ConstraintListener = function () {
  45846. this.next = this.elt = null
  45847. };
  45848. s["zpp_nape.util.ZNPNode_ZPP_ConstraintListener"] = c.util.ZNPNode_ZPP_ConstraintListener;
  45849. c.util.ZNPNode_ZPP_ConstraintListener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_ConstraintListener"];
  45850. c.util.ZNPNode_ZPP_ConstraintListener.prototype = {
  45851. elem: function () {
  45852. return this.elt
  45853. },
  45854. free: function () {
  45855. this.elt = null
  45856. },
  45857. alloc: function () {},
  45858. __class__: c.util.ZNPNode_ZPP_ConstraintListener
  45859. };
  45860. c.util.ZNPNode_ZPP_CbSetPair = function () {
  45861. this.next = this.elt = null
  45862. };
  45863. s["zpp_nape.util.ZNPNode_ZPP_CbSetPair"] = c.util.ZNPNode_ZPP_CbSetPair;
  45864. c.util.ZNPNode_ZPP_CbSetPair.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CbSetPair"];
  45865. c.util.ZNPNode_ZPP_CbSetPair.prototype = {
  45866. elem: function () {
  45867. return this.elt
  45868. },
  45869. free: function () {
  45870. this.elt = null
  45871. },
  45872. alloc: function () {},
  45873. __class__: c.util.ZNPNode_ZPP_CbSetPair
  45874. };
  45875. c.util.ZNPNode_ZPP_CutInt = function () {
  45876. this.next = this.elt = null
  45877. };
  45878. s["zpp_nape.util.ZNPNode_ZPP_CutInt"] = c.util.ZNPNode_ZPP_CutInt;
  45879. c.util.ZNPNode_ZPP_CutInt.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CutInt"];
  45880. c.util.ZNPNode_ZPP_CutInt.prototype = {
  45881. elem: function () {
  45882. return this.elt
  45883. },
  45884. free: function () {
  45885. this.elt = null
  45886. },
  45887. alloc: function () {},
  45888. __class__: c.util.ZNPNode_ZPP_CutInt
  45889. };
  45890. c.util.ZNPNode_ZPP_CutVert =
  45891. function () {
  45892. this.next = this.elt = null
  45893. };
  45894. s["zpp_nape.util.ZNPNode_ZPP_CutVert"] = c.util.ZNPNode_ZPP_CutVert;
  45895. c.util.ZNPNode_ZPP_CutVert.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CutVert"];
  45896. c.util.ZNPNode_ZPP_CutVert.prototype = {
  45897. elem: function () {
  45898. return this.elt
  45899. },
  45900. free: function () {
  45901. this.elt = null
  45902. },
  45903. alloc: function () {},
  45904. __class__: c.util.ZNPNode_ZPP_CutVert
  45905. };
  45906. c.util.ZNPNode_ZPP_PartitionVertex = function () {
  45907. this.next = this.elt = null
  45908. };
  45909. s["zpp_nape.util.ZNPNode_ZPP_PartitionVertex"] = c.util.ZNPNode_ZPP_PartitionVertex;
  45910. c.util.ZNPNode_ZPP_PartitionVertex.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_PartitionVertex"];
  45911. c.util.ZNPNode_ZPP_PartitionVertex.prototype = {
  45912. elem: function () {
  45913. return this.elt
  45914. },
  45915. free: function () {
  45916. this.elt = null
  45917. },
  45918. alloc: function () {},
  45919. __class__: c.util.ZNPNode_ZPP_PartitionVertex
  45920. };
  45921. c.util.ZNPNode_ZPP_PartitionedPoly = function () {
  45922. this.next = this.elt = null
  45923. };
  45924. s["zpp_nape.util.ZNPNode_ZPP_PartitionedPoly"] = c.util.ZNPNode_ZPP_PartitionedPoly;
  45925. c.util.ZNPNode_ZPP_PartitionedPoly.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_PartitionedPoly"];
  45926. c.util.ZNPNode_ZPP_PartitionedPoly.prototype = {
  45927. elem: function () {
  45928. return this.elt
  45929. },
  45930. free: function () {
  45931. this.elt = null
  45932. },
  45933. alloc: function () {},
  45934. __class__: c.util.ZNPNode_ZPP_PartitionedPoly
  45935. };
  45936. c.util.ZNPNode_ZPP_GeomVert = function () {
  45937. this.next = this.elt = null
  45938. };
  45939. s["zpp_nape.util.ZNPNode_ZPP_GeomVert"] = c.util.ZNPNode_ZPP_GeomVert;
  45940. c.util.ZNPNode_ZPP_GeomVert.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_GeomVert"];
  45941. c.util.ZNPNode_ZPP_GeomVert.prototype = {
  45942. elem: function () {
  45943. return this.elt
  45944. },
  45945. free: function () {
  45946. this.elt = null
  45947. },
  45948. alloc: function () {},
  45949. __class__: c.util.ZNPNode_ZPP_GeomVert
  45950. };
  45951. c.util.ZNPNode_ZPP_SimplifyP = function () {
  45952. this.next = this.elt = null
  45953. };
  45954. s["zpp_nape.util.ZNPNode_ZPP_SimplifyP"] = c.util.ZNPNode_ZPP_SimplifyP;
  45955. c.util.ZNPNode_ZPP_SimplifyP.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SimplifyP"];
  45956. c.util.ZNPNode_ZPP_SimplifyP.prototype = {
  45957. elem: function () {
  45958. return this.elt
  45959. },
  45960. free: function () {
  45961. this.elt = null
  45962. },
  45963. alloc: function () {},
  45964. __class__: c.util.ZNPNode_ZPP_SimplifyP
  45965. };
  45966. c.util.ZNPNode_ZPP_SimpleVert = function () {
  45967. this.next = this.elt = null
  45968. };
  45969. s["zpp_nape.util.ZNPNode_ZPP_SimpleVert"] = c.util.ZNPNode_ZPP_SimpleVert;
  45970. c.util.ZNPNode_ZPP_SimpleVert.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SimpleVert"];
  45971. c.util.ZNPNode_ZPP_SimpleVert.prototype = {
  45972. elem: function () {
  45973. return this.elt
  45974. },
  45975. free: function () {
  45976. this.elt = null
  45977. },
  45978. alloc: function () {},
  45979. __class__: c.util.ZNPNode_ZPP_SimpleVert
  45980. };
  45981. c.util.ZNPNode_ZPP_SimpleEvent = function () {
  45982. this.next = this.elt = null
  45983. };
  45984. s["zpp_nape.util.ZNPNode_ZPP_SimpleEvent"] = c.util.ZNPNode_ZPP_SimpleEvent;
  45985. c.util.ZNPNode_ZPP_SimpleEvent.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SimpleEvent"];
  45986. c.util.ZNPNode_ZPP_SimpleEvent.prototype = {
  45987. elem: function () {
  45988. return this.elt
  45989. },
  45990. free: function () {
  45991. this.elt = null
  45992. },
  45993. alloc: function () {},
  45994. __class__: c.util.ZNPNode_ZPP_SimpleEvent
  45995. };
  45996. c.util.ZNPNode_ZPP_AABBPair = function () {
  45997. this.next = this.elt = null
  45998. };
  45999. s["zpp_nape.util.ZNPNode_ZPP_AABBPair"] = c.util.ZNPNode_ZPP_AABBPair;
  46000. c.util.ZNPNode_ZPP_AABBPair.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_AABBPair"];
  46001. c.util.ZNPNode_ZPP_AABBPair.prototype = {
  46002. elem: function () {
  46003. return this.elt
  46004. },
  46005. free: function () {
  46006. this.elt = null
  46007. },
  46008. alloc: function () {},
  46009. __class__: c.util.ZNPNode_ZPP_AABBPair
  46010. };
  46011. c.util.ZNPNode_ZPP_Edge =
  46012. function () {
  46013. this.next = this.elt = null
  46014. };
  46015. s["zpp_nape.util.ZNPNode_ZPP_Edge"] = c.util.ZNPNode_ZPP_Edge;
  46016. c.util.ZNPNode_ZPP_Edge.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Edge"];
  46017. c.util.ZNPNode_ZPP_Edge.prototype = {
  46018. elem: function () {
  46019. return this.elt
  46020. },
  46021. free: function () {
  46022. this.elt = null
  46023. },
  46024. alloc: function () {},
  46025. __class__: c.util.ZNPNode_ZPP_Edge
  46026. };
  46027. c.util.ZNPNode_ZPP_Vec2 = function () {
  46028. this.next = this.elt = null
  46029. };
  46030. s["zpp_nape.util.ZNPNode_ZPP_Vec2"] = c.util.ZNPNode_ZPP_Vec2;
  46031. c.util.ZNPNode_ZPP_Vec2.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Vec2"];
  46032. c.util.ZNPNode_ZPP_Vec2.prototype = {
  46033. elem: function () {
  46034. return this.elt
  46035. },
  46036. free: function () {
  46037. this.elt = null
  46038. },
  46039. alloc: function () {},
  46040. __class__: c.util.ZNPNode_ZPP_Vec2
  46041. };
  46042. c.util.ZNPNode_ZPP_Component = function () {
  46043. this.next = this.elt = null
  46044. };
  46045. s["zpp_nape.util.ZNPNode_ZPP_Component"] = c.util.ZNPNode_ZPP_Component;
  46046. c.util.ZNPNode_ZPP_Component.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Component"];
  46047. c.util.ZNPNode_ZPP_Component.prototype = {
  46048. elem: function () {
  46049. return this.elt
  46050. },
  46051. free: function () {
  46052. this.elt = null
  46053. },
  46054. alloc: function () {},
  46055. __class__: c.util.ZNPNode_ZPP_Component
  46056. };
  46057. c.util.ZNPNode_ZPP_AABBNode = function () {
  46058. this.next = this.elt = null
  46059. };
  46060. s["zpp_nape.util.ZNPNode_ZPP_AABBNode"] = c.util.ZNPNode_ZPP_AABBNode;
  46061. c.util.ZNPNode_ZPP_AABBNode.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_AABBNode"];
  46062. c.util.ZNPNode_ZPP_AABBNode.prototype = {
  46063. elem: function () {
  46064. return this.elt
  46065. },
  46066. free: function () {
  46067. this.elt = null
  46068. },
  46069. alloc: function () {},
  46070. __class__: c.util.ZNPNode_ZPP_AABBNode
  46071. };
  46072. c.util.ZNPNode_ZPP_InteractionGroup = function () {
  46073. this.next = this.elt = null
  46074. };
  46075. s["zpp_nape.util.ZNPNode_ZPP_InteractionGroup"] = c.util.ZNPNode_ZPP_InteractionGroup;
  46076. c.util.ZNPNode_ZPP_InteractionGroup.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_InteractionGroup"];
  46077. c.util.ZNPNode_ZPP_InteractionGroup.prototype = {
  46078. elem: function () {
  46079. return this.elt
  46080. },
  46081. free: function () {
  46082. this.elt = null
  46083. },
  46084. alloc: function () {},
  46085. __class__: c.util.ZNPNode_ZPP_InteractionGroup
  46086. };
  46087. c.util.ZNPNode_ZPP_FluidArbiter = function () {
  46088. this.next = this.elt = null
  46089. };
  46090. s["zpp_nape.util.ZNPNode_ZPP_FluidArbiter"] = c.util.ZNPNode_ZPP_FluidArbiter;
  46091. c.util.ZNPNode_ZPP_FluidArbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_FluidArbiter"];
  46092. c.util.ZNPNode_ZPP_FluidArbiter.prototype = {
  46093. elem: function () {
  46094. return this.elt
  46095. },
  46096. free: function () {
  46097. this.elt = null
  46098. },
  46099. alloc: function () {},
  46100. __class__: c.util.ZNPNode_ZPP_FluidArbiter
  46101. };
  46102. c.util.ZNPNode_ZPP_SensorArbiter = function () {
  46103. this.next = this.elt = null
  46104. };
  46105. s["zpp_nape.util.ZNPNode_ZPP_SensorArbiter"] = c.util.ZNPNode_ZPP_SensorArbiter;
  46106. c.util.ZNPNode_ZPP_SensorArbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SensorArbiter"];
  46107. c.util.ZNPNode_ZPP_SensorArbiter.prototype = {
  46108. elem: function () {
  46109. return this.elt
  46110. },
  46111. free: function () {
  46112. this.elt =
  46113. null
  46114. },
  46115. alloc: function () {},
  46116. __class__: c.util.ZNPNode_ZPP_SensorArbiter
  46117. };
  46118. c.util.ZNPNode_ZPP_Listener = function () {
  46119. this.next = this.elt = null
  46120. };
  46121. s["zpp_nape.util.ZNPNode_ZPP_Listener"] = c.util.ZNPNode_ZPP_Listener;
  46122. c.util.ZNPNode_ZPP_Listener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Listener"];
  46123. c.util.ZNPNode_ZPP_Listener.prototype = {
  46124. elem: function () {
  46125. return this.elt
  46126. },
  46127. free: function () {
  46128. this.elt = null
  46129. },
  46130. alloc: function () {},
  46131. __class__: c.util.ZNPNode_ZPP_Listener
  46132. };
  46133. c.util.ZNPNode_ZPP_ColArbiter = function () {
  46134. this.next = this.elt =
  46135. null
  46136. };
  46137. s["zpp_nape.util.ZNPNode_ZPP_ColArbiter"] = c.util.ZNPNode_ZPP_ColArbiter;
  46138. c.util.ZNPNode_ZPP_ColArbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_ColArbiter"];
  46139. c.util.ZNPNode_ZPP_ColArbiter.prototype = {
  46140. elem: function () {
  46141. return this.elt
  46142. },
  46143. free: function () {
  46144. this.elt = null
  46145. },
  46146. alloc: function () {},
  46147. __class__: c.util.ZNPNode_ZPP_ColArbiter
  46148. };
  46149. c.util.ZNPNode_ZPP_ToiEvent = function () {
  46150. this.next = this.elt = null
  46151. };
  46152. s["zpp_nape.util.ZNPNode_ZPP_ToiEvent"] = c.util.ZNPNode_ZPP_ToiEvent;
  46153. c.util.ZNPNode_ZPP_ToiEvent.__name__ = ["zpp_nape",
  46154. "util", "ZNPNode_ZPP_ToiEvent"
  46155. ];
  46156. c.util.ZNPNode_ZPP_ToiEvent.prototype = {
  46157. elem: function () {
  46158. return this.elt
  46159. },
  46160. free: function () {
  46161. this.elt = null
  46162. },
  46163. alloc: function () {},
  46164. __class__: c.util.ZNPNode_ZPP_ToiEvent
  46165. };
  46166. c.util.ZNPNode_ConvexResult = function () {
  46167. this.next = this.elt = null
  46168. };
  46169. s["zpp_nape.util.ZNPNode_ConvexResult"] = c.util.ZNPNode_ConvexResult;
  46170. c.util.ZNPNode_ConvexResult.__name__ = ["zpp_nape", "util", "ZNPNode_ConvexResult"];
  46171. c.util.ZNPNode_ConvexResult.prototype = {
  46172. elem: function () {
  46173. return this.elt
  46174. },
  46175. free: function () {
  46176. this.elt =
  46177. null
  46178. },
  46179. alloc: function () {},
  46180. __class__: c.util.ZNPNode_ConvexResult
  46181. };
  46182. c.util.ZNPNode_ZPP_GeomPoly = function () {
  46183. this.next = this.elt = null
  46184. };
  46185. s["zpp_nape.util.ZNPNode_ZPP_GeomPoly"] = c.util.ZNPNode_ZPP_GeomPoly;
  46186. c.util.ZNPNode_ZPP_GeomPoly.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_GeomPoly"];
  46187. c.util.ZNPNode_ZPP_GeomPoly.prototype = {
  46188. elem: function () {
  46189. return this.elt
  46190. },
  46191. free: function () {
  46192. this.elt = null
  46193. },
  46194. alloc: function () {},
  46195. __class__: c.util.ZNPNode_ZPP_GeomPoly
  46196. };
  46197. c.util.ZNPNode_RayResult = function () {
  46198. this.next = this.elt = null
  46199. };
  46200. s["zpp_nape.util.ZNPNode_RayResult"] =
  46201. c.util.ZNPNode_RayResult;
  46202. c.util.ZNPNode_RayResult.__name__ = ["zpp_nape", "util", "ZNPNode_RayResult"];
  46203. c.util.ZNPNode_RayResult.prototype = {
  46204. elem: function () {
  46205. return this.elt
  46206. },
  46207. free: function () {
  46208. this.elt = null
  46209. },
  46210. alloc: function () {},
  46211. __class__: c.util.ZNPNode_RayResult
  46212. };
  46213. c.util.ZPP_MixVec2List = function () {
  46214. this.at_index = 0;
  46215. this.at_ite = null;
  46216. this.zip_length = !1;
  46217. this._length = 0;
  46218. this.inner = null;
  46219. h.geom.Vec2List.call(this);
  46220. this.at_ite = null;
  46221. this.at_index = 0;
  46222. this.zip_length = !0;
  46223. this._length = 0
  46224. };
  46225. s["zpp_nape.util.ZPP_MixVec2List"] =
  46226. c.util.ZPP_MixVec2List;
  46227. c.util.ZPP_MixVec2List.__name__ = ["zpp_nape", "util", "ZPP_MixVec2List"];
  46228. c.util.ZPP_MixVec2List.get = function (a, b) {
  46229. null == b && (b = !1);
  46230. var d = new c.util.ZPP_MixVec2List;
  46231. d.inner = a;
  46232. d.zpp_inner.immutable = b;
  46233. return d
  46234. };
  46235. c.util.ZPP_MixVec2List.__super__ = h.geom.Vec2List;
  46236. c.util.ZPP_MixVec2List.prototype = I(h.geom.Vec2List.prototype, {
  46237. clear: function () {
  46238. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  46239. if (this.zpp_inner.reverse_flag)
  46240. for (; !this.empty();) this.pop();
  46241. else
  46242. for (; !this.empty();) this.shift()
  46243. },
  46244. remove: function (a) {
  46245. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  46246. this.zpp_inner.modify_test();
  46247. this.zpp_vm();
  46248. var b;
  46249. b = !1;
  46250. for (var c = this.inner.next; null != c;) {
  46251. if (a.zpp_inner == c) {
  46252. b = !0;
  46253. break
  46254. }
  46255. c = c.next
  46256. }
  46257. b && (null != this.zpp_inner.subber && this.zpp_inner.subber(a), this.zpp_inner.dontremove || this.inner.remove(a.zpp_inner), this.zpp_inner.invalidate());
  46258. return b
  46259. },
  46260. shift: function () {
  46261. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  46262. this.zpp_inner.modify_test();
  46263. if (this.empty()) throw "Error: Cannot remove from empty list";
  46264. this.zpp_vm();
  46265. var a = null;
  46266. if (this.zpp_inner.reverse_flag) {
  46267. null != this.at_ite && null == this.at_ite.next && (this.at_ite = null);
  46268. var b = 1 == this.zpp_gl() ? null : this.inner.iterator_at(this.zpp_gl() - 2),
  46269. a = null == b ? this.inner.next : b.next,
  46270. c = a.wrapper();
  46271. null != this.zpp_inner.subber && this.zpp_inner.subber(c);
  46272. this.zpp_inner.dontremove || this.inner.erase(b)
  46273. } else a = this.inner.next, c = a.wrapper(), null != this.zpp_inner.subber && this.zpp_inner.subber(c), this.zpp_inner.dontremove || this.inner.pop();
  46274. this.zpp_inner.invalidate();
  46275. return c =
  46276. a.wrapper()
  46277. },
  46278. pop: function () {
  46279. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  46280. this.zpp_inner.modify_test();
  46281. if (this.empty()) throw "Error: Cannot remove from empty list";
  46282. this.zpp_vm();
  46283. var a = null;
  46284. if (this.zpp_inner.reverse_flag) {
  46285. var a = this.inner.next,
  46286. b = a.wrapper();
  46287. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  46288. this.zpp_inner.dontremove || this.inner.pop()
  46289. } else {
  46290. null != this.at_ite && null == this.at_ite.next && (this.at_ite = null);
  46291. var c = 1 == this.zpp_gl() ? null : this.inner.iterator_at(this.zpp_gl() -
  46292. 2),
  46293. a = null == c ? this.inner.next : c.next,
  46294. b = a.wrapper();
  46295. null != this.zpp_inner.subber && this.zpp_inner.subber(b);
  46296. this.zpp_inner.dontremove || this.inner.erase(c)
  46297. }
  46298. this.zpp_inner.invalidate();
  46299. return b = a.wrapper()
  46300. },
  46301. unshift: function (a) {
  46302. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  46303. this.zpp_inner.modify_test();
  46304. this.zpp_vm();
  46305. if (a.zpp_inner._inuse) throw "Error: Vec2 is already in use";
  46306. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  46307. if (b) {
  46308. if (this.zpp_inner.reverse_flag) {
  46309. var c = this.inner.iterator_at(this.zpp_gl() -
  46310. 1);
  46311. this.inner.insert(c, a.zpp_inner)
  46312. } else this.inner.add(a.zpp_inner);
  46313. this.zpp_inner.invalidate();
  46314. null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a)
  46315. }
  46316. return b
  46317. },
  46318. push: function (a) {
  46319. if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
  46320. this.zpp_inner.modify_test();
  46321. this.zpp_vm();
  46322. if (a.zpp_inner._inuse) throw "Error: Vec2 is already in use";
  46323. var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
  46324. if (b) {
  46325. if (this.zpp_inner.reverse_flag) this.inner.add(a.zpp_inner);
  46326. else {
  46327. var c = this.inner.iterator_at(this.zpp_gl() -
  46328. 1);
  46329. this.inner.insert(c, a.zpp_inner)
  46330. }
  46331. this.zpp_inner.invalidate();
  46332. null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a)
  46333. }
  46334. return b
  46335. },
  46336. at: function (a) {
  46337. this.zpp_vm();
  46338. if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
  46339. this.zpp_inner.reverse_flag && (a = this.zpp_gl() - 1 - a);
  46340. if (a < this.at_index || null == this.at_ite)
  46341. for (this.at_index = 0, this.at_ite = this.inner.next;;) break;
  46342. for (; this.at_index != a;)
  46343. for (this.at_index++, this.at_ite = this.at_ite.next;;) break;
  46344. return this.at_ite.wrapper()
  46345. },
  46346. zpp_vm: function () {
  46347. this.zpp_inner.validate();
  46348. this.inner.modified && (this.zip_length = !0, this._length = 0, this.at_ite = null)
  46349. },
  46350. zpp_gl: function () {
  46351. this.zpp_vm();
  46352. if (this.zip_length) {
  46353. this._length = 0;
  46354. for (var a = this.inner.next; null != a;) this._length++, a = a.next;
  46355. this.zip_length = !1
  46356. }
  46357. return this._length
  46358. },
  46359. __class__: c.util.ZPP_MixVec2List
  46360. });
  46361. c.util.ZPP_ConstraintList = function () {
  46362. this.user_length = 0;
  46363. this.zip_length = !1;
  46364. this.at_ite = this.push_ite = null;
  46365. this.at_index = 0;
  46366. this.dontremove = this.reverse_flag = !1;
  46367. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder =
  46368. this.subber = null;
  46369. this.immutable = this._invalidated = !1;
  46370. this.outer = this.inner = null;
  46371. this.inner = new c.util.ZNPList_ZPP_Constraint;
  46372. this._invalidated = !0
  46373. };
  46374. s["zpp_nape.util.ZPP_ConstraintList"] = c.util.ZPP_ConstraintList;
  46375. c.util.ZPP_ConstraintList.__name__ = ["zpp_nape", "util", "ZPP_ConstraintList"];
  46376. c.util.ZPP_ConstraintList.get = function (a, b) {
  46377. null == b && (b = !1);
  46378. var c = new h.constraint.ConstraintList;
  46379. c.zpp_inner.inner = a;
  46380. b && (c.zpp_inner.immutable = !0);
  46381. c.zpp_inner.zip_length = !0;
  46382. return c
  46383. };
  46384. c.util.ZPP_ConstraintList.prototype = {
  46385. invalidate: function () {
  46386. this._invalidated = !0;
  46387. null != this._invalidate && this._invalidate(this)
  46388. },
  46389. validate: function () {
  46390. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46391. },
  46392. modify_test: function () {
  46393. null != this._modifiable && this._modifiable()
  46394. },
  46395. modified: function () {
  46396. this.zip_length = !0;
  46397. this.push_ite = this.at_ite = null
  46398. },
  46399. valmod: function () {
  46400. this.validate();
  46401. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46402. },
  46403. __class__: c.util.ZPP_ConstraintList
  46404. };
  46405. c.util.ZPP_BodyList = function () {
  46406. this.user_length = 0;
  46407. this.zip_length = !1;
  46408. this.at_ite = this.push_ite = null;
  46409. this.at_index = 0;
  46410. this.dontremove = this.reverse_flag = !1;
  46411. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46412. this.immutable = this._invalidated = !1;
  46413. this.outer = this.inner = null;
  46414. this.inner = new c.util.ZNPList_ZPP_Body;
  46415. this._invalidated = !0
  46416. };
  46417. s["zpp_nape.util.ZPP_BodyList"] = c.util.ZPP_BodyList;
  46418. c.util.ZPP_BodyList.__name__ = ["zpp_nape",
  46419. "util", "ZPP_BodyList"
  46420. ];
  46421. c.util.ZPP_BodyList.get = function (a, b) {
  46422. null == b && (b = !1);
  46423. var c = new h.phys.BodyList;
  46424. c.zpp_inner.inner = a;
  46425. b && (c.zpp_inner.immutable = !0);
  46426. c.zpp_inner.zip_length = !0;
  46427. return c
  46428. };
  46429. c.util.ZPP_BodyList.prototype = {
  46430. invalidate: function () {
  46431. this._invalidated = !0;
  46432. null != this._invalidate && this._invalidate(this)
  46433. },
  46434. validate: function () {
  46435. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46436. },
  46437. modify_test: function () {
  46438. null != this._modifiable && this._modifiable()
  46439. },
  46440. modified: function () {
  46441. this.zip_length = !0;
  46442. this.push_ite = this.at_ite = null
  46443. },
  46444. valmod: function () {
  46445. this.validate();
  46446. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46447. },
  46448. __class__: c.util.ZPP_BodyList
  46449. };
  46450. c.util.ZPP_InteractorList = function () {
  46451. this.user_length = 0;
  46452. this.zip_length = !1;
  46453. this.at_ite = this.push_ite = null;
  46454. this.at_index = 0;
  46455. this.dontremove = this.reverse_flag = !1;
  46456. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46457. this.immutable =
  46458. this._invalidated = !1;
  46459. this.outer = this.inner = null;
  46460. this.inner = new c.util.ZNPList_ZPP_Interactor;
  46461. this._invalidated = !0
  46462. };
  46463. s["zpp_nape.util.ZPP_InteractorList"] = c.util.ZPP_InteractorList;
  46464. c.util.ZPP_InteractorList.__name__ = ["zpp_nape", "util", "ZPP_InteractorList"];
  46465. c.util.ZPP_InteractorList.get = function (a, b) {
  46466. null == b && (b = !1);
  46467. var c = new h.phys.InteractorList;
  46468. c.zpp_inner.inner = a;
  46469. b && (c.zpp_inner.immutable = !0);
  46470. c.zpp_inner.zip_length = !0;
  46471. return c
  46472. };
  46473. c.util.ZPP_InteractorList.prototype = {
  46474. invalidate: function () {
  46475. this._invalidated = !0;
  46476. null != this._invalidate && this._invalidate(this)
  46477. },
  46478. validate: function () {
  46479. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46480. },
  46481. modify_test: function () {
  46482. null != this._modifiable && this._modifiable()
  46483. },
  46484. modified: function () {
  46485. this.zip_length = !0;
  46486. this.push_ite = this.at_ite = null
  46487. },
  46488. valmod: function () {
  46489. this.validate();
  46490. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46491. },
  46492. __class__: c.util.ZPP_InteractorList
  46493. };
  46494. c.util.ZPP_CompoundList = function () {
  46495. this.user_length = 0;
  46496. this.zip_length = !1;
  46497. this.at_ite = this.push_ite = null;
  46498. this.at_index = 0;
  46499. this.dontremove = this.reverse_flag = !1;
  46500. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46501. this.immutable = this._invalidated = !1;
  46502. this.outer = this.inner = null;
  46503. this.inner = new c.util.ZNPList_ZPP_Compound;
  46504. this._invalidated = !0
  46505. };
  46506. s["zpp_nape.util.ZPP_CompoundList"] = c.util.ZPP_CompoundList;
  46507. c.util.ZPP_CompoundList.__name__ = ["zpp_nape", "util", "ZPP_CompoundList"];
  46508. c.util.ZPP_CompoundList.get = function (a, b) {
  46509. null == b && (b = !1);
  46510. var c = new h.phys.CompoundList;
  46511. c.zpp_inner.inner = a;
  46512. b && (c.zpp_inner.immutable = !0);
  46513. c.zpp_inner.zip_length = !0;
  46514. return c
  46515. };
  46516. c.util.ZPP_CompoundList.prototype = {
  46517. invalidate: function () {
  46518. this._invalidated = !0;
  46519. null != this._invalidate && this._invalidate(this)
  46520. },
  46521. validate: function () {
  46522. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46523. },
  46524. modify_test: function () {
  46525. null != this._modifiable && this._modifiable()
  46526. },
  46527. modified: function () {
  46528. this.zip_length = !0;
  46529. this.push_ite = this.at_ite = null
  46530. },
  46531. valmod: function () {
  46532. this.validate();
  46533. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46534. },
  46535. __class__: c.util.ZPP_CompoundList
  46536. };
  46537. c.util.ZPP_ListenerList = function () {
  46538. this.user_length = 0;
  46539. this.zip_length = !1;
  46540. this.at_ite = this.push_ite = null;
  46541. this.at_index = 0;
  46542. this.dontremove = this.reverse_flag = !1;
  46543. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46544. this.immutable =
  46545. this._invalidated = !1;
  46546. this.outer = this.inner = null;
  46547. this.inner = new c.util.ZNPList_ZPP_Listener;
  46548. this._invalidated = !0
  46549. };
  46550. s["zpp_nape.util.ZPP_ListenerList"] = c.util.ZPP_ListenerList;
  46551. c.util.ZPP_ListenerList.__name__ = ["zpp_nape", "util", "ZPP_ListenerList"];
  46552. c.util.ZPP_ListenerList.get = function (a, b) {
  46553. null == b && (b = !1);
  46554. var c = new h.callbacks.ListenerList;
  46555. c.zpp_inner.inner = a;
  46556. b && (c.zpp_inner.immutable = !0);
  46557. c.zpp_inner.zip_length = !0;
  46558. return c
  46559. };
  46560. c.util.ZPP_ListenerList.prototype = {
  46561. invalidate: function () {
  46562. this._invalidated = !0;
  46563. null != this._invalidate && this._invalidate(this)
  46564. },
  46565. validate: function () {
  46566. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46567. },
  46568. modify_test: function () {
  46569. null != this._modifiable && this._modifiable()
  46570. },
  46571. modified: function () {
  46572. this.zip_length = !0;
  46573. this.push_ite = this.at_ite = null
  46574. },
  46575. valmod: function () {
  46576. this.validate();
  46577. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46578. },
  46579. __class__: c.util.ZPP_ListenerList
  46580. };
  46581. c.util.ZPP_CbTypeList = function () {
  46582. this.user_length = 0;
  46583. this.zip_length = !1;
  46584. this.at_ite = this.push_ite = null;
  46585. this.at_index = 0;
  46586. this.dontremove = this.reverse_flag = !1;
  46587. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46588. this.immutable = this._invalidated = !1;
  46589. this.outer = this.inner = null;
  46590. this.inner = new c.util.ZNPList_ZPP_CbType;
  46591. this._invalidated = !0
  46592. };
  46593. s["zpp_nape.util.ZPP_CbTypeList"] = c.util.ZPP_CbTypeList;
  46594. c.util.ZPP_CbTypeList.__name__ = ["zpp_nape", "util", "ZPP_CbTypeList"];
  46595. c.util.ZPP_CbTypeList.get =
  46596. function (a, b) {
  46597. null == b && (b = !1);
  46598. var c = new h.callbacks.CbTypeList;
  46599. c.zpp_inner.inner = a;
  46600. b && (c.zpp_inner.immutable = !0);
  46601. c.zpp_inner.zip_length = !0;
  46602. return c
  46603. };
  46604. c.util.ZPP_CbTypeList.prototype = {
  46605. invalidate: function () {
  46606. this._invalidated = !0;
  46607. null != this._invalidate && this._invalidate(this)
  46608. },
  46609. validate: function () {
  46610. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46611. },
  46612. modify_test: function () {
  46613. null != this._modifiable && this._modifiable()
  46614. },
  46615. modified: function () {
  46616. this.zip_length = !0;
  46617. this.push_ite = this.at_ite =
  46618. null
  46619. },
  46620. valmod: function () {
  46621. this.validate();
  46622. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46623. },
  46624. __class__: c.util.ZPP_CbTypeList
  46625. };
  46626. c.util.ZPP_Vec2List = function () {
  46627. this.user_length = 0;
  46628. this.zip_length = !1;
  46629. this.at_ite = this.push_ite = null;
  46630. this.at_index = 0;
  46631. this.dontremove = this.reverse_flag = !1;
  46632. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46633. this.immutable = this._invalidated = !1;
  46634. this.outer = this.inner = null;
  46635. this.inner = new c.util.ZNPList_ZPP_Vec2;
  46636. this._invalidated = !0
  46637. };
  46638. s["zpp_nape.util.ZPP_Vec2List"] = c.util.ZPP_Vec2List;
  46639. c.util.ZPP_Vec2List.__name__ = ["zpp_nape", "util", "ZPP_Vec2List"];
  46640. c.util.ZPP_Vec2List.get = function (a, b) {
  46641. null == b && (b = !1);
  46642. var c = new h.geom.Vec2List;
  46643. c.zpp_inner.inner = a;
  46644. b && (c.zpp_inner.immutable = !0);
  46645. c.zpp_inner.zip_length = !0;
  46646. return c
  46647. };
  46648. c.util.ZPP_Vec2List.prototype = {
  46649. invalidate: function () {
  46650. this._invalidated = !0;
  46651. null != this._invalidate && this._invalidate(this)
  46652. },
  46653. validate: function () {
  46654. this._invalidated &&
  46655. (this._invalidated = !1, null != this._validate && this._validate())
  46656. },
  46657. modify_test: function () {
  46658. null != this._modifiable && this._modifiable()
  46659. },
  46660. modified: function () {
  46661. this.zip_length = !0;
  46662. this.push_ite = this.at_ite = null
  46663. },
  46664. valmod: function () {
  46665. this.validate();
  46666. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46667. },
  46668. __class__: c.util.ZPP_Vec2List
  46669. };
  46670. c.util.ZPP_GeomPolyList = function () {
  46671. this.user_length = 0;
  46672. this.zip_length = !1;
  46673. this.at_ite = this.push_ite =
  46674. null;
  46675. this.at_index = 0;
  46676. this.dontremove = this.reverse_flag = !1;
  46677. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46678. this.immutable = this._invalidated = !1;
  46679. this.outer = this.inner = null;
  46680. this.inner = new c.util.ZNPList_ZPP_GeomPoly;
  46681. this._invalidated = !0
  46682. };
  46683. s["zpp_nape.util.ZPP_GeomPolyList"] = c.util.ZPP_GeomPolyList;
  46684. c.util.ZPP_GeomPolyList.__name__ = ["zpp_nape", "util", "ZPP_GeomPolyList"];
  46685. c.util.ZPP_GeomPolyList.get = function (a, b) {
  46686. null == b && (b = !1);
  46687. var c = new h.geom.GeomPolyList;
  46688. c.zpp_inner.inner =
  46689. a;
  46690. b && (c.zpp_inner.immutable = !0);
  46691. c.zpp_inner.zip_length = !0;
  46692. return c
  46693. };
  46694. c.util.ZPP_GeomPolyList.prototype = {
  46695. invalidate: function () {
  46696. this._invalidated = !0;
  46697. null != this._invalidate && this._invalidate(this)
  46698. },
  46699. validate: function () {
  46700. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46701. },
  46702. modify_test: function () {
  46703. null != this._modifiable && this._modifiable()
  46704. },
  46705. modified: function () {
  46706. this.zip_length = !0;
  46707. this.push_ite = this.at_ite = null
  46708. },
  46709. valmod: function () {
  46710. this.validate();
  46711. this.inner.modified && (this.inner.pushmod &&
  46712. (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46713. },
  46714. __class__: c.util.ZPP_GeomPolyList
  46715. };
  46716. c.util.ZPP_RayResultList = function () {
  46717. this.user_length = 0;
  46718. this.zip_length = !1;
  46719. this.at_ite = this.push_ite = null;
  46720. this.at_index = 0;
  46721. this.dontremove = this.reverse_flag = !1;
  46722. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46723. this.immutable = this._invalidated = !1;
  46724. this.outer = this.inner = null;
  46725. this.inner = new c.util.ZNPList_RayResult;
  46726. this._invalidated = !0
  46727. };
  46728. s["zpp_nape.util.ZPP_RayResultList"] = c.util.ZPP_RayResultList;
  46729. c.util.ZPP_RayResultList.__name__ = ["zpp_nape", "util", "ZPP_RayResultList"];
  46730. c.util.ZPP_RayResultList.get = function (a, b) {
  46731. null == b && (b = !1);
  46732. var c = new h.geom.RayResultList;
  46733. c.zpp_inner.inner = a;
  46734. b && (c.zpp_inner.immutable = !0);
  46735. c.zpp_inner.zip_length = !0;
  46736. return c
  46737. };
  46738. c.util.ZPP_RayResultList.prototype = {
  46739. invalidate: function () {
  46740. this._invalidated = !0;
  46741. null != this._invalidate && this._invalidate(this)
  46742. },
  46743. validate: function () {
  46744. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46745. },
  46746. modify_test: function () {
  46747. null != this._modifiable && this._modifiable()
  46748. },
  46749. modified: function () {
  46750. this.zip_length = !0;
  46751. this.push_ite = this.at_ite = null
  46752. },
  46753. valmod: function () {
  46754. this.validate();
  46755. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46756. },
  46757. __class__: c.util.ZPP_RayResultList
  46758. };
  46759. c.util.ZPP_ConvexResultList = function () {
  46760. this.user_length = 0;
  46761. this.zip_length = !1;
  46762. this.at_ite = this.push_ite =
  46763. null;
  46764. this.at_index = 0;
  46765. this.dontremove = this.reverse_flag = !1;
  46766. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46767. this.immutable = this._invalidated = !1;
  46768. this.outer = this.inner = null;
  46769. this.inner = new c.util.ZNPList_ConvexResult;
  46770. this._invalidated = !0
  46771. };
  46772. s["zpp_nape.util.ZPP_ConvexResultList"] = c.util.ZPP_ConvexResultList;
  46773. c.util.ZPP_ConvexResultList.__name__ = ["zpp_nape", "util", "ZPP_ConvexResultList"];
  46774. c.util.ZPP_ConvexResultList.get = function (a, b) {
  46775. null == b && (b = !1);
  46776. var c = new h.geom.ConvexResultList;
  46777. c.zpp_inner.inner = a;
  46778. b && (c.zpp_inner.immutable = !0);
  46779. c.zpp_inner.zip_length = !0;
  46780. return c
  46781. };
  46782. c.util.ZPP_ConvexResultList.prototype = {
  46783. invalidate: function () {
  46784. this._invalidated = !0;
  46785. null != this._invalidate && this._invalidate(this)
  46786. },
  46787. validate: function () {
  46788. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46789. },
  46790. modify_test: function () {
  46791. null != this._modifiable && this._modifiable()
  46792. },
  46793. modified: function () {
  46794. this.zip_length = !0;
  46795. this.push_ite = this.at_ite = null
  46796. },
  46797. valmod: function () {
  46798. this.validate();
  46799. this.inner.modified &&
  46800. (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46801. },
  46802. __class__: c.util.ZPP_ConvexResultList
  46803. };
  46804. c.util.ZPP_EdgeList = function () {
  46805. this.user_length = 0;
  46806. this.zip_length = !1;
  46807. this.at_ite = this.push_ite = null;
  46808. this.at_index = 0;
  46809. this.dontremove = this.reverse_flag = !1;
  46810. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46811. this.immutable = this._invalidated = !1;
  46812. this.outer = this.inner = null;
  46813. this.inner = new c.util.ZNPList_ZPP_Edge;
  46814. this._invalidated = !0
  46815. };
  46816. s["zpp_nape.util.ZPP_EdgeList"] = c.util.ZPP_EdgeList;
  46817. c.util.ZPP_EdgeList.__name__ = ["zpp_nape", "util", "ZPP_EdgeList"];
  46818. c.util.ZPP_EdgeList.get = function (a, b) {
  46819. null == b && (b = !1);
  46820. var c = new h.shape.EdgeList;
  46821. c.zpp_inner.inner = a;
  46822. b && (c.zpp_inner.immutable = !0);
  46823. c.zpp_inner.zip_length = !0;
  46824. return c
  46825. };
  46826. c.util.ZPP_EdgeList.prototype = {
  46827. invalidate: function () {
  46828. this._invalidated = !0;
  46829. null != this._invalidate && this._invalidate(this)
  46830. },
  46831. validate: function () {
  46832. this._invalidated && (this._invalidated = !1, null != this._validate &&
  46833. this._validate())
  46834. },
  46835. modify_test: function () {
  46836. null != this._modifiable && this._modifiable()
  46837. },
  46838. modified: function () {
  46839. this.zip_length = !0;
  46840. this.push_ite = this.at_ite = null
  46841. },
  46842. valmod: function () {
  46843. this.validate();
  46844. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46845. },
  46846. __class__: c.util.ZPP_EdgeList
  46847. };
  46848. c.util.ZPP_ShapeList = function () {
  46849. this.user_length = 0;
  46850. this.zip_length = !1;
  46851. this.at_ite = this.push_ite = null;
  46852. this.at_index = 0;
  46853. this.dontremove =
  46854. this.reverse_flag = !1;
  46855. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46856. this.immutable = this._invalidated = !1;
  46857. this.outer = this.inner = null;
  46858. this.inner = new c.util.ZNPList_ZPP_Shape;
  46859. this._invalidated = !0
  46860. };
  46861. s["zpp_nape.util.ZPP_ShapeList"] = c.util.ZPP_ShapeList;
  46862. c.util.ZPP_ShapeList.__name__ = ["zpp_nape", "util", "ZPP_ShapeList"];
  46863. c.util.ZPP_ShapeList.get = function (a, b) {
  46864. null == b && (b = !1);
  46865. var c = new h.shape.ShapeList;
  46866. c.zpp_inner.inner = a;
  46867. b && (c.zpp_inner.immutable = !0);
  46868. c.zpp_inner.zip_length = !0;
  46869. return c
  46870. };
  46871. c.util.ZPP_ShapeList.prototype = {
  46872. invalidate: function () {
  46873. this._invalidated = !0;
  46874. null != this._invalidate && this._invalidate(this)
  46875. },
  46876. validate: function () {
  46877. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46878. },
  46879. modify_test: function () {
  46880. null != this._modifiable && this._modifiable()
  46881. },
  46882. modified: function () {
  46883. this.zip_length = !0;
  46884. this.push_ite = this.at_ite = null
  46885. },
  46886. valmod: function () {
  46887. this.validate();
  46888. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46889. },
  46890. __class__: c.util.ZPP_ShapeList
  46891. };
  46892. c.util.ZPP_InteractionGroupList = function () {
  46893. this.user_length = 0;
  46894. this.zip_length = !1;
  46895. this.at_ite = this.push_ite = null;
  46896. this.at_index = 0;
  46897. this.dontremove = this.reverse_flag = !1;
  46898. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46899. this.immutable = this._invalidated = !1;
  46900. this.outer = this.inner = null;
  46901. this.inner = new c.util.ZNPList_ZPP_InteractionGroup;
  46902. this._invalidated = !0
  46903. };
  46904. s["zpp_nape.util.ZPP_InteractionGroupList"] =
  46905. c.util.ZPP_InteractionGroupList;
  46906. c.util.ZPP_InteractionGroupList.__name__ = ["zpp_nape", "util", "ZPP_InteractionGroupList"];
  46907. c.util.ZPP_InteractionGroupList.get = function (a, b) {
  46908. null == b && (b = !1);
  46909. var c = new h.dynamics.InteractionGroupList;
  46910. c.zpp_inner.inner = a;
  46911. b && (c.zpp_inner.immutable = !0);
  46912. c.zpp_inner.zip_length = !0;
  46913. return c
  46914. };
  46915. c.util.ZPP_InteractionGroupList.prototype = {
  46916. invalidate: function () {
  46917. this._invalidated = !0;
  46918. null != this._invalidate && this._invalidate(this)
  46919. },
  46920. validate: function () {
  46921. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46922. },
  46923. modify_test: function () {
  46924. null != this._modifiable && this._modifiable()
  46925. },
  46926. modified: function () {
  46927. this.zip_length = !0;
  46928. this.push_ite = this.at_ite = null
  46929. },
  46930. valmod: function () {
  46931. this.validate();
  46932. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46933. },
  46934. __class__: c.util.ZPP_InteractionGroupList
  46935. };
  46936. c.util.ZPP_ArbiterList = function () {
  46937. this.user_length = 0;
  46938. this.zip_length = !1;
  46939. this.at_ite = this.push_ite =
  46940. null;
  46941. this.at_index = 0;
  46942. this.dontremove = this.reverse_flag = !1;
  46943. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46944. this.immutable = this._invalidated = !1;
  46945. this.outer = this.inner = null;
  46946. this.inner = new c.util.ZNPList_ZPP_Arbiter;
  46947. this._invalidated = !0
  46948. };
  46949. s["zpp_nape.util.ZPP_ArbiterList"] = c.util.ZPP_ArbiterList;
  46950. c.util.ZPP_ArbiterList.__name__ = ["zpp_nape", "util", "ZPP_ArbiterList"];
  46951. c.util.ZPP_ArbiterList.get = function (a, b) {
  46952. null == b && (b = !1);
  46953. var c = new h.dynamics.ArbiterList;
  46954. c.zpp_inner.inner =
  46955. a;
  46956. b && (c.zpp_inner.immutable = !0);
  46957. c.zpp_inner.zip_length = !0;
  46958. return c
  46959. };
  46960. c.util.ZPP_ArbiterList.prototype = {
  46961. invalidate: function () {
  46962. this._invalidated = !0;
  46963. null != this._invalidate && this._invalidate(this)
  46964. },
  46965. validate: function () {
  46966. this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
  46967. },
  46968. modify_test: function () {
  46969. null != this._modifiable && this._modifiable()
  46970. },
  46971. modified: function () {
  46972. this.zip_length = !0;
  46973. this.push_ite = this.at_ite = null
  46974. },
  46975. valmod: function () {
  46976. this.validate();
  46977. this.inner.modified && (this.inner.pushmod &&
  46978. (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  46979. },
  46980. __class__: c.util.ZPP_ArbiterList
  46981. };
  46982. c.util.ZPP_ContactList = function () {
  46983. this.user_length = 0;
  46984. this.zip_length = !1;
  46985. this.at_ite = this.push_ite = null;
  46986. this.at_index = 0;
  46987. this.dontremove = this.reverse_flag = !1;
  46988. this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
  46989. this.immutable = this._invalidated = !1;
  46990. this.outer = this.inner = null;
  46991. this.inner = new c.dynamics.ZPP_Contact;
  46992. this._invalidated = !0
  46993. };
  46994. s["zpp_nape.util.ZPP_ContactList"] = c.util.ZPP_ContactList;
  46995. c.util.ZPP_ContactList.__name__ = ["zpp_nape", "util", "ZPP_ContactList"];
  46996. c.util.ZPP_ContactList.get = function (a, b) {
  46997. null == b && (b = !1);
  46998. var c = new h.dynamics.ContactList;
  46999. c.zpp_inner.inner = a;
  47000. b && (c.zpp_inner.immutable = !0);
  47001. c.zpp_inner.zip_length = !0;
  47002. return c
  47003. };
  47004. c.util.ZPP_ContactList.prototype = {
  47005. invalidate: function () {
  47006. this._invalidated = !0;
  47007. null != this._invalidate && this._invalidate(this)
  47008. },
  47009. validate: function () {
  47010. this._invalidated && (this._invalidated = !1, null != this._validate &&
  47011. this._validate())
  47012. },
  47013. modify_test: function () {
  47014. null != this._modifiable && this._modifiable()
  47015. },
  47016. modified: function () {
  47017. this.zip_length = !0;
  47018. this.push_ite = this.at_ite = null
  47019. },
  47020. valmod: function () {
  47021. this.validate();
  47022. this.inner.modified && (this.inner.pushmod && (this.push_ite = null), this.at_ite = null, this.inner.modified = !1, this.inner.pushmod = !1, this.zip_length = !0)
  47023. },
  47024. __class__: c.util.ZPP_ContactList
  47025. };
  47026. c.util.ZPP_Math = function () {};
  47027. s["zpp_nape.util.ZPP_Math"] = c.util.ZPP_Math;
  47028. c.util.ZPP_Math.__name__ = ["zpp_nape", "util", "ZPP_Math"];
  47029. c.util.ZPP_Math.sqrt =
  47030. function (a) {
  47031. return Math.sqrt(a)
  47032. };
  47033. c.util.ZPP_Math.invsqrt = function (a) {
  47034. return 1 / Math.sqrt(a)
  47035. };
  47036. c.util.ZPP_Math.sqr = function (a) {
  47037. return a * a
  47038. };
  47039. c.util.ZPP_Math.clamp2 = function (a, b) {
  47040. return c.util.ZPP_Math.clamp(a, -b, b)
  47041. };
  47042. c.util.ZPP_Math.clamp = function (a, b, c) {
  47043. return a < b ? b : a > c ? c : a
  47044. };
  47045. c.util.ZPP_PubPool = function () {};
  47046. s["zpp_nape.util.ZPP_PubPool"] = c.util.ZPP_PubPool;
  47047. c.util.ZPP_PubPool.__name__ = ["zpp_nape", "util", "ZPP_PubPool"];
  47048. c.util.ZPP_Set_ZPP_Body = function () {
  47049. this.colour = 0;
  47050. this.lt = this.swapped = this.data = this.prev =
  47051. this.next = this.parent = null
  47052. };
  47053. s["zpp_nape.util.ZPP_Set_ZPP_Body"] = c.util.ZPP_Set_ZPP_Body;
  47054. c.util.ZPP_Set_ZPP_Body.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_Body"];
  47055. c.util.ZPP_Set_ZPP_Body.prototype = {
  47056. insert: function (a) {
  47057. var b;
  47058. null == c.util.ZPP_Set_ZPP_Body.zpp_pool ? b = new c.util.ZPP_Set_ZPP_Body : (b = c.util.ZPP_Set_ZPP_Body.zpp_pool, c.util.ZPP_Set_ZPP_Body.zpp_pool = b.next, b.next = null);
  47059. null;
  47060. b.data = a;
  47061. if (null == this.parent) this.parent = b;
  47062. else
  47063. for (a = this.parent;;)
  47064. if (this.lt(b.data, a.data))
  47065. if (null == a.prev) {
  47066. a.prev =
  47067. b;
  47068. b.parent = a;
  47069. break
  47070. } else a = a.prev;
  47071. else if (null == a.next) {
  47072. a.next = b;
  47073. b.parent = a;
  47074. break
  47075. } else a = a.next;
  47076. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47077. return b
  47078. },
  47079. try_insert: function (a) {
  47080. var b = null,
  47081. d = null;
  47082. if (null == this.parent) null == c.util.ZPP_Set_ZPP_Body.zpp_pool ? b = new c.util.ZPP_Set_ZPP_Body : (b = c.util.ZPP_Set_ZPP_Body.zpp_pool, c.util.ZPP_Set_ZPP_Body.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  47083. else
  47084. for (d = this.parent;;)
  47085. if (this.lt(a, d.data))
  47086. if (null == d.prev) {
  47087. null ==
  47088. c.util.ZPP_Set_ZPP_Body.zpp_pool ? b = new c.util.ZPP_Set_ZPP_Body : (b = c.util.ZPP_Set_ZPP_Body.zpp_pool, c.util.ZPP_Set_ZPP_Body.zpp_pool = b.next, b.next = null);
  47089. null;
  47090. b.data = a;
  47091. d.prev = b;
  47092. b.parent = d;
  47093. break
  47094. } else d = d.prev;
  47095. else if (this.lt(d.data, a))
  47096. if (null == d.next) {
  47097. null == c.util.ZPP_Set_ZPP_Body.zpp_pool ? b = new c.util.ZPP_Set_ZPP_Body : (b = c.util.ZPP_Set_ZPP_Body.zpp_pool, c.util.ZPP_Set_ZPP_Body.zpp_pool = b.next, b.next = null);
  47098. null;
  47099. b.data = a;
  47100. d.next = b;
  47101. b.parent = d;
  47102. break
  47103. } else d = d.next;
  47104. else break; if (null == b) return d;
  47105. null == b.parent ?
  47106. b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47107. return b
  47108. },
  47109. try_insert_bool: function (a) {
  47110. var b = null,
  47111. d = null;
  47112. if (null == this.parent) null == c.util.ZPP_Set_ZPP_Body.zpp_pool ? b = new c.util.ZPP_Set_ZPP_Body : (b = c.util.ZPP_Set_ZPP_Body.zpp_pool, c.util.ZPP_Set_ZPP_Body.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  47113. else
  47114. for (d = this.parent;;)
  47115. if (this.lt(a, d.data))
  47116. if (null == d.prev) {
  47117. null == c.util.ZPP_Set_ZPP_Body.zpp_pool ? b = new c.util.ZPP_Set_ZPP_Body : (b = c.util.ZPP_Set_ZPP_Body.zpp_pool, c.util.ZPP_Set_ZPP_Body.zpp_pool =
  47118. b.next, b.next = null);
  47119. null;
  47120. b.data = a;
  47121. d.prev = b;
  47122. b.parent = d;
  47123. break
  47124. } else d = d.prev;
  47125. else if (this.lt(d.data, a))
  47126. if (null == d.next) {
  47127. null == c.util.ZPP_Set_ZPP_Body.zpp_pool ? b = new c.util.ZPP_Set_ZPP_Body : (b = c.util.ZPP_Set_ZPP_Body.zpp_pool, c.util.ZPP_Set_ZPP_Body.zpp_pool = b.next, b.next = null);
  47128. null;
  47129. b.data = a;
  47130. d.next = b;
  47131. b.parent = d;
  47132. break
  47133. } else d = d.next;
  47134. else break; if (null == b) return !1;
  47135. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47136. return !0
  47137. },
  47138. __fix_dbl_red: function (a) {
  47139. for (;;) {
  47140. var b = a.parent,
  47141. c =
  47142. b.parent;
  47143. if (null == c) {
  47144. b.colour = 1;
  47145. break
  47146. }
  47147. var g, e, f, h, k, n, p;
  47148. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next, p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p = a.next));
  47149. a = c.parent;
  47150. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  47151. null != e && (e.parent = a);
  47152. g.prev = h;
  47153. null != h && (h.parent = g);
  47154. g.next = k;
  47155. null != k && (k.parent = g);
  47156. e.prev = g;
  47157. null != g && (g.parent = e);
  47158. e.next = f;
  47159. null != f && (f.parent = e);
  47160. f.prev = n;
  47161. null != n && (n.parent = f);
  47162. f.next = p;
  47163. null != p && (p.parent = f);
  47164. e.colour = c.colour - 1;
  47165. g.colour = 1;
  47166. f.colour = 1;
  47167. if (e == this.parent) this.parent.colour = 1;
  47168. else if (0 == e.colour && 0 == e.parent.colour) {
  47169. a = e;
  47170. continue
  47171. }
  47172. break
  47173. }
  47174. },
  47175. __fix_neg_red: function (a) {
  47176. var b = a.parent,
  47177. c = b.prev == a ? function (c) {
  47178. var d = a.prev,
  47179. f = a.next,
  47180. h = f.prev,
  47181. k = f.next;
  47182. d.colour = 0;
  47183. a.colour = b.colour = 1;
  47184. a.next = h;
  47185. null != h && (h.parent = a);
  47186. h = b.data;
  47187. b.data = f.data;
  47188. f.data = h;
  47189. null != c.swapped && c.swapped(b.data, f.data);
  47190. f.prev = k;
  47191. null != k && (k.parent = f);
  47192. f.next = b.next;
  47193. null != b.next && (b.next.parent = f);
  47194. b.next = f;
  47195. null != f && (f.parent = b);
  47196. return d
  47197. }(this) : function (c) {
  47198. var d = a.next,
  47199. f = a.prev,
  47200. h = f.next,
  47201. k = f.prev;
  47202. d.colour = 0;
  47203. a.colour = b.colour = 1;
  47204. a.prev = h;
  47205. null != h && (h.parent = a);
  47206. h = b.data;
  47207. b.data = f.data;
  47208. f.data = h;
  47209. null != c.swapped && c.swapped(b.data, f.data);
  47210. f.next = k;
  47211. null != k && (k.parent = f);
  47212. f.prev = b.prev;
  47213. null != b.prev && (b.prev.parent = f);
  47214. b.prev = f;
  47215. null != f && (f.parent = b);
  47216. return d
  47217. }(this);
  47218. null != c.prev && 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  47219. },
  47220. clear_node: function (a, b) {
  47221. b(a.data);
  47222. var d = a.parent;
  47223. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  47224. a.data = null;
  47225. a.lt = null;
  47226. a.swapped = null;
  47227. a.next = c.util.ZPP_Set_ZPP_Body.zpp_pool;
  47228. c.util.ZPP_Set_ZPP_Body.zpp_pool = a;
  47229. return d
  47230. },
  47231. clear_with: function (a) {
  47232. if (null != this.parent) {
  47233. for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  47234. this.parent = null
  47235. }
  47236. },
  47237. clear: function () {
  47238. this.clear_with(function (a) {})
  47239. },
  47240. remove_node: function (a) {
  47241. if (null != a.next && null != a.prev) {
  47242. for (var b = a.next; null != b.prev;) b = b.prev;
  47243. var d =
  47244. a.data;
  47245. a.data = b.data;
  47246. b.data = d;
  47247. null != this.swapped && this.swapped(a.data, b.data);
  47248. a = b
  47249. }
  47250. b = null == a.prev ? a.next : a.prev;
  47251. if (1 == a.colour)
  47252. if (null != a.prev || null != a.next) b.colour = 1;
  47253. else if (null != a.parent)
  47254. for (d = a.parent;;) {
  47255. d.colour++;
  47256. d.prev.colour--;
  47257. d.next.colour--;
  47258. var g = d.prev;
  47259. if (-1 == g.colour) {
  47260. this.__fix_neg_red(g);
  47261. break
  47262. } else if (0 == g.colour) {
  47263. if (null != g.prev && 0 == g.prev.colour) {
  47264. this.__fix_dbl_red(g.prev);
  47265. break
  47266. }
  47267. if (null != g.next && 0 == g.next.colour) {
  47268. this.__fix_dbl_red(g.next);
  47269. break
  47270. }
  47271. }
  47272. g = d.next;
  47273. if (-1 == g.colour) {
  47274. this.__fix_neg_red(g);
  47275. break
  47276. } else if (0 == g.colour) {
  47277. if (null != g.prev && 0 == g.prev.colour) {
  47278. this.__fix_dbl_red(g.prev);
  47279. break
  47280. }
  47281. if (null != g.next && 0 == g.next.colour) {
  47282. this.__fix_dbl_red(g.next);
  47283. break
  47284. }
  47285. }
  47286. if (2 == d.colour)
  47287. if (null == d.parent) d.colour = 1;
  47288. else {
  47289. d = d.parent;
  47290. continue
  47291. }
  47292. break
  47293. }
  47294. d = a.parent;
  47295. null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  47296. null != b && (b.parent = d);
  47297. a.parent = a.prev = a.next = null;
  47298. a.data = null;
  47299. a.lt = null;
  47300. a.swapped = null;
  47301. a.next = c.util.ZPP_Set_ZPP_Body.zpp_pool;
  47302. c.util.ZPP_Set_ZPP_Body.zpp_pool = a
  47303. },
  47304. predecessor: function (a) {
  47305. a = this.predecessor_node(this.find(a));
  47306. return null == a ? null : a.data
  47307. },
  47308. successor: function (a) {
  47309. a = this.successor_node(this.find(a));
  47310. return null == a ? null : a.data
  47311. },
  47312. predecessor_node: function (a) {
  47313. if (null != a.prev)
  47314. for (a = a.prev; null != a.next;) a = a.next;
  47315. else {
  47316. var b = a;
  47317. for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
  47318. }
  47319. return a
  47320. },
  47321. successor_node: function (a) {
  47322. if (null != a.next)
  47323. for (a = a.next; null != a.prev;) a = a.prev;
  47324. else {
  47325. var b = a;
  47326. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  47327. }
  47328. return a
  47329. },
  47330. remove: function (a) {
  47331. a = this.find(a);
  47332. this.remove_node(a)
  47333. },
  47334. pop_front: function () {
  47335. for (var a =
  47336. this.parent; null != a.prev;) a = a.prev;
  47337. var b = a.data;
  47338. this.remove_node(a);
  47339. return b
  47340. },
  47341. first: function () {
  47342. for (var a = this.parent; null != a.prev;) a = a.prev;
  47343. return a.data
  47344. },
  47345. lower_bound: function (a) {
  47346. var b = null;
  47347. if (!this.empty()) {
  47348. for (var c = this.parent; null != c.prev;) c = c.prev;
  47349. for (; null != c;) {
  47350. var g = c.data;
  47351. if (!this.lt(g, a)) {
  47352. b = g;
  47353. break
  47354. }
  47355. if (null != c.next)
  47356. for (c = c.next; null != c.prev;) c = c.prev;
  47357. else {
  47358. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  47359. c = c.parent
  47360. }
  47361. }
  47362. }
  47363. return b
  47364. },
  47365. find_weak: function (a) {
  47366. for (var b = this.parent; null != b;)
  47367. if (this.lt(a,
  47368. b.data)) b = b.prev;
  47369. else if (this.lt(b.data, a)) b = b.next;
  47370. else break;
  47371. return b
  47372. },
  47373. has_weak: function (a) {
  47374. return null != this.find_weak(a)
  47375. },
  47376. find: function (a) {
  47377. for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
  47378. return b
  47379. },
  47380. has: function (a) {
  47381. return null != this.find(a)
  47382. },
  47383. size: function () {
  47384. var a = 0;
  47385. if (!this.empty()) {
  47386. for (var b = this.parent; null != b.prev;) b = b.prev;
  47387. for (; null != b;)
  47388. if (a++, null != b.next)
  47389. for (b = b.next; null != b.prev;) b = b.prev;
  47390. else {
  47391. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  47392. b = b.parent
  47393. }
  47394. }
  47395. return a
  47396. },
  47397. singular: function () {
  47398. return null != this.parent && null == this.parent.prev && null == this.parent.next
  47399. },
  47400. empty: function () {
  47401. return null == this.parent
  47402. },
  47403. verify: function () {
  47404. if (!this.empty()) {
  47405. for (var a = this.parent; null != a.prev;) a = a.prev;
  47406. for (; null != a;) {
  47407. var b = a.data,
  47408. c = !0;
  47409. if (!this.empty()) {
  47410. for (var g = this.parent; null != g.prev;) g = g.prev;
  47411. for (; null != g;) {
  47412. var e = g.data;
  47413. if (!c) {
  47414. if (!this.lt(b, e) && this.lt(e, b)) return !1
  47415. } else if (b == e) c = !1;
  47416. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  47417. if (null != g.next)
  47418. for (g = g.next; null != g.prev;) g = g.prev;
  47419. else {
  47420. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  47421. g = g.parent
  47422. }
  47423. }
  47424. }
  47425. if (null != a.next)
  47426. for (a = a.next; null != a.prev;) a = a.prev;
  47427. else {
  47428. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  47429. a = a.parent
  47430. }
  47431. }
  47432. }
  47433. return !0
  47434. },
  47435. alloc: function () {},
  47436. free: function () {
  47437. this.swapped = this.lt = this.data = null
  47438. },
  47439. __class__: c.util.ZPP_Set_ZPP_Body
  47440. };
  47441. c.util.ZPP_Set_ZPP_CbSetPair = function () {
  47442. this.colour = 0;
  47443. this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
  47444. };
  47445. s["zpp_nape.util.ZPP_Set_ZPP_CbSetPair"] = c.util.ZPP_Set_ZPP_CbSetPair;
  47446. c.util.ZPP_Set_ZPP_CbSetPair.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_CbSetPair"];
  47447. c.util.ZPP_Set_ZPP_CbSetPair.prototype = {
  47448. insert: function (a) {
  47449. var b;
  47450. null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSetPair : (b = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = b.next, b.next = null);
  47451. null;
  47452. b.data = a;
  47453. if (null == this.parent) this.parent = b;
  47454. else
  47455. for (a = this.parent;;)
  47456. if (this.lt(b.data, a.data))
  47457. if (null == a.prev) {
  47458. a.prev = b;
  47459. b.parent = a;
  47460. break
  47461. } else a = a.prev;
  47462. else if (null == a.next) {
  47463. a.next = b;
  47464. b.parent = a;
  47465. break
  47466. } else a = a.next;
  47467. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47468. return b
  47469. },
  47470. try_insert: function (a) {
  47471. var b = null,
  47472. d = null;
  47473. if (null == this.parent) null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSetPair : (b = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  47474. else
  47475. for (d = this.parent;;)
  47476. if (this.lt(a, d.data))
  47477. if (null == d.prev) {
  47478. null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSetPair :
  47479. (b = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = b.next, b.next = null);
  47480. null;
  47481. b.data = a;
  47482. d.prev = b;
  47483. b.parent = d;
  47484. break
  47485. } else d = d.prev;
  47486. else if (this.lt(d.data, a))
  47487. if (null == d.next) {
  47488. null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSetPair : (b = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = b.next, b.next = null);
  47489. null;
  47490. b.data = a;
  47491. d.next = b;
  47492. b.parent = d;
  47493. break
  47494. } else d = d.next;
  47495. else break; if (null == b) return d;
  47496. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour &&
  47497. this.__fix_dbl_red(b));
  47498. return b
  47499. },
  47500. try_insert_bool: function (a) {
  47501. var b = null,
  47502. d = null;
  47503. if (null == this.parent) null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSetPair : (b = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  47504. else
  47505. for (d = this.parent;;)
  47506. if (this.lt(a, d.data))
  47507. if (null == d.prev) {
  47508. null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSetPair : (b = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool =
  47509. b.next, b.next = null);
  47510. null;
  47511. b.data = a;
  47512. d.prev = b;
  47513. b.parent = d;
  47514. break
  47515. } else d = d.prev;
  47516. else if (this.lt(d.data, a))
  47517. if (null == d.next) {
  47518. null == c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSetPair : (b = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool, c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = b.next, b.next = null);
  47519. null;
  47520. b.data = a;
  47521. d.next = b;
  47522. b.parent = d;
  47523. break
  47524. } else d = d.next;
  47525. else break; if (null == b) return !1;
  47526. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47527. return !0
  47528. },
  47529. __fix_dbl_red: function (a) {
  47530. for (;;) {
  47531. var b =
  47532. a.parent,
  47533. c = b.parent;
  47534. if (null == c) {
  47535. b.colour = 1;
  47536. break
  47537. }
  47538. var g, e, f, h, k, n, p;
  47539. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next, p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p = a.next));
  47540. a = c.parent;
  47541. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  47542. null != e && (e.parent = a);
  47543. g.prev = h;
  47544. null != h && (h.parent = g);
  47545. g.next = k;
  47546. null != k && (k.parent = g);
  47547. e.prev = g;
  47548. null != g && (g.parent = e);
  47549. e.next = f;
  47550. null != f && (f.parent = e);
  47551. f.prev = n;
  47552. null != n && (n.parent =
  47553. f);
  47554. f.next = p;
  47555. null != p && (p.parent = f);
  47556. e.colour = c.colour - 1;
  47557. g.colour = 1;
  47558. f.colour = 1;
  47559. if (e == this.parent) this.parent.colour = 1;
  47560. else if (0 == e.colour && 0 == e.parent.colour) {
  47561. a = e;
  47562. continue
  47563. }
  47564. break
  47565. }
  47566. },
  47567. __fix_neg_red: function (a) {
  47568. var b = a.parent,
  47569. c = b.prev == a ? function (c) {
  47570. var d = a.prev,
  47571. f = a.next,
  47572. h = f.prev,
  47573. k = f.next;
  47574. d.colour = 0;
  47575. a.colour = b.colour = 1;
  47576. a.next = h;
  47577. null != h && (h.parent = a);
  47578. h = b.data;
  47579. b.data = f.data;
  47580. f.data = h;
  47581. null != c.swapped && c.swapped(b.data, f.data);
  47582. f.prev = k;
  47583. null != k && (k.parent = f);
  47584. f.next = b.next;
  47585. null != b.next && (b.next.parent = f);
  47586. b.next =
  47587. f;
  47588. null != f && (f.parent = b);
  47589. return d
  47590. }(this) : function (c) {
  47591. var d = a.next,
  47592. f = a.prev,
  47593. h = f.next,
  47594. k = f.prev;
  47595. d.colour = 0;
  47596. a.colour = b.colour = 1;
  47597. a.prev = h;
  47598. null != h && (h.parent = a);
  47599. h = b.data;
  47600. b.data = f.data;
  47601. f.data = h;
  47602. null != c.swapped && c.swapped(b.data, f.data);
  47603. f.next = k;
  47604. null != k && (k.parent = f);
  47605. f.prev = b.prev;
  47606. null != b.prev && (b.prev.parent = f);
  47607. b.prev = f;
  47608. null != f && (f.parent = b);
  47609. return d
  47610. }(this);
  47611. null != c.prev && 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  47612. },
  47613. clear_node: function (a, b) {
  47614. b(a.data);
  47615. var d = a.parent;
  47616. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  47617. a.data = null;
  47618. a.lt = null;
  47619. a.swapped = null;
  47620. a.next = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool;
  47621. c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = a;
  47622. return d
  47623. },
  47624. clear_with: function (a) {
  47625. if (null != this.parent) {
  47626. for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  47627. this.parent = null
  47628. }
  47629. },
  47630. clear: function () {
  47631. this.clear_with(function (a) {})
  47632. },
  47633. remove_node: function (a) {
  47634. if (null != a.next && null != a.prev) {
  47635. for (var b = a.next; null != b.prev;) b =
  47636. b.prev;
  47637. var d = a.data;
  47638. a.data = b.data;
  47639. b.data = d;
  47640. null != this.swapped && this.swapped(a.data, b.data);
  47641. a = b
  47642. }
  47643. b = null == a.prev ? a.next : a.prev;
  47644. if (1 == a.colour)
  47645. if (null != a.prev || null != a.next) b.colour = 1;
  47646. else if (null != a.parent)
  47647. for (d = a.parent;;) {
  47648. d.colour++;
  47649. d.prev.colour--;
  47650. d.next.colour--;
  47651. var g = d.prev;
  47652. if (-1 == g.colour) {
  47653. this.__fix_neg_red(g);
  47654. break
  47655. } else if (0 == g.colour) {
  47656. if (null != g.prev && 0 == g.prev.colour) {
  47657. this.__fix_dbl_red(g.prev);
  47658. break
  47659. }
  47660. if (null != g.next && 0 == g.next.colour) {
  47661. this.__fix_dbl_red(g.next);
  47662. break
  47663. }
  47664. }
  47665. g = d.next;
  47666. if (-1 == g.colour) {
  47667. this.__fix_neg_red(g);
  47668. break
  47669. } else if (0 == g.colour) {
  47670. if (null != g.prev && 0 == g.prev.colour) {
  47671. this.__fix_dbl_red(g.prev);
  47672. break
  47673. }
  47674. if (null != g.next && 0 == g.next.colour) {
  47675. this.__fix_dbl_red(g.next);
  47676. break
  47677. }
  47678. }
  47679. if (2 == d.colour)
  47680. if (null == d.parent) d.colour = 1;
  47681. else {
  47682. d = d.parent;
  47683. continue
  47684. }
  47685. break
  47686. }
  47687. d = a.parent;
  47688. null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  47689. null != b && (b.parent = d);
  47690. a.parent = a.prev = a.next = null;
  47691. a.data = null;
  47692. a.lt = null;
  47693. a.swapped = null;
  47694. a.next = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool;
  47695. c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = a
  47696. },
  47697. predecessor: function (a) {
  47698. a = this.predecessor_node(this.find(a));
  47699. return null == a ? null : a.data
  47700. },
  47701. successor: function (a) {
  47702. a = this.successor_node(this.find(a));
  47703. return null == a ? null : a.data
  47704. },
  47705. predecessor_node: function (a) {
  47706. if (null != a.prev)
  47707. for (a = a.prev; null != a.next;) a = a.next;
  47708. else {
  47709. var b = a;
  47710. for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
  47711. }
  47712. return a
  47713. },
  47714. successor_node: function (a) {
  47715. if (null != a.next)
  47716. for (a = a.next; null != a.prev;) a = a.prev;
  47717. else {
  47718. var b = a;
  47719. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  47720. }
  47721. return a
  47722. },
  47723. remove: function (a) {
  47724. a = this.find(a);
  47725. this.remove_node(a)
  47726. },
  47727. pop_front: function () {
  47728. for (var a =
  47729. this.parent; null != a.prev;) a = a.prev;
  47730. var b = a.data;
  47731. this.remove_node(a);
  47732. return b
  47733. },
  47734. first: function () {
  47735. for (var a = this.parent; null != a.prev;) a = a.prev;
  47736. return a.data
  47737. },
  47738. lower_bound: function (a) {
  47739. var b = null;
  47740. if (!this.empty()) {
  47741. for (var c = this.parent; null != c.prev;) c = c.prev;
  47742. for (; null != c;) {
  47743. var g = c.data;
  47744. if (!this.lt(g, a)) {
  47745. b = g;
  47746. break
  47747. }
  47748. if (null != c.next)
  47749. for (c = c.next; null != c.prev;) c = c.prev;
  47750. else {
  47751. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  47752. c = c.parent
  47753. }
  47754. }
  47755. }
  47756. return b
  47757. },
  47758. find_weak: function (a) {
  47759. for (var b = this.parent; null != b;)
  47760. if (this.lt(a,
  47761. b.data)) b = b.prev;
  47762. else if (this.lt(b.data, a)) b = b.next;
  47763. else break;
  47764. return b
  47765. },
  47766. has_weak: function (a) {
  47767. return null != this.find_weak(a)
  47768. },
  47769. find: function (a) {
  47770. for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
  47771. return b
  47772. },
  47773. has: function (a) {
  47774. return null != this.find(a)
  47775. },
  47776. size: function () {
  47777. var a = 0;
  47778. if (!this.empty()) {
  47779. for (var b = this.parent; null != b.prev;) b = b.prev;
  47780. for (; null != b;)
  47781. if (a++, null != b.next)
  47782. for (b = b.next; null != b.prev;) b = b.prev;
  47783. else {
  47784. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  47785. b = b.parent
  47786. }
  47787. }
  47788. return a
  47789. },
  47790. singular: function () {
  47791. return null != this.parent && null == this.parent.prev && null == this.parent.next
  47792. },
  47793. empty: function () {
  47794. return null == this.parent
  47795. },
  47796. verify: function () {
  47797. if (!this.empty()) {
  47798. for (var a = this.parent; null != a.prev;) a = a.prev;
  47799. for (; null != a;) {
  47800. var b = a.data,
  47801. c = !0;
  47802. if (!this.empty()) {
  47803. for (var g = this.parent; null != g.prev;) g = g.prev;
  47804. for (; null != g;) {
  47805. var e = g.data;
  47806. if (!c) {
  47807. if (!this.lt(b, e) && this.lt(e, b)) return !1
  47808. } else if (b == e) c = !1;
  47809. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  47810. if (null != g.next)
  47811. for (g = g.next; null != g.prev;) g = g.prev;
  47812. else {
  47813. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  47814. g = g.parent
  47815. }
  47816. }
  47817. }
  47818. if (null != a.next)
  47819. for (a = a.next; null != a.prev;) a = a.prev;
  47820. else {
  47821. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  47822. a = a.parent
  47823. }
  47824. }
  47825. }
  47826. return !0
  47827. },
  47828. alloc: function () {},
  47829. free: function () {
  47830. this.swapped = this.lt = this.data = null
  47831. },
  47832. __class__: c.util.ZPP_Set_ZPP_CbSetPair
  47833. };
  47834. c.util.ZPP_Set_ZPP_PartitionVertex = function () {
  47835. this.colour = 0;
  47836. this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
  47837. };
  47838. s["zpp_nape.util.ZPP_Set_ZPP_PartitionVertex"] = c.util.ZPP_Set_ZPP_PartitionVertex;
  47839. c.util.ZPP_Set_ZPP_PartitionVertex.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_PartitionVertex"];
  47840. c.util.ZPP_Set_ZPP_PartitionVertex.prototype = {
  47841. insert: function (a) {
  47842. var b;
  47843. null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionVertex : (b = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = b.next, b.next = null);
  47844. null;
  47845. b.data = a;
  47846. if (null == this.parent) this.parent = b;
  47847. else
  47848. for (a = this.parent;;)
  47849. if (this.lt(b.data, a.data))
  47850. if (null == a.prev) {
  47851. a.prev = b;
  47852. b.parent =
  47853. a;
  47854. break
  47855. } else a = a.prev;
  47856. else if (null == a.next) {
  47857. a.next = b;
  47858. b.parent = a;
  47859. break
  47860. } else a = a.next;
  47861. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47862. return b
  47863. },
  47864. try_insert: function (a) {
  47865. var b = null,
  47866. d = null;
  47867. if (null == this.parent) null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionVertex : (b = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  47868. else
  47869. for (d = this.parent;;)
  47870. if (this.lt(a,
  47871. d.data))
  47872. if (null == d.prev) {
  47873. null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionVertex : (b = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = b.next, b.next = null);
  47874. null;
  47875. b.data = a;
  47876. d.prev = b;
  47877. b.parent = d;
  47878. break
  47879. } else d = d.prev;
  47880. else if (this.lt(d.data, a))
  47881. if (null == d.next) {
  47882. null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionVertex : (b = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool =
  47883. b.next, b.next = null);
  47884. null;
  47885. b.data = a;
  47886. d.next = b;
  47887. b.parent = d;
  47888. break
  47889. } else d = d.next;
  47890. else break; if (null == b) return d;
  47891. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47892. return b
  47893. },
  47894. try_insert_bool: function (a) {
  47895. var b = null,
  47896. d = null;
  47897. if (null == this.parent) null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionVertex : (b = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  47898. else
  47899. for (d =
  47900. this.parent;;)
  47901. if (this.lt(a, d.data))
  47902. if (null == d.prev) {
  47903. null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionVertex : (b = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = b.next, b.next = null);
  47904. null;
  47905. b.data = a;
  47906. d.prev = b;
  47907. b.parent = d;
  47908. break
  47909. } else d = d.prev;
  47910. else if (this.lt(d.data, a))
  47911. if (null == d.next) {
  47912. null == c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionVertex : (b = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool, c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool =
  47913. b.next, b.next = null);
  47914. null;
  47915. b.data = a;
  47916. d.next = b;
  47917. b.parent = d;
  47918. break
  47919. } else d = d.next;
  47920. else break; if (null == b) return !1;
  47921. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  47922. return !0
  47923. },
  47924. __fix_dbl_red: function (a) {
  47925. for (;;) {
  47926. var b = a.parent,
  47927. c = b.parent;
  47928. if (null == c) {
  47929. b.colour = 1;
  47930. break
  47931. }
  47932. var g, e, f, h, k, n, p;
  47933. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next, p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p =
  47934. a.next));
  47935. a = c.parent;
  47936. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  47937. null != e && (e.parent = a);
  47938. g.prev = h;
  47939. null != h && (h.parent = g);
  47940. g.next = k;
  47941. null != k && (k.parent = g);
  47942. e.prev = g;
  47943. null != g && (g.parent = e);
  47944. e.next = f;
  47945. null != f && (f.parent = e);
  47946. f.prev = n;
  47947. null != n && (n.parent = f);
  47948. f.next = p;
  47949. null != p && (p.parent = f);
  47950. e.colour = c.colour - 1;
  47951. g.colour = 1;
  47952. f.colour = 1;
  47953. if (e == this.parent) this.parent.colour = 1;
  47954. else if (0 == e.colour && 0 == e.parent.colour) {
  47955. a = e;
  47956. continue
  47957. }
  47958. break
  47959. }
  47960. },
  47961. __fix_neg_red: function (a) {
  47962. var b = a.parent,
  47963. c = b.prev == a ? function (c) {
  47964. var d = a.prev,
  47965. f =
  47966. a.next,
  47967. h = f.prev,
  47968. k = f.next;
  47969. d.colour = 0;
  47970. a.colour = b.colour = 1;
  47971. a.next = h;
  47972. null != h && (h.parent = a);
  47973. h = b.data;
  47974. b.data = f.data;
  47975. f.data = h;
  47976. null != c.swapped && c.swapped(b.data, f.data);
  47977. f.prev = k;
  47978. null != k && (k.parent = f);
  47979. f.next = b.next;
  47980. null != b.next && (b.next.parent = f);
  47981. b.next = f;
  47982. null != f && (f.parent = b);
  47983. return d
  47984. }(this) : function (c) {
  47985. var d = a.next,
  47986. f = a.prev,
  47987. h = f.next,
  47988. k = f.prev;
  47989. d.colour = 0;
  47990. a.colour = b.colour = 1;
  47991. a.prev = h;
  47992. null != h && (h.parent = a);
  47993. h = b.data;
  47994. b.data = f.data;
  47995. f.data = h;
  47996. null != c.swapped && c.swapped(b.data, f.data);
  47997. f.next = k;
  47998. null != k && (k.parent =
  47999. f);
  48000. f.prev = b.prev;
  48001. null != b.prev && (b.prev.parent = f);
  48002. b.prev = f;
  48003. null != f && (f.parent = b);
  48004. return d
  48005. }(this);
  48006. null != c.prev && 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  48007. },
  48008. clear_node: function (a, b) {
  48009. b(a.data);
  48010. var d = a.parent;
  48011. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  48012. a.data = null;
  48013. a.lt = null;
  48014. a.swapped = null;
  48015. a.next = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool;
  48016. c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = a;
  48017. return d
  48018. },
  48019. clear_with: function (a) {
  48020. if (null != this.parent) {
  48021. for (var b =
  48022. this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  48023. this.parent = null
  48024. }
  48025. },
  48026. clear: function () {
  48027. this.clear_with(function (a) {})
  48028. },
  48029. remove_node: function (a) {
  48030. if (null != a.next && null != a.prev) {
  48031. for (var b = a.next; null != b.prev;) b = b.prev;
  48032. var d = a.data;
  48033. a.data = b.data;
  48034. b.data = d;
  48035. null != this.swapped && this.swapped(a.data, b.data);
  48036. a = b
  48037. }
  48038. b = null == a.prev ? a.next : a.prev;
  48039. if (1 == a.colour)
  48040. if (null != a.prev || null != a.next) b.colour = 1;
  48041. else if (null != a.parent)
  48042. for (d = a.parent;;) {
  48043. d.colour++;
  48044. d.prev.colour--;
  48045. d.next.colour--;
  48046. var g = d.prev;
  48047. if (-1 == g.colour) {
  48048. this.__fix_neg_red(g);
  48049. break
  48050. } else if (0 == g.colour) {
  48051. if (null != g.prev && 0 == g.prev.colour) {
  48052. this.__fix_dbl_red(g.prev);
  48053. break
  48054. }
  48055. if (null != g.next && 0 == g.next.colour) {
  48056. this.__fix_dbl_red(g.next);
  48057. break
  48058. }
  48059. }
  48060. g = d.next;
  48061. if (-1 == g.colour) {
  48062. this.__fix_neg_red(g);
  48063. break
  48064. } else if (0 == g.colour) {
  48065. if (null != g.prev && 0 == g.prev.colour) {
  48066. this.__fix_dbl_red(g.prev);
  48067. break
  48068. }
  48069. if (null != g.next && 0 == g.next.colour) {
  48070. this.__fix_dbl_red(g.next);
  48071. break
  48072. }
  48073. }
  48074. if (2 == d.colour)
  48075. if (null == d.parent) d.colour = 1;
  48076. else {
  48077. d = d.parent;
  48078. continue
  48079. }
  48080. break
  48081. }
  48082. d =
  48083. a.parent;
  48084. null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  48085. null != b && (b.parent = d);
  48086. a.parent = a.prev = a.next = null;
  48087. a.data = null;
  48088. a.lt = null;
  48089. a.swapped = null;
  48090. a.next = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool;
  48091. c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = a
  48092. },
  48093. predecessor: function (a) {
  48094. a = this.predecessor_node(this.find(a));
  48095. return null == a ? null : a.data
  48096. },
  48097. successor: function (a) {
  48098. a = this.successor_node(this.find(a));
  48099. return null == a ? null : a.data
  48100. },
  48101. predecessor_node: function (a) {
  48102. if (null != a.prev)
  48103. for (a = a.prev; null != a.next;) a = a.next;
  48104. else {
  48105. var b = a;
  48106. for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
  48107. }
  48108. return a
  48109. },
  48110. successor_node: function (a) {
  48111. if (null != a.next)
  48112. for (a = a.next; null != a.prev;) a = a.prev;
  48113. else {
  48114. var b = a;
  48115. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  48116. }
  48117. return a
  48118. },
  48119. remove: function (a) {
  48120. a = this.find(a);
  48121. this.remove_node(a)
  48122. },
  48123. pop_front: function () {
  48124. for (var a = this.parent; null != a.prev;) a = a.prev;
  48125. var b = a.data;
  48126. this.remove_node(a);
  48127. return b
  48128. },
  48129. first: function () {
  48130. for (var a = this.parent; null != a.prev;) a = a.prev;
  48131. return a.data
  48132. },
  48133. lower_bound: function (a) {
  48134. var b = null;
  48135. if (!this.empty()) {
  48136. for (var c = this.parent; null != c.prev;) c = c.prev;
  48137. for (; null != c;) {
  48138. var g = c.data;
  48139. if (!this.lt(g, a)) {
  48140. b = g;
  48141. break
  48142. }
  48143. if (null != c.next)
  48144. for (c = c.next; null != c.prev;) c = c.prev;
  48145. else {
  48146. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  48147. c = c.parent
  48148. }
  48149. }
  48150. }
  48151. return b
  48152. },
  48153. find_weak: function (a) {
  48154. for (var b = this.parent; null != b;)
  48155. if (this.lt(a, b.data)) b = b.prev;
  48156. else if (this.lt(b.data, a)) b = b.next;
  48157. else break;
  48158. return b
  48159. },
  48160. has_weak: function (a) {
  48161. return null != this.find_weak(a)
  48162. },
  48163. find: function (a) {
  48164. for (var b = this.parent; null != b && b.data != a;) b =
  48165. this.lt(a, b.data) ? b.prev : b.next;
  48166. return b
  48167. },
  48168. has: function (a) {
  48169. return null != this.find(a)
  48170. },
  48171. size: function () {
  48172. var a = 0;
  48173. if (!this.empty()) {
  48174. for (var b = this.parent; null != b.prev;) b = b.prev;
  48175. for (; null != b;)
  48176. if (a++, null != b.next)
  48177. for (b = b.next; null != b.prev;) b = b.prev;
  48178. else {
  48179. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  48180. b = b.parent
  48181. }
  48182. }
  48183. return a
  48184. },
  48185. singular: function () {
  48186. return null != this.parent && null == this.parent.prev && null == this.parent.next
  48187. },
  48188. empty: function () {
  48189. return null == this.parent
  48190. },
  48191. verify: function () {
  48192. if (!this.empty()) {
  48193. for (var a =
  48194. this.parent; null != a.prev;) a = a.prev;
  48195. for (; null != a;) {
  48196. var b = a.data,
  48197. c = !0;
  48198. if (!this.empty()) {
  48199. for (var g = this.parent; null != g.prev;) g = g.prev;
  48200. for (; null != g;) {
  48201. var e = g.data;
  48202. if (!c) {
  48203. if (!this.lt(b, e) && this.lt(e, b)) return !1
  48204. } else if (b == e) c = !1;
  48205. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  48206. if (null != g.next)
  48207. for (g = g.next; null != g.prev;) g = g.prev;
  48208. else {
  48209. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  48210. g = g.parent
  48211. }
  48212. }
  48213. }
  48214. if (null != a.next)
  48215. for (a = a.next; null != a.prev;) a = a.prev;
  48216. else {
  48217. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  48218. a = a.parent
  48219. }
  48220. }
  48221. }
  48222. return !0
  48223. },
  48224. alloc: function () {},
  48225. free: function () {
  48226. this.swapped = this.lt = this.data = null
  48227. },
  48228. __class__: c.util.ZPP_Set_ZPP_PartitionVertex
  48229. };
  48230. c.util.ZPP_Set_ZPP_PartitionPair = function () {
  48231. this.colour = 0;
  48232. this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
  48233. };
  48234. s["zpp_nape.util.ZPP_Set_ZPP_PartitionPair"] = c.util.ZPP_Set_ZPP_PartitionPair;
  48235. c.util.ZPP_Set_ZPP_PartitionPair.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_PartitionPair"];
  48236. c.util.ZPP_Set_ZPP_PartitionPair.prototype = {
  48237. insert: function (a) {
  48238. var b;
  48239. null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ?
  48240. b = new c.util.ZPP_Set_ZPP_PartitionPair : (b = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = b.next, b.next = null);
  48241. null;
  48242. b.data = a;
  48243. if (null == this.parent) this.parent = b;
  48244. else
  48245. for (a = this.parent;;)
  48246. if (this.lt(b.data, a.data))
  48247. if (null == a.prev) {
  48248. a.prev = b;
  48249. b.parent = a;
  48250. break
  48251. } else a = a.prev;
  48252. else if (null == a.next) {
  48253. a.next = b;
  48254. b.parent = a;
  48255. break
  48256. } else a = a.next;
  48257. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  48258. return b
  48259. },
  48260. try_insert: function (a) {
  48261. var b = null,
  48262. d = null;
  48263. if (null ==
  48264. this.parent) null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionPair : (b = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  48265. else
  48266. for (d = this.parent;;)
  48267. if (this.lt(a, d.data))
  48268. if (null == d.prev) {
  48269. null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionPair : (b = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = b.next, b.next = null);
  48270. null;
  48271. b.data =
  48272. a;
  48273. d.prev = b;
  48274. b.parent = d;
  48275. break
  48276. } else d = d.prev;
  48277. else if (this.lt(d.data, a))
  48278. if (null == d.next) {
  48279. null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionPair : (b = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = b.next, b.next = null);
  48280. null;
  48281. b.data = a;
  48282. d.next = b;
  48283. b.parent = d;
  48284. break
  48285. } else d = d.next;
  48286. else break; if (null == b) return d;
  48287. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  48288. return b
  48289. },
  48290. try_insert_bool: function (a) {
  48291. var b = null,
  48292. d = null;
  48293. if (null == this.parent) null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionPair : (b = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  48294. else
  48295. for (d = this.parent;;)
  48296. if (this.lt(a, d.data))
  48297. if (null == d.prev) {
  48298. null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionPair : (b = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = b.next, b.next = null);
  48299. null;
  48300. b.data = a;
  48301. d.prev = b;
  48302. b.parent = d;
  48303. break
  48304. } else d = d.prev;
  48305. else if (this.lt(d.data, a))
  48306. if (null == d.next) {
  48307. null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ? b = new c.util.ZPP_Set_ZPP_PartitionPair : (b = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool, c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = b.next, b.next = null);
  48308. null;
  48309. b.data = a;
  48310. d.next = b;
  48311. b.parent = d;
  48312. break
  48313. } else d = d.next;
  48314. else break; if (null == b) return !1;
  48315. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  48316. return !0
  48317. },
  48318. __fix_dbl_red: function (a) {
  48319. for (;;) {
  48320. var b =
  48321. a.parent,
  48322. c = b.parent;
  48323. if (null == c) {
  48324. b.colour = 1;
  48325. break
  48326. }
  48327. var g, e, f, h, k, n, p;
  48328. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next, p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p = a.next));
  48329. a = c.parent;
  48330. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  48331. null != e && (e.parent = a);
  48332. g.prev = h;
  48333. null != h && (h.parent = g);
  48334. g.next = k;
  48335. null != k && (k.parent = g);
  48336. e.prev = g;
  48337. null != g && (g.parent = e);
  48338. e.next = f;
  48339. null != f && (f.parent = e);
  48340. f.prev = n;
  48341. null != n && (n.parent =
  48342. f);
  48343. f.next = p;
  48344. null != p && (p.parent = f);
  48345. e.colour = c.colour - 1;
  48346. g.colour = 1;
  48347. f.colour = 1;
  48348. if (e == this.parent) this.parent.colour = 1;
  48349. else if (0 == e.colour && 0 == e.parent.colour) {
  48350. a = e;
  48351. continue
  48352. }
  48353. break
  48354. }
  48355. },
  48356. __fix_neg_red: function (a) {
  48357. var b = a.parent,
  48358. c = b.prev == a ? function (c) {
  48359. var d = a.prev,
  48360. f = a.next,
  48361. h = f.prev,
  48362. k = f.next;
  48363. d.colour = 0;
  48364. a.colour = b.colour = 1;
  48365. a.next = h;
  48366. null != h && (h.parent = a);
  48367. h = b.data;
  48368. b.data = f.data;
  48369. f.data = h;
  48370. null != c.swapped && c.swapped(b.data, f.data);
  48371. f.prev = k;
  48372. null != k && (k.parent = f);
  48373. f.next = b.next;
  48374. null != b.next && (b.next.parent = f);
  48375. b.next =
  48376. f;
  48377. null != f && (f.parent = b);
  48378. return d
  48379. }(this) : function (c) {
  48380. var d = a.next,
  48381. f = a.prev,
  48382. h = f.next,
  48383. k = f.prev;
  48384. d.colour = 0;
  48385. a.colour = b.colour = 1;
  48386. a.prev = h;
  48387. null != h && (h.parent = a);
  48388. h = b.data;
  48389. b.data = f.data;
  48390. f.data = h;
  48391. null != c.swapped && c.swapped(b.data, f.data);
  48392. f.next = k;
  48393. null != k && (k.parent = f);
  48394. f.prev = b.prev;
  48395. null != b.prev && (b.prev.parent = f);
  48396. b.prev = f;
  48397. null != f && (f.parent = b);
  48398. return d
  48399. }(this);
  48400. null != c.prev && 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  48401. },
  48402. clear_node: function (a, b) {
  48403. b(a.data);
  48404. var d = a.parent;
  48405. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  48406. a.data = null;
  48407. a.lt = null;
  48408. a.swapped = null;
  48409. a.next = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool;
  48410. c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = a;
  48411. return d
  48412. },
  48413. clear_with: function (a) {
  48414. if (null != this.parent) {
  48415. for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  48416. this.parent = null
  48417. }
  48418. },
  48419. clear: function () {
  48420. this.clear_with(function (a) {})
  48421. },
  48422. remove_node: function (a) {
  48423. if (null != a.next && null != a.prev) {
  48424. for (var b = a.next; null != b.prev;) b =
  48425. b.prev;
  48426. var d = a.data;
  48427. a.data = b.data;
  48428. b.data = d;
  48429. null != this.swapped && this.swapped(a.data, b.data);
  48430. a = b
  48431. }
  48432. b = null == a.prev ? a.next : a.prev;
  48433. if (1 == a.colour)
  48434. if (null != a.prev || null != a.next) b.colour = 1;
  48435. else if (null != a.parent)
  48436. for (d = a.parent;;) {
  48437. d.colour++;
  48438. d.prev.colour--;
  48439. d.next.colour--;
  48440. var g = d.prev;
  48441. if (-1 == g.colour) {
  48442. this.__fix_neg_red(g);
  48443. break
  48444. } else if (0 == g.colour) {
  48445. if (null != g.prev && 0 == g.prev.colour) {
  48446. this.__fix_dbl_red(g.prev);
  48447. break
  48448. }
  48449. if (null != g.next && 0 == g.next.colour) {
  48450. this.__fix_dbl_red(g.next);
  48451. break
  48452. }
  48453. }
  48454. g = d.next;
  48455. if (-1 == g.colour) {
  48456. this.__fix_neg_red(g);
  48457. break
  48458. } else if (0 == g.colour) {
  48459. if (null != g.prev && 0 == g.prev.colour) {
  48460. this.__fix_dbl_red(g.prev);
  48461. break
  48462. }
  48463. if (null != g.next && 0 == g.next.colour) {
  48464. this.__fix_dbl_red(g.next);
  48465. break
  48466. }
  48467. }
  48468. if (2 == d.colour)
  48469. if (null == d.parent) d.colour = 1;
  48470. else {
  48471. d = d.parent;
  48472. continue
  48473. }
  48474. break
  48475. }
  48476. d = a.parent;
  48477. null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  48478. null != b && (b.parent = d);
  48479. a.parent = a.prev = a.next = null;
  48480. a.data = null;
  48481. a.lt = null;
  48482. a.swapped = null;
  48483. a.next = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool;
  48484. c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = a
  48485. },
  48486. predecessor: function (a) {
  48487. a =
  48488. this.predecessor_node(this.find(a));
  48489. return null == a ? null : a.data
  48490. },
  48491. successor: function (a) {
  48492. a = this.successor_node(this.find(a));
  48493. return null == a ? null : a.data
  48494. },
  48495. predecessor_node: function (a) {
  48496. if (null != a.prev)
  48497. for (a = a.prev; null != a.next;) a = a.next;
  48498. else {
  48499. var b = a;
  48500. for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
  48501. }
  48502. return a
  48503. },
  48504. successor_node: function (a) {
  48505. if (null != a.next)
  48506. for (a = a.next; null != a.prev;) a = a.prev;
  48507. else {
  48508. var b = a;
  48509. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  48510. }
  48511. return a
  48512. },
  48513. remove: function (a) {
  48514. a = this.find(a);
  48515. this.remove_node(a)
  48516. },
  48517. pop_front: function () {
  48518. for (var a = this.parent; null != a.prev;) a = a.prev;
  48519. var b = a.data;
  48520. this.remove_node(a);
  48521. return b
  48522. },
  48523. first: function () {
  48524. for (var a = this.parent; null != a.prev;) a = a.prev;
  48525. return a.data
  48526. },
  48527. lower_bound: function (a) {
  48528. var b = null;
  48529. if (!this.empty()) {
  48530. for (var c = this.parent; null != c.prev;) c = c.prev;
  48531. for (; null != c;) {
  48532. var g = c.data;
  48533. if (!this.lt(g, a)) {
  48534. b = g;
  48535. break
  48536. }
  48537. if (null != c.next)
  48538. for (c = c.next; null != c.prev;) c = c.prev;
  48539. else {
  48540. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  48541. c = c.parent
  48542. }
  48543. }
  48544. }
  48545. return b
  48546. },
  48547. find_weak: function (a) {
  48548. for (var b =
  48549. this.parent; null != b;)
  48550. if (this.lt(a, b.data)) b = b.prev;
  48551. else if (this.lt(b.data, a)) b = b.next;
  48552. else break;
  48553. return b
  48554. },
  48555. has_weak: function (a) {
  48556. return null != this.find_weak(a)
  48557. },
  48558. find: function (a) {
  48559. for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
  48560. return b
  48561. },
  48562. has: function (a) {
  48563. return null != this.find(a)
  48564. },
  48565. size: function () {
  48566. var a = 0;
  48567. if (!this.empty()) {
  48568. for (var b = this.parent; null != b.prev;) b = b.prev;
  48569. for (; null != b;)
  48570. if (a++, null != b.next)
  48571. for (b = b.next; null != b.prev;) b = b.prev;
  48572. else {
  48573. for (; null != b.parent && b == b.parent.next;) b =
  48574. b.parent;
  48575. b = b.parent
  48576. }
  48577. }
  48578. return a
  48579. },
  48580. singular: function () {
  48581. return null != this.parent && null == this.parent.prev && null == this.parent.next
  48582. },
  48583. empty: function () {
  48584. return null == this.parent
  48585. },
  48586. verify: function () {
  48587. if (!this.empty()) {
  48588. for (var a = this.parent; null != a.prev;) a = a.prev;
  48589. for (; null != a;) {
  48590. var b = a.data,
  48591. c = !0;
  48592. if (!this.empty()) {
  48593. for (var g = this.parent; null != g.prev;) g = g.prev;
  48594. for (; null != g;) {
  48595. var e = g.data;
  48596. if (!c) {
  48597. if (!this.lt(b, e) && this.lt(e, b)) return !1
  48598. } else if (b == e) c = !1;
  48599. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  48600. if (null != g.next)
  48601. for (g =
  48602. g.next; null != g.prev;) g = g.prev;
  48603. else {
  48604. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  48605. g = g.parent
  48606. }
  48607. }
  48608. }
  48609. if (null != a.next)
  48610. for (a = a.next; null != a.prev;) a = a.prev;
  48611. else {
  48612. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  48613. a = a.parent
  48614. }
  48615. }
  48616. }
  48617. return !0
  48618. },
  48619. alloc: function () {},
  48620. free: function () {
  48621. this.swapped = this.lt = this.data = null
  48622. },
  48623. __class__: c.util.ZPP_Set_ZPP_PartitionPair
  48624. };
  48625. c.util.ZPP_Set_ZPP_SimpleVert = function () {
  48626. this.colour = 0;
  48627. this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
  48628. };
  48629. s["zpp_nape.util.ZPP_Set_ZPP_SimpleVert"] =
  48630. c.util.ZPP_Set_ZPP_SimpleVert;
  48631. c.util.ZPP_Set_ZPP_SimpleVert.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_SimpleVert"];
  48632. c.util.ZPP_Set_ZPP_SimpleVert.prototype = {
  48633. insert: function (a) {
  48634. var b;
  48635. null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleVert : (b = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = b.next, b.next = null);
  48636. null;
  48637. b.data = a;
  48638. if (null == this.parent) this.parent = b;
  48639. else
  48640. for (a = this.parent;;)
  48641. if (this.lt(b.data, a.data))
  48642. if (null == a.prev) {
  48643. a.prev = b;
  48644. b.parent = a;
  48645. break
  48646. } else a =
  48647. a.prev;
  48648. else if (null == a.next) {
  48649. a.next = b;
  48650. b.parent = a;
  48651. break
  48652. } else a = a.next;
  48653. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  48654. return b
  48655. },
  48656. try_insert: function (a) {
  48657. var b = null,
  48658. d = null;
  48659. if (null == this.parent) null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleVert : (b = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  48660. else
  48661. for (d = this.parent;;)
  48662. if (this.lt(a, d.data))
  48663. if (null == d.prev) {
  48664. null ==
  48665. c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleVert : (b = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = b.next, b.next = null);
  48666. null;
  48667. b.data = a;
  48668. d.prev = b;
  48669. b.parent = d;
  48670. break
  48671. } else d = d.prev;
  48672. else if (this.lt(d.data, a))
  48673. if (null == d.next) {
  48674. null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleVert : (b = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = b.next, b.next = null);
  48675. null;
  48676. b.data = a;
  48677. d.next = b;
  48678. b.parent = d;
  48679. break
  48680. } else d =
  48681. d.next;
  48682. else break; if (null == b) return d;
  48683. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  48684. return b
  48685. },
  48686. try_insert_bool: function (a) {
  48687. var b = null,
  48688. d = null;
  48689. if (null == this.parent) null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleVert : (b = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  48690. else
  48691. for (d = this.parent;;)
  48692. if (this.lt(a, d.data))
  48693. if (null == d.prev) {
  48694. null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ?
  48695. b = new c.util.ZPP_Set_ZPP_SimpleVert : (b = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = b.next, b.next = null);
  48696. null;
  48697. b.data = a;
  48698. d.prev = b;
  48699. b.parent = d;
  48700. break
  48701. } else d = d.prev;
  48702. else if (this.lt(d.data, a))
  48703. if (null == d.next) {
  48704. null == c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleVert : (b = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool, c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = b.next, b.next = null);
  48705. null;
  48706. b.data = a;
  48707. d.next = b;
  48708. b.parent = d;
  48709. break
  48710. } else d = d.next;
  48711. else break; if (null == b) return !1;
  48712. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  48713. return !0
  48714. },
  48715. __fix_dbl_red: function (a) {
  48716. for (;;) {
  48717. var b = a.parent,
  48718. c = b.parent;
  48719. if (null == c) {
  48720. b.colour = 1;
  48721. break
  48722. }
  48723. var g, e, f, h, k, n, p;
  48724. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next, p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p = a.next));
  48725. a = c.parent;
  48726. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  48727. null != e && (e.parent = a);
  48728. g.prev = h;
  48729. null !=
  48730. h && (h.parent = g);
  48731. g.next = k;
  48732. null != k && (k.parent = g);
  48733. e.prev = g;
  48734. null != g && (g.parent = e);
  48735. e.next = f;
  48736. null != f && (f.parent = e);
  48737. f.prev = n;
  48738. null != n && (n.parent = f);
  48739. f.next = p;
  48740. null != p && (p.parent = f);
  48741. e.colour = c.colour - 1;
  48742. g.colour = 1;
  48743. f.colour = 1;
  48744. if (e == this.parent) this.parent.colour = 1;
  48745. else if (0 == e.colour && 0 == e.parent.colour) {
  48746. a = e;
  48747. continue
  48748. }
  48749. break
  48750. }
  48751. },
  48752. __fix_neg_red: function (a) {
  48753. var b = a.parent,
  48754. c = b.prev == a ? function (c) {
  48755. var d = a.prev,
  48756. f = a.next,
  48757. h = f.prev,
  48758. k = f.next;
  48759. d.colour = 0;
  48760. a.colour = b.colour = 1;
  48761. a.next = h;
  48762. null != h && (h.parent = a);
  48763. h = b.data;
  48764. b.data = f.data;
  48765. f.data = h;
  48766. null != c.swapped && c.swapped(b.data, f.data);
  48767. f.prev = k;
  48768. null != k && (k.parent = f);
  48769. f.next = b.next;
  48770. null != b.next && (b.next.parent = f);
  48771. b.next = f;
  48772. null != f && (f.parent = b);
  48773. return d
  48774. }(this) : function (c) {
  48775. var d = a.next,
  48776. f = a.prev,
  48777. h = f.next,
  48778. k = f.prev;
  48779. d.colour = 0;
  48780. a.colour = b.colour = 1;
  48781. a.prev = h;
  48782. null != h && (h.parent = a);
  48783. h = b.data;
  48784. b.data = f.data;
  48785. f.data = h;
  48786. null != c.swapped && c.swapped(b.data, f.data);
  48787. f.next = k;
  48788. null != k && (k.parent = f);
  48789. f.prev = b.prev;
  48790. null != b.prev && (b.prev.parent = f);
  48791. b.prev = f;
  48792. null != f && (f.parent = b);
  48793. return d
  48794. }(this);
  48795. null != c.prev &&
  48796. 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  48797. },
  48798. clear_node: function (a, b) {
  48799. b(a.data);
  48800. var d = a.parent;
  48801. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  48802. a.data = null;
  48803. a.lt = null;
  48804. a.swapped = null;
  48805. a.next = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool;
  48806. c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = a;
  48807. return d
  48808. },
  48809. clear_with: function (a) {
  48810. if (null != this.parent) {
  48811. for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  48812. this.parent = null
  48813. }
  48814. },
  48815. clear: function () {
  48816. this.clear_with(function (a) {})
  48817. },
  48818. remove_node: function (a) {
  48819. if (null != a.next && null != a.prev) {
  48820. for (var b = a.next; null != b.prev;) b = b.prev;
  48821. var d = a.data;
  48822. a.data = b.data;
  48823. b.data = d;
  48824. null != this.swapped && this.swapped(a.data, b.data);
  48825. a = b
  48826. }
  48827. b = null == a.prev ? a.next : a.prev;
  48828. if (1 == a.colour)
  48829. if (null != a.prev || null != a.next) b.colour = 1;
  48830. else if (null != a.parent)
  48831. for (d = a.parent;;) {
  48832. d.colour++;
  48833. d.prev.colour--;
  48834. d.next.colour--;
  48835. var g = d.prev;
  48836. if (-1 == g.colour) {
  48837. this.__fix_neg_red(g);
  48838. break
  48839. } else if (0 == g.colour) {
  48840. if (null != g.prev && 0 == g.prev.colour) {
  48841. this.__fix_dbl_red(g.prev);
  48842. break
  48843. }
  48844. if (null != g.next && 0 == g.next.colour) {
  48845. this.__fix_dbl_red(g.next);
  48846. break
  48847. }
  48848. }
  48849. g = d.next;
  48850. if (-1 == g.colour) {
  48851. this.__fix_neg_red(g);
  48852. break
  48853. } else if (0 == g.colour) {
  48854. if (null != g.prev && 0 == g.prev.colour) {
  48855. this.__fix_dbl_red(g.prev);
  48856. break
  48857. }
  48858. if (null != g.next && 0 == g.next.colour) {
  48859. this.__fix_dbl_red(g.next);
  48860. break
  48861. }
  48862. }
  48863. if (2 == d.colour)
  48864. if (null == d.parent) d.colour = 1;
  48865. else {
  48866. d = d.parent;
  48867. continue
  48868. }
  48869. break
  48870. }
  48871. d = a.parent;
  48872. null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  48873. null != b && (b.parent = d);
  48874. a.parent = a.prev = a.next = null;
  48875. a.data = null;
  48876. a.lt = null;
  48877. a.swapped =
  48878. null;
  48879. a.next = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool;
  48880. c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = a
  48881. },
  48882. predecessor: function (a) {
  48883. a = this.predecessor_node(this.find(a));
  48884. return null == a ? null : a.data
  48885. },
  48886. successor: function (a) {
  48887. a = this.successor_node(this.find(a));
  48888. return null == a ? null : a.data
  48889. },
  48890. predecessor_node: function (a) {
  48891. if (null != a.prev)
  48892. for (a = a.prev; null != a.next;) a = a.next;
  48893. else {
  48894. var b = a;
  48895. for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
  48896. }
  48897. return a
  48898. },
  48899. successor_node: function (a) {
  48900. if (null != a.next)
  48901. for (a = a.next; null != a.prev;) a = a.prev;
  48902. else {
  48903. var b = a;
  48904. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  48905. }
  48906. return a
  48907. },
  48908. remove: function (a) {
  48909. a = this.find(a);
  48910. this.remove_node(a)
  48911. },
  48912. pop_front: function () {
  48913. for (var a = this.parent; null != a.prev;) a = a.prev;
  48914. var b = a.data;
  48915. this.remove_node(a);
  48916. return b
  48917. },
  48918. first: function () {
  48919. for (var a = this.parent; null != a.prev;) a = a.prev;
  48920. return a.data
  48921. },
  48922. lower_bound: function (a) {
  48923. var b = null;
  48924. if (!this.empty()) {
  48925. for (var c = this.parent; null != c.prev;) c = c.prev;
  48926. for (; null != c;) {
  48927. var g = c.data;
  48928. if (!this.lt(g, a)) {
  48929. b = g;
  48930. break
  48931. }
  48932. if (null != c.next)
  48933. for (c = c.next; null !=
  48934. c.prev;) c = c.prev;
  48935. else {
  48936. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  48937. c = c.parent
  48938. }
  48939. }
  48940. }
  48941. return b
  48942. },
  48943. find_weak: function (a) {
  48944. for (var b = this.parent; null != b;)
  48945. if (this.lt(a, b.data)) b = b.prev;
  48946. else if (this.lt(b.data, a)) b = b.next;
  48947. else break;
  48948. return b
  48949. },
  48950. has_weak: function (a) {
  48951. return null != this.find_weak(a)
  48952. },
  48953. find: function (a) {
  48954. for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
  48955. return b
  48956. },
  48957. has: function (a) {
  48958. return null != this.find(a)
  48959. },
  48960. size: function () {
  48961. var a = 0;
  48962. if (!this.empty()) {
  48963. for (var b = this.parent; null !=
  48964. b.prev;) b = b.prev;
  48965. for (; null != b;)
  48966. if (a++, null != b.next)
  48967. for (b = b.next; null != b.prev;) b = b.prev;
  48968. else {
  48969. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  48970. b = b.parent
  48971. }
  48972. }
  48973. return a
  48974. },
  48975. singular: function () {
  48976. return null != this.parent && null == this.parent.prev && null == this.parent.next
  48977. },
  48978. empty: function () {
  48979. return null == this.parent
  48980. },
  48981. verify: function () {
  48982. if (!this.empty()) {
  48983. for (var a = this.parent; null != a.prev;) a = a.prev;
  48984. for (; null != a;) {
  48985. var b = a.data,
  48986. c = !0;
  48987. if (!this.empty()) {
  48988. for (var g = this.parent; null != g.prev;) g = g.prev;
  48989. for (; null != g;) {
  48990. var e = g.data;
  48991. if (!c) {
  48992. if (!this.lt(b, e) && this.lt(e, b)) return !1
  48993. } else if (b == e) c = !1;
  48994. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  48995. if (null != g.next)
  48996. for (g = g.next; null != g.prev;) g = g.prev;
  48997. else {
  48998. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  48999. g = g.parent
  49000. }
  49001. }
  49002. }
  49003. if (null != a.next)
  49004. for (a = a.next; null != a.prev;) a = a.prev;
  49005. else {
  49006. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  49007. a = a.parent
  49008. }
  49009. }
  49010. }
  49011. return !0
  49012. },
  49013. alloc: function () {},
  49014. free: function () {
  49015. this.swapped = this.lt = this.data = null
  49016. },
  49017. __class__: c.util.ZPP_Set_ZPP_SimpleVert
  49018. };
  49019. c.util.ZPP_Set_ZPP_SimpleSeg =
  49020. function () {
  49021. this.colour = 0;
  49022. this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
  49023. };
  49024. s["zpp_nape.util.ZPP_Set_ZPP_SimpleSeg"] = c.util.ZPP_Set_ZPP_SimpleSeg;
  49025. c.util.ZPP_Set_ZPP_SimpleSeg.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_SimpleSeg"];
  49026. c.util.ZPP_Set_ZPP_SimpleSeg.prototype = {
  49027. insert: function (a) {
  49028. var b;
  49029. null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleSeg : (b = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = b.next, b.next = null);
  49030. null;
  49031. b.data =
  49032. a;
  49033. if (null == this.parent) this.parent = b;
  49034. else
  49035. for (a = this.parent;;)
  49036. if (this.lt(b.data, a.data))
  49037. if (null == a.prev) {
  49038. a.prev = b;
  49039. b.parent = a;
  49040. break
  49041. } else a = a.prev;
  49042. else if (null == a.next) {
  49043. a.next = b;
  49044. b.parent = a;
  49045. break
  49046. } else a = a.next;
  49047. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49048. return b
  49049. },
  49050. try_insert: function (a) {
  49051. var b = null,
  49052. d = null;
  49053. if (null == this.parent) null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleSeg : (b = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool =
  49054. b.next, b.next = null), null, b.data = a, this.parent = b;
  49055. else
  49056. for (d = this.parent;;)
  49057. if (this.lt(a, d.data))
  49058. if (null == d.prev) {
  49059. null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleSeg : (b = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = b.next, b.next = null);
  49060. null;
  49061. b.data = a;
  49062. d.prev = b;
  49063. b.parent = d;
  49064. break
  49065. } else d = d.prev;
  49066. else if (this.lt(d.data, a))
  49067. if (null == d.next) {
  49068. null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleSeg : (b = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool,
  49069. c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = b.next, b.next = null);
  49070. null;
  49071. b.data = a;
  49072. d.next = b;
  49073. b.parent = d;
  49074. break
  49075. } else d = d.next;
  49076. else break; if (null == b) return d;
  49077. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49078. return b
  49079. },
  49080. try_insert_bool: function (a) {
  49081. var b = null,
  49082. d = null;
  49083. if (null == this.parent) null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleSeg : (b = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent =
  49084. b;
  49085. else
  49086. for (d = this.parent;;)
  49087. if (this.lt(a, d.data))
  49088. if (null == d.prev) {
  49089. null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleSeg : (b = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = b.next, b.next = null);
  49090. null;
  49091. b.data = a;
  49092. d.prev = b;
  49093. b.parent = d;
  49094. break
  49095. } else d = d.prev;
  49096. else if (this.lt(d.data, a))
  49097. if (null == d.next) {
  49098. null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleSeg : (b = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool, c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = b.next,
  49099. b.next = null);
  49100. null;
  49101. b.data = a;
  49102. d.next = b;
  49103. b.parent = d;
  49104. break
  49105. } else d = d.next;
  49106. else break; if (null == b) return !1;
  49107. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49108. return !0
  49109. },
  49110. __fix_dbl_red: function (a) {
  49111. for (;;) {
  49112. var b = a.parent,
  49113. c = b.parent;
  49114. if (null == c) {
  49115. b.colour = 1;
  49116. break
  49117. }
  49118. var g, e, f, h, k, n, p;
  49119. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next, p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p = a.next));
  49120. a = c.parent;
  49121. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  49122. null != e && (e.parent = a);
  49123. g.prev = h;
  49124. null != h && (h.parent = g);
  49125. g.next = k;
  49126. null != k && (k.parent = g);
  49127. e.prev = g;
  49128. null != g && (g.parent = e);
  49129. e.next = f;
  49130. null != f && (f.parent = e);
  49131. f.prev = n;
  49132. null != n && (n.parent = f);
  49133. f.next = p;
  49134. null != p && (p.parent = f);
  49135. e.colour = c.colour - 1;
  49136. g.colour = 1;
  49137. f.colour = 1;
  49138. if (e == this.parent) this.parent.colour = 1;
  49139. else if (0 == e.colour && 0 == e.parent.colour) {
  49140. a = e;
  49141. continue
  49142. }
  49143. break
  49144. }
  49145. },
  49146. __fix_neg_red: function (a) {
  49147. var b = a.parent,
  49148. c = b.prev == a ? function (c) {
  49149. var d = a.prev,
  49150. f = a.next,
  49151. h =
  49152. f.prev,
  49153. k = f.next;
  49154. d.colour = 0;
  49155. a.colour = b.colour = 1;
  49156. a.next = h;
  49157. null != h && (h.parent = a);
  49158. h = b.data;
  49159. b.data = f.data;
  49160. f.data = h;
  49161. null != c.swapped && c.swapped(b.data, f.data);
  49162. f.prev = k;
  49163. null != k && (k.parent = f);
  49164. f.next = b.next;
  49165. null != b.next && (b.next.parent = f);
  49166. b.next = f;
  49167. null != f && (f.parent = b);
  49168. return d
  49169. }(this) : function (c) {
  49170. var d = a.next,
  49171. f = a.prev,
  49172. h = f.next,
  49173. k = f.prev;
  49174. d.colour = 0;
  49175. a.colour = b.colour = 1;
  49176. a.prev = h;
  49177. null != h && (h.parent = a);
  49178. h = b.data;
  49179. b.data = f.data;
  49180. f.data = h;
  49181. null != c.swapped && c.swapped(b.data, f.data);
  49182. f.next = k;
  49183. null != k && (k.parent = f);
  49184. f.prev =
  49185. b.prev;
  49186. null != b.prev && (b.prev.parent = f);
  49187. b.prev = f;
  49188. null != f && (f.parent = b);
  49189. return d
  49190. }(this);
  49191. null != c.prev && 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  49192. },
  49193. clear_node: function (a, b) {
  49194. b(a.data);
  49195. var d = a.parent;
  49196. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  49197. a.data = null;
  49198. a.lt = null;
  49199. a.swapped = null;
  49200. a.next = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool;
  49201. c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = a;
  49202. return d
  49203. },
  49204. clear_with: function (a) {
  49205. if (null != this.parent) {
  49206. for (var b = this.parent; null !=
  49207. b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  49208. this.parent = null
  49209. }
  49210. },
  49211. clear: function () {
  49212. this.clear_with(function (a) {})
  49213. },
  49214. remove_node: function (a) {
  49215. if (null != a.next && null != a.prev) {
  49216. for (var b = a.next; null != b.prev;) b = b.prev;
  49217. var d = a.data;
  49218. a.data = b.data;
  49219. b.data = d;
  49220. null != this.swapped && this.swapped(a.data, b.data);
  49221. a = b
  49222. }
  49223. b = null == a.prev ? a.next : a.prev;
  49224. if (1 == a.colour)
  49225. if (null != a.prev || null != a.next) b.colour = 1;
  49226. else if (null != a.parent)
  49227. for (d = a.parent;;) {
  49228. d.colour++;
  49229. d.prev.colour--;
  49230. d.next.colour--;
  49231. var g = d.prev;
  49232. if (-1 ==
  49233. g.colour) {
  49234. this.__fix_neg_red(g);
  49235. break
  49236. } else if (0 == g.colour) {
  49237. if (null != g.prev && 0 == g.prev.colour) {
  49238. this.__fix_dbl_red(g.prev);
  49239. break
  49240. }
  49241. if (null != g.next && 0 == g.next.colour) {
  49242. this.__fix_dbl_red(g.next);
  49243. break
  49244. }
  49245. }
  49246. g = d.next;
  49247. if (-1 == g.colour) {
  49248. this.__fix_neg_red(g);
  49249. break
  49250. } else if (0 == g.colour) {
  49251. if (null != g.prev && 0 == g.prev.colour) {
  49252. this.__fix_dbl_red(g.prev);
  49253. break
  49254. }
  49255. if (null != g.next && 0 == g.next.colour) {
  49256. this.__fix_dbl_red(g.next);
  49257. break
  49258. }
  49259. }
  49260. if (2 == d.colour)
  49261. if (null == d.parent) d.colour = 1;
  49262. else {
  49263. d = d.parent;
  49264. continue
  49265. }
  49266. break
  49267. }
  49268. d = a.parent;
  49269. null == d ?
  49270. this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  49271. null != b && (b.parent = d);
  49272. a.parent = a.prev = a.next = null;
  49273. a.data = null;
  49274. a.lt = null;
  49275. a.swapped = null;
  49276. a.next = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool;
  49277. c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = a
  49278. },
  49279. predecessor: function (a) {
  49280. a = this.predecessor_node(this.find(a));
  49281. return null == a ? null : a.data
  49282. },
  49283. successor: function (a) {
  49284. a = this.successor_node(this.find(a));
  49285. return null == a ? null : a.data
  49286. },
  49287. predecessor_node: function (a) {
  49288. if (null != a.prev)
  49289. for (a = a.prev; null != a.next;) a = a.next;
  49290. else {
  49291. var b = a;
  49292. for (a = a.parent; null !=
  49293. a && a.next != b;) b = a, a = a.parent
  49294. }
  49295. return a
  49296. },
  49297. successor_node: function (a) {
  49298. if (null != a.next)
  49299. for (a = a.next; null != a.prev;) a = a.prev;
  49300. else {
  49301. var b = a;
  49302. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  49303. }
  49304. return a
  49305. },
  49306. remove: function (a) {
  49307. a = this.find(a);
  49308. this.remove_node(a)
  49309. },
  49310. pop_front: function () {
  49311. for (var a = this.parent; null != a.prev;) a = a.prev;
  49312. var b = a.data;
  49313. this.remove_node(a);
  49314. return b
  49315. },
  49316. first: function () {
  49317. for (var a = this.parent; null != a.prev;) a = a.prev;
  49318. return a.data
  49319. },
  49320. lower_bound: function (a) {
  49321. var b = null;
  49322. if (!this.empty()) {
  49323. for (var c = this.parent; null !=
  49324. c.prev;) c = c.prev;
  49325. for (; null != c;) {
  49326. var g = c.data;
  49327. if (!this.lt(g, a)) {
  49328. b = g;
  49329. break
  49330. }
  49331. if (null != c.next)
  49332. for (c = c.next; null != c.prev;) c = c.prev;
  49333. else {
  49334. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  49335. c = c.parent
  49336. }
  49337. }
  49338. }
  49339. return b
  49340. },
  49341. find_weak: function (a) {
  49342. for (var b = this.parent; null != b;)
  49343. if (this.lt(a, b.data)) b = b.prev;
  49344. else if (this.lt(b.data, a)) b = b.next;
  49345. else break;
  49346. return b
  49347. },
  49348. has_weak: function (a) {
  49349. return null != this.find_weak(a)
  49350. },
  49351. find: function (a) {
  49352. for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
  49353. return b
  49354. },
  49355. has: function (a) {
  49356. return null !=
  49357. this.find(a)
  49358. },
  49359. size: function () {
  49360. var a = 0;
  49361. if (!this.empty()) {
  49362. for (var b = this.parent; null != b.prev;) b = b.prev;
  49363. for (; null != b;)
  49364. if (a++, null != b.next)
  49365. for (b = b.next; null != b.prev;) b = b.prev;
  49366. else {
  49367. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  49368. b = b.parent
  49369. }
  49370. }
  49371. return a
  49372. },
  49373. singular: function () {
  49374. return null != this.parent && null == this.parent.prev && null == this.parent.next
  49375. },
  49376. empty: function () {
  49377. return null == this.parent
  49378. },
  49379. verify: function () {
  49380. if (!this.empty()) {
  49381. for (var a = this.parent; null != a.prev;) a = a.prev;
  49382. for (; null != a;) {
  49383. var b = a.data,
  49384. c = !0;
  49385. if (!this.empty()) {
  49386. for (var g =
  49387. this.parent; null != g.prev;) g = g.prev;
  49388. for (; null != g;) {
  49389. var e = g.data;
  49390. if (!c) {
  49391. if (!this.lt(b, e) && this.lt(e, b)) return !1
  49392. } else if (b == e) c = !1;
  49393. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  49394. if (null != g.next)
  49395. for (g = g.next; null != g.prev;) g = g.prev;
  49396. else {
  49397. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  49398. g = g.parent
  49399. }
  49400. }
  49401. }
  49402. if (null != a.next)
  49403. for (a = a.next; null != a.prev;) a = a.prev;
  49404. else {
  49405. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  49406. a = a.parent
  49407. }
  49408. }
  49409. }
  49410. return !0
  49411. },
  49412. alloc: function () {},
  49413. free: function () {
  49414. this.swapped = this.lt = this.data = null
  49415. },
  49416. __class__: c.util.ZPP_Set_ZPP_SimpleSeg
  49417. };
  49418. c.util.ZPP_Set_ZPP_SimpleEvent = function () {
  49419. this.colour = 0;
  49420. this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
  49421. };
  49422. s["zpp_nape.util.ZPP_Set_ZPP_SimpleEvent"] = c.util.ZPP_Set_ZPP_SimpleEvent;
  49423. c.util.ZPP_Set_ZPP_SimpleEvent.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_SimpleEvent"];
  49424. c.util.ZPP_Set_ZPP_SimpleEvent.prototype = {
  49425. insert: function (a) {
  49426. var b;
  49427. null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleEvent : (b = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool =
  49428. b.next, b.next = null);
  49429. null;
  49430. b.data = a;
  49431. if (null == this.parent) this.parent = b;
  49432. else
  49433. for (a = this.parent;;)
  49434. if (this.lt(b.data, a.data))
  49435. if (null == a.prev) {
  49436. a.prev = b;
  49437. b.parent = a;
  49438. break
  49439. } else a = a.prev;
  49440. else if (null == a.next) {
  49441. a.next = b;
  49442. b.parent = a;
  49443. break
  49444. } else a = a.next;
  49445. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49446. return b
  49447. },
  49448. try_insert: function (a) {
  49449. var b = null,
  49450. d = null;
  49451. if (null == this.parent) null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleEvent : (b = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool,
  49452. c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  49453. else
  49454. for (d = this.parent;;)
  49455. if (this.lt(a, d.data))
  49456. if (null == d.prev) {
  49457. null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleEvent : (b = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = b.next, b.next = null);
  49458. null;
  49459. b.data = a;
  49460. d.prev = b;
  49461. b.parent = d;
  49462. break
  49463. } else d = d.prev;
  49464. else if (this.lt(d.data, a))
  49465. if (null == d.next) {
  49466. null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleEvent :
  49467. (b = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = b.next, b.next = null);
  49468. null;
  49469. b.data = a;
  49470. d.next = b;
  49471. b.parent = d;
  49472. break
  49473. } else d = d.next;
  49474. else break; if (null == b) return d;
  49475. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49476. return b
  49477. },
  49478. try_insert_bool: function (a) {
  49479. var b = null,
  49480. d = null;
  49481. if (null == this.parent) null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleEvent : (b = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool =
  49482. b.next, b.next = null), null, b.data = a, this.parent = b;
  49483. else
  49484. for (d = this.parent;;)
  49485. if (this.lt(a, d.data))
  49486. if (null == d.prev) {
  49487. null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleEvent : (b = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool, c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = b.next, b.next = null);
  49488. null;
  49489. b.data = a;
  49490. d.prev = b;
  49491. b.parent = d;
  49492. break
  49493. } else d = d.prev;
  49494. else if (this.lt(d.data, a))
  49495. if (null == d.next) {
  49496. null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZPP_Set_ZPP_SimpleEvent : (b = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool,
  49497. c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = b.next, b.next = null);
  49498. null;
  49499. b.data = a;
  49500. d.next = b;
  49501. b.parent = d;
  49502. break
  49503. } else d = d.next;
  49504. else break; if (null == b) return !1;
  49505. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49506. return !0
  49507. },
  49508. __fix_dbl_red: function (a) {
  49509. for (;;) {
  49510. var b = a.parent,
  49511. c = b.parent;
  49512. if (null == c) {
  49513. b.colour = 1;
  49514. break
  49515. }
  49516. var g, e, f, h, k, n, p;
  49517. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next,
  49518. p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p = a.next));
  49519. a = c.parent;
  49520. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  49521. null != e && (e.parent = a);
  49522. g.prev = h;
  49523. null != h && (h.parent = g);
  49524. g.next = k;
  49525. null != k && (k.parent = g);
  49526. e.prev = g;
  49527. null != g && (g.parent = e);
  49528. e.next = f;
  49529. null != f && (f.parent = e);
  49530. f.prev = n;
  49531. null != n && (n.parent = f);
  49532. f.next = p;
  49533. null != p && (p.parent = f);
  49534. e.colour = c.colour - 1;
  49535. g.colour = 1;
  49536. f.colour = 1;
  49537. if (e == this.parent) this.parent.colour = 1;
  49538. else if (0 == e.colour && 0 == e.parent.colour) {
  49539. a = e;
  49540. continue
  49541. }
  49542. break
  49543. }
  49544. },
  49545. __fix_neg_red: function (a) {
  49546. var b = a.parent,
  49547. c = b.prev == a ? function (c) {
  49548. var d = a.prev,
  49549. f = a.next,
  49550. h = f.prev,
  49551. k = f.next;
  49552. d.colour = 0;
  49553. a.colour = b.colour = 1;
  49554. a.next = h;
  49555. null != h && (h.parent = a);
  49556. h = b.data;
  49557. b.data = f.data;
  49558. f.data = h;
  49559. null != c.swapped && c.swapped(b.data, f.data);
  49560. f.prev = k;
  49561. null != k && (k.parent = f);
  49562. f.next = b.next;
  49563. null != b.next && (b.next.parent = f);
  49564. b.next = f;
  49565. null != f && (f.parent = b);
  49566. return d
  49567. }(this) : function (c) {
  49568. var d = a.next,
  49569. f = a.prev,
  49570. h = f.next,
  49571. k = f.prev;
  49572. d.colour = 0;
  49573. a.colour = b.colour = 1;
  49574. a.prev = h;
  49575. null != h && (h.parent = a);
  49576. h = b.data;
  49577. b.data = f.data;
  49578. f.data = h;
  49579. null != c.swapped && c.swapped(b.data,
  49580. f.data);
  49581. f.next = k;
  49582. null != k && (k.parent = f);
  49583. f.prev = b.prev;
  49584. null != b.prev && (b.prev.parent = f);
  49585. b.prev = f;
  49586. null != f && (f.parent = b);
  49587. return d
  49588. }(this);
  49589. null != c.prev && 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  49590. },
  49591. clear_node: function (a, b) {
  49592. b(a.data);
  49593. var d = a.parent;
  49594. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  49595. a.data = null;
  49596. a.lt = null;
  49597. a.swapped = null;
  49598. a.next = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool;
  49599. c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = a;
  49600. return d
  49601. },
  49602. clear_with: function (a) {
  49603. if (null !=
  49604. this.parent) {
  49605. for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  49606. this.parent = null
  49607. }
  49608. },
  49609. clear: function () {
  49610. this.clear_with(function (a) {})
  49611. },
  49612. remove_node: function (a) {
  49613. if (null != a.next && null != a.prev) {
  49614. for (var b = a.next; null != b.prev;) b = b.prev;
  49615. var d = a.data;
  49616. a.data = b.data;
  49617. b.data = d;
  49618. null != this.swapped && this.swapped(a.data, b.data);
  49619. a = b
  49620. }
  49621. b = null == a.prev ? a.next : a.prev;
  49622. if (1 == a.colour)
  49623. if (null != a.prev || null != a.next) b.colour = 1;
  49624. else if (null != a.parent)
  49625. for (d = a.parent;;) {
  49626. d.colour++;
  49627. d.prev.colour--;
  49628. d.next.colour--;
  49629. var g = d.prev;
  49630. if (-1 == g.colour) {
  49631. this.__fix_neg_red(g);
  49632. break
  49633. } else if (0 == g.colour) {
  49634. if (null != g.prev && 0 == g.prev.colour) {
  49635. this.__fix_dbl_red(g.prev);
  49636. break
  49637. }
  49638. if (null != g.next && 0 == g.next.colour) {
  49639. this.__fix_dbl_red(g.next);
  49640. break
  49641. }
  49642. }
  49643. g = d.next;
  49644. if (-1 == g.colour) {
  49645. this.__fix_neg_red(g);
  49646. break
  49647. } else if (0 == g.colour) {
  49648. if (null != g.prev && 0 == g.prev.colour) {
  49649. this.__fix_dbl_red(g.prev);
  49650. break
  49651. }
  49652. if (null != g.next && 0 == g.next.colour) {
  49653. this.__fix_dbl_red(g.next);
  49654. break
  49655. }
  49656. }
  49657. if (2 == d.colour)
  49658. if (null == d.parent) d.colour = 1;
  49659. else {
  49660. d = d.parent;
  49661. continue
  49662. }
  49663. break
  49664. }
  49665. d = a.parent;
  49666. null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  49667. null != b && (b.parent = d);
  49668. a.parent = a.prev = a.next = null;
  49669. a.data = null;
  49670. a.lt = null;
  49671. a.swapped = null;
  49672. a.next = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool;
  49673. c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = a
  49674. },
  49675. predecessor: function (a) {
  49676. a = this.predecessor_node(this.find(a));
  49677. return null == a ? null : a.data
  49678. },
  49679. successor: function (a) {
  49680. a = this.successor_node(this.find(a));
  49681. return null == a ? null : a.data
  49682. },
  49683. predecessor_node: function (a) {
  49684. if (null != a.prev)
  49685. for (a = a.prev; null != a.next;) a =
  49686. a.next;
  49687. else {
  49688. var b = a;
  49689. for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
  49690. }
  49691. return a
  49692. },
  49693. successor_node: function (a) {
  49694. if (null != a.next)
  49695. for (a = a.next; null != a.prev;) a = a.prev;
  49696. else {
  49697. var b = a;
  49698. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  49699. }
  49700. return a
  49701. },
  49702. remove: function (a) {
  49703. a = this.find(a);
  49704. this.remove_node(a)
  49705. },
  49706. pop_front: function () {
  49707. for (var a = this.parent; null != a.prev;) a = a.prev;
  49708. var b = a.data;
  49709. this.remove_node(a);
  49710. return b
  49711. },
  49712. first: function () {
  49713. for (var a = this.parent; null != a.prev;) a = a.prev;
  49714. return a.data
  49715. },
  49716. lower_bound: function (a) {
  49717. var b =
  49718. null;
  49719. if (!this.empty()) {
  49720. for (var c = this.parent; null != c.prev;) c = c.prev;
  49721. for (; null != c;) {
  49722. var g = c.data;
  49723. if (!this.lt(g, a)) {
  49724. b = g;
  49725. break
  49726. }
  49727. if (null != c.next)
  49728. for (c = c.next; null != c.prev;) c = c.prev;
  49729. else {
  49730. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  49731. c = c.parent
  49732. }
  49733. }
  49734. }
  49735. return b
  49736. },
  49737. find_weak: function (a) {
  49738. for (var b = this.parent; null != b;)
  49739. if (this.lt(a, b.data)) b = b.prev;
  49740. else if (this.lt(b.data, a)) b = b.next;
  49741. else break;
  49742. return b
  49743. },
  49744. has_weak: function (a) {
  49745. return null != this.find_weak(a)
  49746. },
  49747. find: function (a) {
  49748. for (var b = this.parent; null != b && b.data !=
  49749. a;) b = this.lt(a, b.data) ? b.prev : b.next;
  49750. return b
  49751. },
  49752. has: function (a) {
  49753. return null != this.find(a)
  49754. },
  49755. size: function () {
  49756. var a = 0;
  49757. if (!this.empty()) {
  49758. for (var b = this.parent; null != b.prev;) b = b.prev;
  49759. for (; null != b;)
  49760. if (a++, null != b.next)
  49761. for (b = b.next; null != b.prev;) b = b.prev;
  49762. else {
  49763. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  49764. b = b.parent
  49765. }
  49766. }
  49767. return a
  49768. },
  49769. singular: function () {
  49770. return null != this.parent && null == this.parent.prev && null == this.parent.next
  49771. },
  49772. empty: function () {
  49773. return null == this.parent
  49774. },
  49775. verify: function () {
  49776. if (!this.empty()) {
  49777. for (var a =
  49778. this.parent; null != a.prev;) a = a.prev;
  49779. for (; null != a;) {
  49780. var b = a.data,
  49781. c = !0;
  49782. if (!this.empty()) {
  49783. for (var g = this.parent; null != g.prev;) g = g.prev;
  49784. for (; null != g;) {
  49785. var e = g.data;
  49786. if (!c) {
  49787. if (!this.lt(b, e) && this.lt(e, b)) return !1
  49788. } else if (b == e) c = !1;
  49789. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  49790. if (null != g.next)
  49791. for (g = g.next; null != g.prev;) g = g.prev;
  49792. else {
  49793. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  49794. g = g.parent
  49795. }
  49796. }
  49797. }
  49798. if (null != a.next)
  49799. for (a = a.next; null != a.prev;) a = a.prev;
  49800. else {
  49801. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  49802. a = a.parent
  49803. }
  49804. }
  49805. }
  49806. return !0
  49807. },
  49808. alloc: function () {},
  49809. free: function () {
  49810. this.swapped = this.lt = this.data = null
  49811. },
  49812. __class__: c.util.ZPP_Set_ZPP_SimpleEvent
  49813. };
  49814. c.util.ZPP_Set_ZPP_CbSet = function () {
  49815. this.colour = 0;
  49816. this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
  49817. };
  49818. s["zpp_nape.util.ZPP_Set_ZPP_CbSet"] = c.util.ZPP_Set_ZPP_CbSet;
  49819. c.util.ZPP_Set_ZPP_CbSet.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_CbSet"];
  49820. c.util.ZPP_Set_ZPP_CbSet.prototype = {
  49821. insert: function (a) {
  49822. var b;
  49823. null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSet :
  49824. (b = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool = b.next, b.next = null);
  49825. null;
  49826. b.data = a;
  49827. if (null == this.parent) this.parent = b;
  49828. else
  49829. for (a = this.parent;;)
  49830. if (this.lt(b.data, a.data))
  49831. if (null == a.prev) {
  49832. a.prev = b;
  49833. b.parent = a;
  49834. break
  49835. } else a = a.prev;
  49836. else if (null == a.next) {
  49837. a.next = b;
  49838. b.parent = a;
  49839. break
  49840. } else a = a.next;
  49841. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49842. return b
  49843. },
  49844. try_insert: function (a) {
  49845. var b = null,
  49846. d = null;
  49847. if (null == this.parent) null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ?
  49848. b = new c.util.ZPP_Set_ZPP_CbSet : (b = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool = b.next, b.next = null), null, b.data = a, this.parent = b;
  49849. else
  49850. for (d = this.parent;;)
  49851. if (this.lt(a, d.data))
  49852. if (null == d.prev) {
  49853. null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSet : (b = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool = b.next, b.next = null);
  49854. null;
  49855. b.data = a;
  49856. d.prev = b;
  49857. b.parent = d;
  49858. break
  49859. } else d = d.prev;
  49860. else if (this.lt(d.data, a))
  49861. if (null == d.next) {
  49862. null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ?
  49863. b = new c.util.ZPP_Set_ZPP_CbSet : (b = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool = b.next, b.next = null);
  49864. null;
  49865. b.data = a;
  49866. d.next = b;
  49867. b.parent = d;
  49868. break
  49869. } else d = d.next;
  49870. else break; if (null == b) return d;
  49871. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49872. return b
  49873. },
  49874. try_insert_bool: function (a) {
  49875. var b = null,
  49876. d = null;
  49877. if (null == this.parent) null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSet : (b = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool =
  49878. b.next, b.next = null), null, b.data = a, this.parent = b;
  49879. else
  49880. for (d = this.parent;;)
  49881. if (this.lt(a, d.data))
  49882. if (null == d.prev) {
  49883. null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSet : (b = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool = b.next, b.next = null);
  49884. null;
  49885. b.data = a;
  49886. d.prev = b;
  49887. b.parent = d;
  49888. break
  49889. } else d = d.prev;
  49890. else if (this.lt(d.data, a))
  49891. if (null == d.next) {
  49892. null == c.util.ZPP_Set_ZPP_CbSet.zpp_pool ? b = new c.util.ZPP_Set_ZPP_CbSet : (b = c.util.ZPP_Set_ZPP_CbSet.zpp_pool, c.util.ZPP_Set_ZPP_CbSet.zpp_pool =
  49893. b.next, b.next = null);
  49894. null;
  49895. b.data = a;
  49896. d.next = b;
  49897. b.parent = d;
  49898. break
  49899. } else d = d.next;
  49900. else break; if (null == b) return !1;
  49901. null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
  49902. return !0
  49903. },
  49904. __fix_dbl_red: function (a) {
  49905. for (;;) {
  49906. var b = a.parent,
  49907. c = b.parent;
  49908. if (null == c) {
  49909. b.colour = 1;
  49910. break
  49911. }
  49912. var g, e, f, h, k, n, p;
  49913. b == c.prev ? (f = c, p = c.next, a == b.prev ? (g = a, e = b, h = a.prev, k = a.next, n = b.next) : (g = b, e = a, h = b.prev, k = a.prev, n = a.next)) : (g = c, h = c.prev, a == b.prev ? (e = a, f = b, k = a.prev, n = a.next, p = b.next) : (e = b, f = a, k = b.prev, n = a.prev, p =
  49914. a.next));
  49915. a = c.parent;
  49916. null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
  49917. null != e && (e.parent = a);
  49918. g.prev = h;
  49919. null != h && (h.parent = g);
  49920. g.next = k;
  49921. null != k && (k.parent = g);
  49922. e.prev = g;
  49923. null != g && (g.parent = e);
  49924. e.next = f;
  49925. null != f && (f.parent = e);
  49926. f.prev = n;
  49927. null != n && (n.parent = f);
  49928. f.next = p;
  49929. null != p && (p.parent = f);
  49930. e.colour = c.colour - 1;
  49931. g.colour = 1;
  49932. f.colour = 1;
  49933. if (e == this.parent) this.parent.colour = 1;
  49934. else if (0 == e.colour && 0 == e.parent.colour) {
  49935. a = e;
  49936. continue
  49937. }
  49938. break
  49939. }
  49940. },
  49941. __fix_neg_red: function (a) {
  49942. var b = a.parent,
  49943. c = b.prev == a ? function (c) {
  49944. var d = a.prev,
  49945. f =
  49946. a.next,
  49947. h = f.prev,
  49948. k = f.next;
  49949. d.colour = 0;
  49950. a.colour = b.colour = 1;
  49951. a.next = h;
  49952. null != h && (h.parent = a);
  49953. h = b.data;
  49954. b.data = f.data;
  49955. f.data = h;
  49956. null != c.swapped && c.swapped(b.data, f.data);
  49957. f.prev = k;
  49958. null != k && (k.parent = f);
  49959. f.next = b.next;
  49960. null != b.next && (b.next.parent = f);
  49961. b.next = f;
  49962. null != f && (f.parent = b);
  49963. return d
  49964. }(this) : function (c) {
  49965. var d = a.next,
  49966. f = a.prev,
  49967. h = f.next,
  49968. k = f.prev;
  49969. d.colour = 0;
  49970. a.colour = b.colour = 1;
  49971. a.prev = h;
  49972. null != h && (h.parent = a);
  49973. h = b.data;
  49974. b.data = f.data;
  49975. f.data = h;
  49976. null != c.swapped && c.swapped(b.data, f.data);
  49977. f.next = k;
  49978. null != k && (k.parent =
  49979. f);
  49980. f.prev = b.prev;
  49981. null != b.prev && (b.prev.parent = f);
  49982. b.prev = f;
  49983. null != f && (f.parent = b);
  49984. return d
  49985. }(this);
  49986. null != c.prev && 0 == c.prev.colour ? this.__fix_dbl_red(c.prev) : null != c.next && 0 == c.next.colour && this.__fix_dbl_red(c.next)
  49987. },
  49988. clear_node: function (a, b) {
  49989. b(a.data);
  49990. var d = a.parent;
  49991. null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
  49992. a.data = null;
  49993. a.lt = null;
  49994. a.swapped = null;
  49995. a.next = c.util.ZPP_Set_ZPP_CbSet.zpp_pool;
  49996. c.util.ZPP_Set_ZPP_CbSet.zpp_pool = a;
  49997. return d
  49998. },
  49999. clear_with: function (a) {
  50000. if (null != this.parent) {
  50001. for (var b =
  50002. this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
  50003. this.parent = null
  50004. }
  50005. },
  50006. clear: function () {
  50007. this.clear_with(function (a) {})
  50008. },
  50009. remove_node: function (a) {
  50010. if (null != a.next && null != a.prev) {
  50011. for (var b = a.next; null != b.prev;) b = b.prev;
  50012. var d = a.data;
  50013. a.data = b.data;
  50014. b.data = d;
  50015. null != this.swapped && this.swapped(a.data, b.data);
  50016. a = b
  50017. }
  50018. b = null == a.prev ? a.next : a.prev;
  50019. if (1 == a.colour)
  50020. if (null != a.prev || null != a.next) b.colour = 1;
  50021. else if (null != a.parent)
  50022. for (d = a.parent;;) {
  50023. d.colour++;
  50024. d.prev.colour--;
  50025. d.next.colour--;
  50026. var g = d.prev;
  50027. if (-1 == g.colour) {
  50028. this.__fix_neg_red(g);
  50029. break
  50030. } else if (0 == g.colour) {
  50031. if (null != g.prev && 0 == g.prev.colour) {
  50032. this.__fix_dbl_red(g.prev);
  50033. break
  50034. }
  50035. if (null != g.next && 0 == g.next.colour) {
  50036. this.__fix_dbl_red(g.next);
  50037. break
  50038. }
  50039. }
  50040. g = d.next;
  50041. if (-1 == g.colour) {
  50042. this.__fix_neg_red(g);
  50043. break
  50044. } else if (0 == g.colour) {
  50045. if (null != g.prev && 0 == g.prev.colour) {
  50046. this.__fix_dbl_red(g.prev);
  50047. break
  50048. }
  50049. if (null != g.next && 0 == g.next.colour) {
  50050. this.__fix_dbl_red(g.next);
  50051. break
  50052. }
  50053. }
  50054. if (2 == d.colour)
  50055. if (null == d.parent) d.colour = 1;
  50056. else {
  50057. d = d.parent;
  50058. continue
  50059. }
  50060. break
  50061. }
  50062. d =
  50063. a.parent;
  50064. null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
  50065. null != b && (b.parent = d);
  50066. a.parent = a.prev = a.next = null;
  50067. a.data = null;
  50068. a.lt = null;
  50069. a.swapped = null;
  50070. a.next = c.util.ZPP_Set_ZPP_CbSet.zpp_pool;
  50071. c.util.ZPP_Set_ZPP_CbSet.zpp_pool = a
  50072. },
  50073. predecessor: function (a) {
  50074. a = this.predecessor_node(this.find(a));
  50075. return null == a ? null : a.data
  50076. },
  50077. successor: function (a) {
  50078. a = this.successor_node(this.find(a));
  50079. return null == a ? null : a.data
  50080. },
  50081. predecessor_node: function (a) {
  50082. if (null != a.prev)
  50083. for (a = a.prev; null != a.next;) a = a.next;
  50084. else {
  50085. var b = a;
  50086. for (a = a.parent; null !=
  50087. a && a.next != b;) b = a, a = a.parent
  50088. }
  50089. return a
  50090. },
  50091. successor_node: function (a) {
  50092. if (null != a.next)
  50093. for (a = a.next; null != a.prev;) a = a.prev;
  50094. else {
  50095. var b = a;
  50096. for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
  50097. }
  50098. return a
  50099. },
  50100. remove: function (a) {
  50101. a = this.find(a);
  50102. this.remove_node(a)
  50103. },
  50104. pop_front: function () {
  50105. for (var a = this.parent; null != a.prev;) a = a.prev;
  50106. var b = a.data;
  50107. this.remove_node(a);
  50108. return b
  50109. },
  50110. first: function () {
  50111. for (var a = this.parent; null != a.prev;) a = a.prev;
  50112. return a.data
  50113. },
  50114. lower_bound: function (a) {
  50115. var b = null;
  50116. if (!this.empty()) {
  50117. for (var c = this.parent; null !=
  50118. c.prev;) c = c.prev;
  50119. for (; null != c;) {
  50120. var g = c.data;
  50121. if (!this.lt(g, a)) {
  50122. b = g;
  50123. break
  50124. }
  50125. if (null != c.next)
  50126. for (c = c.next; null != c.prev;) c = c.prev;
  50127. else {
  50128. for (; null != c.parent && c == c.parent.next;) c = c.parent;
  50129. c = c.parent
  50130. }
  50131. }
  50132. }
  50133. return b
  50134. },
  50135. find_weak: function (a) {
  50136. for (var b = this.parent; null != b;)
  50137. if (this.lt(a, b.data)) b = b.prev;
  50138. else if (this.lt(b.data, a)) b = b.next;
  50139. else break;
  50140. return b
  50141. },
  50142. has_weak: function (a) {
  50143. return null != this.find_weak(a)
  50144. },
  50145. find: function (a) {
  50146. for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
  50147. return b
  50148. },
  50149. has: function (a) {
  50150. return null !=
  50151. this.find(a)
  50152. },
  50153. size: function () {
  50154. var a = 0;
  50155. if (!this.empty()) {
  50156. for (var b = this.parent; null != b.prev;) b = b.prev;
  50157. for (; null != b;)
  50158. if (a++, null != b.next)
  50159. for (b = b.next; null != b.prev;) b = b.prev;
  50160. else {
  50161. for (; null != b.parent && b == b.parent.next;) b = b.parent;
  50162. b = b.parent
  50163. }
  50164. }
  50165. return a
  50166. },
  50167. singular: function () {
  50168. return null != this.parent && null == this.parent.prev && null == this.parent.next
  50169. },
  50170. empty: function () {
  50171. return null == this.parent
  50172. },
  50173. verify: function () {
  50174. if (!this.empty()) {
  50175. for (var a = this.parent; null != a.prev;) a = a.prev;
  50176. for (; null != a;) {
  50177. var b = a.data,
  50178. c = !0;
  50179. if (!this.empty()) {
  50180. for (var g =
  50181. this.parent; null != g.prev;) g = g.prev;
  50182. for (; null != g;) {
  50183. var e = g.data;
  50184. if (!c) {
  50185. if (!this.lt(b, e) && this.lt(e, b)) return !1
  50186. } else if (b == e) c = !1;
  50187. else if (!this.lt(e, b) && this.lt(b, e)) return !1;
  50188. if (null != g.next)
  50189. for (g = g.next; null != g.prev;) g = g.prev;
  50190. else {
  50191. for (; null != g.parent && g == g.parent.next;) g = g.parent;
  50192. g = g.parent
  50193. }
  50194. }
  50195. }
  50196. if (null != a.next)
  50197. for (a = a.next; null != a.prev;) a = a.prev;
  50198. else {
  50199. for (; null != a.parent && a == a.parent.next;) a = a.parent;
  50200. a = a.parent
  50201. }
  50202. }
  50203. }
  50204. return !0
  50205. },
  50206. alloc: function () {},
  50207. free: function () {
  50208. this.swapped = this.lt = this.data = null
  50209. },
  50210. __class__: c.util.ZPP_Set_ZPP_CbSet
  50211. };
  50212. var da, va = 0;
  50213. k.display.DisplayObject.remapTouch = new y.ds.StringMap;
  50214. k.display.DisplayObject.remapTouch.set("mousedown", "touchstart");
  50215. k.display.DisplayObject.remapTouch.set("mousemove", "touchmove");
  50216. k.display.DisplayObject.remapTouch.set("mouseup", "touchend");
  50217. Array.prototype.indexOf && (S.remove = function (a, b) {
  50218. var c = a.indexOf(b);
  50219. if (-1 == c) return !1;
  50220. a.splice(c, 1);
  50221. return !0
  50222. });
  50223. Math.__name__ = ["Math"];
  50224. Math.NaN = Number.NaN;
  50225. Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
  50226. Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
  50227. s.Math = Math;
  50228. Math.isFinite = function (a) {
  50229. return isFinite(a)
  50230. };
  50231. Math.isNaN = function (a) {
  50232. return isNaN(a)
  50233. };
  50234. String.prototype.__class__ = s.String = String;
  50235. String.__name__ = ["String"];
  50236. Array.prototype.__class__ = s.Array = Array;
  50237. Array.__name__ = ["Array"];
  50238. Date.prototype.__class__ = s.Date = Date;
  50239. Date.__name__ = ["Date"];
  50240. var wa = s.Int = {
  50241. __name__: ["Int"]
  50242. },
  50243. xa = s.Dynamic = {
  50244. __name__: ["Dynamic"]
  50245. },
  50246. sa = s.Float = Number;
  50247. sa.__name__ = ["Float"];
  50248. var ta = s.Bool = Boolean;
  50249. ta.__ename__ = ["Bool"];
  50250. var ya = s.Class = {
  50251. __name__: ["Class"]
  50252. },
  50253. za = {};
  50254. O.Element = "element";
  50255. O.PCData = "pcdata";
  50256. O.CData = "cdata";
  50257. O.Comment = "comment";
  50258. O.DocType = "doctype";
  50259. O.ProcessingInstruction = "processingInstruction";
  50260. O.Document = "document";
  50261. k.Lib.schList = [];
  50262. k.Lib.schLength = 0;
  50263. window.reqAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) {
  50264. window.setTimeout(a, 700 / k.Lib.frameRate, null)
  50265. };
  50266. (function () {
  50267. var a = Event.prototype,
  50268. b = k.events.Event.prototype;
  50269. a.clone = b.clone;
  50270. a.isDefaultPrevented =
  50271. b.isDefaultPrevented;
  50272. a.get_target = b.get_target;
  50273. a.set_target = b.set_target;
  50274. a.get_currentTarget = b.get_currentTarget;
  50275. a.set_currentTarget = b.set_currentTarget
  50276. })();
  50277. (function () {
  50278. var a = MouseEvent.prototype,
  50279. b = k.events.MouseEvent.prototype;
  50280. a.get_buttonDown = b.get_buttonDown;
  50281. a.get_delta = b.get_delta;
  50282. a.get_stageX = b.get_stageX;
  50283. a.get_stageY = b.get_stageY;
  50284. a.get_localX = b.get_localX;
  50285. a.get_localY = b.get_localY;
  50286. a.get_localPoint = b.get_localPoint
  50287. })();
  50288. y.Resource.content = [{
  50289. name: "levels",
  50290. data: "s54619:PGxldmVscz4NCiAgIA0KICAgDQogICANCiAgIA0KICAgDQogICANCiAgIA0KICAgDQogICANCiAgIA0KICAgDQogICANCiAgIA0KICAgDQogICANCiAgIA0KICAgDQogICANCiAgIDxsZXZlbD4NCiAgICAgIDxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMjAwIiB5PSI0NjAiIHJvdD0iMCIvPg0KICAgICAgPG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyNDAiIHk9IjQ2MCIgcm90PSIwIi8%DQogICAgICA8b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI4MCIgeT0iNDYwIiByb3Q9IjAiLz4NCiAgICAgIDxvYmplY3QgdHlwZT0iYmxvY2s0NCIgeD0iMjAwIiB5PSI0MDAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjI4MCIgeT0iNDAwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIiLz4NCiAgICAgIDwvb2JqZWN0Pg0KICAgICAgPG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSIzNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMyIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjE0MCIgeT0iMzIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjQiLz4NCiAgICAgIDwvb2JqZWN0Pg0KICAgICAgPG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyNDAiIHk9IjMyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI1Ii8%DQogICAgICA8L29iamVjdD4NCiAgICAgIDxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMzQwIiB5PSIzMjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNiIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIxOTAiIHk9IjMwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI3Ii8%DQogICAgICA8L29iamVjdD4NCiAgICAgIDxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjMwMCIgeT0iMzAwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjgiLz4NCiAgICAgIDwvb2JqZWN0Pg0KICAgICAgPG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSIyNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iOSIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjEzMCIgeT0iMjMwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD4NCiAgICAgIDxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMjMwIiB5PSIyMzAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTIiLz4NCiAgICAgIDwvb2JqZWN0Pg0KICAgICAgPG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIzNTAiIHk9IjIzMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxNSIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjMzMCIgeT0iMjMwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjE0Ii8%DQogICAgICA8L29iamVjdD4NCiAgICAgIDxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMjUwIiB5PSIyMzAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTMiLz4NCiAgICAgIDwvb2JqZWN0Pg0KICAgICAgPG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxNTAiIHk9IjIzMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIxOTAiIHk9IjIyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxNiIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIyOTAiIHk9IjIyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxNyIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9ImJsb2NrMTIxIiB4PSIyNDAiIHk9IjE5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxOCIvPg0KICAgICAgPC9vYmplY3Q%DQogICAgICA8b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjIwMCIgeT0iMTQwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjE5Ii8%DQogICAgICA8L29iamVjdD4NCiAgICAgIDxvYmplY3QgdHlwZT0idHJpYW5nbGU0NCIgeD0iMjgwIiB5PSIxNDAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMjAiLz4NCiAgICAgIDwvb2JqZWN0Pg0KICAgICAgPG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMjQwIiB5PSI3MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyMSIvPg0KICAgICAgPC9vYmplY3Q%DQogICA8L2xldmVsPg0KICAgDQogICANCiAgIA0KICAgDQogICANCjxsZXZlbD48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iNDAiIHk9IjEwMCIgcm90PSIwIj48Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMjAsMCwyMCwyMCwwLDIwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSIyMDAiIHk9IjEzMCIgcm90PSIwIj48Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMjAsMCwyMCwyMCwwLDIwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSI0NDAiIHk9IjI2MCIgcm90PSIwIj48Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMjAsMCwyMCwyMCwwLDIwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSIyNjAiIHk9IjI5MCIgcm90PSIwIj48Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMjAsMCwyMCwyMCwwLDIwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSI2MCIgeT0iNTIwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjI2MCIgeT0iNTYwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjMwMCIgeT0iNTMwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjMzMCIgeT0iNTAwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iNzAiIHk9IjIwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMTMwIiB5PSI4MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjM1MCIgeT0iMjUwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIzIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMTUwIiB5PSI0ODAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjQiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSIyMCIgdGl0bGU9Imhvb2RhNCI%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjE4MCIgeT0iNDYwIiByb3Q9IjAiPg0KICAgICAgICAgDQogICAgICA8Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMCwwLDIwLDAsMjAsMjAsMCwyMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSIyNDAiIHk9IjQ2MCIgcm90PSIwIj4NCiAgICAgICAgIA0KICAgICAgPGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjAsMCwyMCwwLDIwLDIwLDAsMjAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iMzAwIiB5PSI0NjAiIHJvdD0iMCI%DQogICAgICAgICANCiAgICAgIDxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIwLDAsMjAsMCwyMCwyMCwwLDIwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxOTAiIHk9IjQ1MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxOTAiIHk9IjQzMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxOTAiIHk9IjQxMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxOTAiIHk9IjM5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxOTAiIHk9IjM3MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIyNTAiIHk9IjQ1MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIyNTAiIHk9IjQzMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIyNTAiIHk9IjQxMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIyNTAiIHk9IjM5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIyNTAiIHk9IjM3MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIzMTAiIHk9IjQ1MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIzMTAiIHk9IjQzMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIzMTAiIHk9IjQxMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIzMTAiIHk9IjM5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIzMTAiIHk9IjM3MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIyOTAiIHk9IjMyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIyMTAiIHk9IjMyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjYwIiB5PSIyNzAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjI2MCIgeT0iMjEwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjMwIi8%DQogICAgICA8L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSIxIiB0aXRsZT0iMyBiaWdzIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI0MCIgeT0iNDgwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI4MCIgeT0iNDgwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjMyMCIgeT0iNDgwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjM2MCIgeT0iNDgwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjMwMCIgeT0iNDIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjMwMCIgeT0iMzQwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjMwMCIgeT0iMjYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjMwMCIgeT0iMTgwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjwvbGV2ZWw%PGxldmVsIG5hbWU9IjIxIiB0aXRsZT0icm9sbHkgZG93biI%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjI4MCIgeT0iMzYwIiByb3Q9IjAiPg0KICAgICAgICAgDQogICAgICA8Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMCwwLDE4MCwtNTAsMTgwLC0zMCwwLDIwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjIyMCIgeT0iMzcwIiByb3Q9IjAiPg0KICAgICAgICAgDQogICAgICA8Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMCwxMCwtMTYwLC03MCwtMTYwLC05MCwwLC0xMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjQ0MCIgeT0iMjkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSI5MCIgeT0iMjcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIzOTAiIHk9IjIxMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iMzEwIiB5PSIyMTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjIyMCIgeT0iMjEwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIxODAiIHk9IjIyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iMTcwIiB5PSIyNjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjE5MCIgeT0iMjcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIyNjAiIHk9IjI5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iMzIwIiB5PSIyOTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjM3MCIgeT0iMjgwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIzNjAiIHk9IjI1MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iMjcwIiB5PSIyNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjI0MCIgeT0iMjUwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9Imhvb2RhIiB4PSIxNjAiIHk9Ijk3IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjI2MyIgeT0iMTAyIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjM2OSIgeT0iMTAwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyMCIvPjwvb2JqZWN0PjwvbGV2ZWw%PGxldmVsIG5hbWU9IjIiIHRpdGxlPSIyIGJpZyA0IHNtYWxsIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjIwMCIgeT0iNDQwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI0MCIgeT0iNDQwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI4MCIgeT0iNDQwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjI0MCIgeT0iMzgwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMzIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEyIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjI2MCIgeT0iMzIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjExIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjIxMCIgeT0iMjkwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMyIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMjMwIiB5PSIyOTAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjE0Ii8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIyNTAiIHk9IjI5MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTUiLz48L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjI3MCIgeT0iMjkwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxNiIvPjwvb2JqZWN0PjwvbGV2ZWw%PGxldmVsIG5hbWU9IjMiIHRpdGxlPSJ3aXRoIDQgdHJpYW5nbGVzIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjE4MCIgeT0iNDIwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjIyMCIgeT0iNDIwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI2MCIgeT0iNDIwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjMwMCIgeT0iNDIwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjE2MCIgeT0iMzYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2s0NCIgeD0iMzIwIiB5PSIzNjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSIzMTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIxNjAiIHk9IjI2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI0Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjI0MCIgeT0iMjYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjUiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0idHJpYW5nbGU0NCIgeD0iMzIwIiB5PSIyNjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIxODkiIHk9IjE2MyIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlMjIiIHg9IjI4MSIgeT0iMTY0IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0idHJpYW5nbGUyMiIgeD0iMTQ1IiB5PSIxMzUiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNzEiIHk9IjExOSIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSI0IiB0aXRsZT0iNSBiaWdzIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjIyMCIgeT0iNTAwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI2MCIgeT0iNTAwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjI0MCIgeT0iNDYwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMjQwIiB5PSI0MjAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyNDAiIHk9IjM4MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjI0MCIgeT0iMzQwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMjQwIiB5PSIzMDAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyNDAiIHk9IjI2MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjI0MCIgeT0iMjIwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMjQwIiB5PSIxODAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyNDAiIHk9IjE0MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSI1IiB0aXRsZT0iMXN0IGhvb2RhIHdpdGggc21hbGwgb25lcyI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyMDAiIHk9IjQyMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyNDAiIHk9IjQyMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyODAiIHk9IjQyMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMjQwIiB5PSIzMjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSIzOTAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEiLz48L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIzMzAiIHk9IjM0MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iOSIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjE1MCIgeT0iMzQwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI5Ii8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIzMDAiIHk9IjI2MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjE4MCIgeT0iMjYwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjwvbGV2ZWw%PGxldmVsIG5hbWU9IjYiIHRpdGxlPSJiaWcgYW5kIHNtYWxscyI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyMjAiIHk9IjQ0MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyNjAiIHk9IjQ0MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIyNDAiIHk9IjM4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMzIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMjYwIiB5PSIzMjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyMjAiIHk9IjI4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI0Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjI2MCIgeT0iMjgwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjUiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMjEwIiB5PSIyNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMjMwIiB5PSIyNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMjUwIiB5PSIyNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMjcwIiB5PSIyNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0idHJpYW5nbGU0NCIgeD0iMjQwIiB5PSIyMDAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PC9sZXZlbD48bGV2ZWwgbmFtZT0iNyIgdGl0bGU9IlBhcHVyIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjQwMCIgeT0iNTAwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjgwIiB5PSI1MDAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMjQwIiB5PSI1MDAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0iYmxvY2sxMTIiIHg9IjQwMCIgeT0iMzYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjMiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMTIiIHg9IjI0MCIgeT0iMzYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMTIiIHg9IjgwIiB5PSIzNjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIzOTAiIHk9IjE4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSI4MCIgeT0iMTgwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjIyMCIgeT0iMTgzIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTIxIiB4PSIzMTYiIHk9IjExNCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTEiLz48L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIyMzkiIHk9IjU0IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMiIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjQwNSIgeT0iNDEiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEyIi8%PC9vYmplY3Q%PC9sZXZlbD48bGV2ZWwgbmFtZT0iOCIgdGl0bGU9InJvbGx5cyI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSI3MCIgeT0iNTAwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjQxMCIgeT0iNTAwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjIwIiB5PSI0NDAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMTIwIiB5PSI0NDAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjEyMCIgeT0iNDcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjM2MCIgeT0iNDcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjkwIiB5PSIzNjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjQwMCIgeT0iMzMwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEyIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIxNzAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMzIwIiB5PSIzMzAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMzYwIiB5PSI0NDAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iNDYwIiB5PSI0NDAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjIxMSIgeT0iMjYwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjI4MCIgeT0iMjQwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjIzMCIgeT0iMTgwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjMyMCIgeT0iMTQwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjE3NyIgeT0iODIiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMTE3IiB5PSIxOTAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMjQ5IiB5PSI0NCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMjAiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSI5IiB0aXRsZT0ic3RhY2tpbmcgaGlnaCI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIxNDAiIHk9IjUyMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIzNDAiIHk9IjUyMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIxNDAiIHk9IjQ2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjE0MCIgeT0iMzgwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjQiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2s0NCIgeD0iMzQwIiB5PSI0NjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIzNDAiIHk9IjM4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIzIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjEyMCIgeT0iMzIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjE2MCIgeT0iMzIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjkiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMTYwIiB5PSIyODAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMTIwIiB5PSIyODAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTEiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMzIwIiB5PSIzMjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIzNjAiIHk9IjMyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI1Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjM2MCIgeT0iMjgwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjciLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMzIwIiB5PSIyODAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iOCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSIxNzAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTUiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjE0MyIgeT0iMTIxIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjE2Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIzMjgiIHk9IjExNyIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxNyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMTQwIiB5PSIyMDgiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjE0Ii8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMzQyIiB5PSIyMDQiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEzIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMjQ1IiB5PSIxMjAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjE4Ii8%PC9vYmplY3Q%PC9sZXZlbD48bGV2ZWwgbmFtZT0iMTAiIHRpdGxlPSJob29kYSBweXJhbWlkIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjgwIiB5PSI1MjAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMTYwIiB5PSI1MjAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMjQwIiB5PSI1MjAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMzIwIiB5PSI1MjAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iNDAwIiB5PSI1MjAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0idHJpYW5nbGU0NCIgeD0iMTIwIiB5PSI0NjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIyMDAiIHk9IjQ2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjI4MCIgeT0iNDYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjMiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0idHJpYW5nbGU0NCIgeD0iMzYwIiB5PSI0NjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSI0MTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIxNjAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI2Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjI0MCIgeT0iMzYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjciLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0idHJpYW5nbGU0NCIgeD0iMzIwIiB5PSIzNjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iOCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSIzMTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iOSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSIyMTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjI0MiIgeT0iMTM3IiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEzIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9Imhvb2RhIiB4PSIxNjQiIHk9IjI0NCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9Imhvb2RhIiB4PSIzMDIiIHk9IjI1MSIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTEiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSIxMSIgdGl0bGU9InNtYWxsIHB5ciI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyMjAiIHk9IjQ2MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyNjAiIHk9IjQ2MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyMjAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNjAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIzMDAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIxODAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyMDAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNDAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyODAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyMDAiIHk9IjM5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNDAiIHk9IjM5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyODAiIHk9IjM5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyMjAiIHk9IjM4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNjAiIHk9IjM4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyMjAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNjAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNDAiIHk9IjM1MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIyNDAiIHk9IjMzMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIzMDAiIHk9IjQ2MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIxODAiIHk9IjQ2MCIgcm90PSIwIi8%PC9sZXZlbD48bGV2ZWwgbmFtZT0iMTIiIHRpdGxlPSJsYWRkZXIiPjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSIzODAiIHk9IjQ2MCIgcm90PSIwIj4NDSAgICAgICAgIA0NICAgICAgPGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iMyIgdmVydGljZXM9IjAsMCw0MCwyMCwwLDIwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjM0MiIgeT0iNDQwIiByb3Q9IjAiPg0NICAgICAgICAgDQ0gICAgICA8Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSIzIiB2ZXJ0aWNlcz0iMCwwLDQwLDIwLDAsMjAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTIxIiB4PSIyNjAiIHk9IjQ3MCIgcm90PSIwIj4NDSAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0NICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjIwIiB5PSI0NTAiIHJvdD0iMCI%DQ0gICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NDSAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjEyMCIgeT0iNDIwIiByb3Q9IjAiPg0NICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQ0gICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIxNjAiIHk9IjQyMCIgcm90PSIwIj4NDSAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0NICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iMjAwIiB5PSI0MjAiIHJvdD0iMCI%DQ0gICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NDSAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjI0MCIgeT0iNDIwIiByb3Q9IjAiPg0NICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQ0gICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIyODAiIHk9IjQyMCIgcm90PSIwIj4NDSAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0NICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMTQwIiB5PSIzNjAiIHJvdD0iMCI%DQ0gICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NDSAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjIyMCIgeT0iMzYwIiByb3Q9IjAiPg0NICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQ0gICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIxODAiIHk9IjI5MCIgcm90PSIwIj4NDSAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0NICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjgwIiB5PSI0NDAiIHJvdD0iMCI%PGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsMjAsMCwyMCwwLDAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iMTIwIiB5PSI0NjAiIHJvdD0iMCI%PGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsMjAsMCwyMCwwLDAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iMTQwIiB5PSI0ODAiIHJvdD0iMCI%PGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsMjAsMCwyMCwwLDAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iMzYwIiB5PSI0ODAiIHJvdD0iMCI%PGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsMjAsMCwyMCwwLDAiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSIxMyIgdGl0bGU9ImJhbGxhbmNlIG5vIGNpcmMiPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMjQwIiB5PSI0NjAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0iYmxvY2sxMTIiIHg9IjI0MCIgeT0iMzIwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjI0MCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjI0MCIgeT0iMTcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjMiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjMxNyIgeT0iMTI1IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjI3NCIgeT0iMTMxIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjIzNiIgeT0iMTMyIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjE4OSIgeT0iMTM0IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjwvbGV2ZWw%PGxldmVsIG5hbWU9IjE0IiB0aXRsZT0iYmlnIHRvd2VyIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjIyMCIgeT0iNTMwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iNDkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iNDUwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iNDEwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMzcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMzMwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMjkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMjUwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMjEwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjIyMCIgeT0iMTcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjIyMCIgeT0iMjIiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2s0NCIgeD0iMjIyIiB5PSIxMDUiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjExIi8%PC9vYmplY3Q%PC9sZXZlbD48bGV2ZWwgbmFtZT0iMTUiIHRpdGxlPSJob29kYWJ1cyI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIxMDAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIxNDAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIxODAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyMjAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyNjAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIzMDAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIzNDAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIzODAiIHk9IjUwMCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMTMwIiB5PSI0NDAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMjkwIiB5PSI0NDAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjEwIiB5PSIzOTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMTQzIiB5PSIzMzQiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMzAwIiB5PSIzMzAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMjIyIiB5PSIzMzEiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iOCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIyOTYiIHk9IjE5NSIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIyMjAiIHk9IjE3OCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiB4PSIxNDUiIHk9IjIwNCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMzcwIiB5PSI0NDAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMjEwIiB5PSI0NDAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjM0IiB5PSIyNjEiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjkiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSIxNiIgdGl0bGU9InNsaXBwZXJ5Ij48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iMTgwIiB5PSI0NDAiIHJvdD0iMCI%DQogICAgICAgICANCiAgICAgIDxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjMiIHZlcnRpY2VzPSIwLDAsMCw2MCwtMTYwLDYwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjMwMCIgeT0iNDQwIiByb3Q9IjAiPg0KICAgICAgICAgDQogICAgICA8Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSIzIiB2ZXJ0aWNlcz0iMTYwLDYwLDAsNjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSI0MCIgeT0iNDYwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iNDQwIiB5PSI0NjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlNDQiIHg9IjM4MCIgeT0iNDEwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIzMTAiIHk9IjM5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iOTAiIHk9IjQxMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGU0NCIgeD0iMTYwIiB5PSIzODAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjEyMCIgeT0iMjEwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjM0NiIgeT0iMjEwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPjwvb2JqZWN0PjwvbGV2ZWw%PGxldmVsIG5hbWU9IjE3IiB0aXRsZT0iYm94eSI%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjYwIiB5PSI4MCIgcm90PSIwIj4NCiAgICAgICAgIA0KICAgICAgPGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsMzgwLDAsMzgwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjEzMSIgeT0iMTI0IiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjYiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjE0NSIgeT0iMjk4IiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjMiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjE3NCIgeT0iMzU3IiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjMiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjE0MiIgeT0iMjQ4IiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjQiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjEzNiIgeT0iMTg3IiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjUiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSI2MCIgeT0iNDgwIiByb3Q9IjAiPg0KICAgICAgICAgDQogICAgICA8Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMjAsMCwyMCwyMCwwLDIwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjE4MCIgeT0iNDcwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjMyMCIgeT0iNDUwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjkiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSI0MjAiIHk9IjQ2MCIgcm90PSIwIj4NCiAgICAgICAgIA0KICAgICAgPGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsNDAsMCw0MCwwLDAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iNDIwIiB5PSI4MCIgcm90PSIwIj4NCiAgICAgICAgIA0KICAgICAgPGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsMzYwLDAsMzYwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjI0MiIgeT0iMjQyIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIzMTgiIHk9IjMwNiIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iMzYwIiB5PSIyNjEiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjM2NCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIyNjAiIHk9IjE4NSIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJ0cmlhbmdsZTIyIiB4PSIzNDciIHk9IjM4NyIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0idHJpYW5nbGUyMiIgeD0iMjU1IiB5PSIzNjgiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSIxOCIgdGl0bGU9ImJhbGFuY2Ugc2hpdCI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyNDAiIHk9IjQ2MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJibG9jazEyMSIgeD0iMjQwIiB5PSI0MzAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIxNDAiIHk9IjQwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIxODAiIHk9IjQwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyMjAiIHk9IjQwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyNjAiIHk9IjQwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIzMDAiIHk9IjQwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIzNDAiIHk9IjQwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIzNDAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIzMDAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyNjAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIyMjAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIxODAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIxNDAiIHk9IjM2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIxNjAiIHk9IjMwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIyNDAiIHk9IjMwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIzMjAiIHk9IjMwMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIzMjAiIHk9IjIyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIyNDAiIHk9IjIyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIxNjAiIHk9IjIyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMTc5IiB5PSIxMTYiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEzIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMzAyIiB5PSIxMTkiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjE0Ii8%PC9vYmplY3Q%PC9sZXZlbD48bGV2ZWwgbmFtZT0iMTkiIHRpdGxlPSJiYWxhbmNlIGhhcmQiPjxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgeD0iMjQwIiB5PSI0NjAiIHJvdD0iMCIvPjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMjQwIiB5PSI0MDAiIHJvdD0iMCI%DQ0gICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMiIvPg0NICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIyNDAiIHk9IjM0MCIgcm90PSIwIj4NDSAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIzIi8%DQ0gICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjIyNyIgeT0iNDMyIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIyNDgiIHk9IjQzMCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjIzOCIgeT0iMjQzIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMCIvPjwvb2JqZWN0PjwvbGV2ZWw%PGxldmVsIG5hbWU9IjIyIiB0aXRsZT0ibGF5ZXJzIj48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjIwMCIgeT0iNDYwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI0MCIgeT0iNDYwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjI4MCIgeT0iNDYwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9ImJsb2NrMTIxIiB4PSIyNDAiIHk9IjMxMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIzIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjE0MCIgeT0iMjgwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjQiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMjQwIiB5PSIyODAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIzNDAiIHk9IjI4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI2Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIxOTAiIHk9IjI2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI3Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIzMDAiIHk9IjI2MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI4Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTIxIiB4PSIyNDAiIHk9IjIxMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI5Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjEzMCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjIzMCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEyIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjM1MCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjE1Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjMzMCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjE0Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjI1MCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjEzIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjE1MCIgeT0iMTkwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjExIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiB4PSIxOTAiIHk9IjE4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxNiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJjaXJjbGUyMiIgeD0iMjkwIiB5PSIxODAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMTciLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjI0MCIgeT0iMTUwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjE4Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjIwMCIgeT0iMTAwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjE5Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InRyaWFuZ2xlNDQiIHg9IjI4MCIgeT0iMTAwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIwIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiB4PSIyNDAiIHk9IjMwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIxIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjMyMCIgeT0iNDYwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9InN0YXRpY2Jsb2NrMjIiIHg9IjE2MCIgeT0iNDYwIiByb3Q9IjAiLz48b2JqZWN0IHR5cGU9Imhvb2RhIiB4PSIxODAiIHk9IjM4MCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMSIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjMwMCIgeT0iMzgwIiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyIi8%PC9vYmplY3Q%PC9sZXZlbD48bGV2ZWwgbmFtZT0iMjMiIHRpdGxlPSIzIHRvd2VycyI%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIxNjAiIHk9IjQ4MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIyNDAiIHk9IjQ4MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJzdGF0aWNibG9jazIyIiB4PSIzMjAiIHk9IjQ4MCIgcm90PSIwIi8%PG9iamVjdCB0eXBlPSJibG9jazExMiIgeD0iMjQwIiB5PSIzNDAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazQ0IiB4PSIzMjAiIHk9IjQyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxIi8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrNDQiIHg9IjMyMCIgeT0iMzQwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjIiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2s0NCIgeD0iMTYwIiB5PSI0MjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iMyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIzMjAiIHk9IjI4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI1Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMjIiIHg9IjMyMCIgeT0iMjQwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjYiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2syMiIgeD0iMTgwIiB5PSIzNjAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iNyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIxODAiIHk9IjMyMCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMSIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIxODAiIHk9IjI4MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMiIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazIyIiB4PSIxODAiIHk9IjI0MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxMyIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxNTAiIHk9IjM3MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI4Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTEiIHg9IjE1MCIgeT0iMzUwIiByb3Q9IjAiPg0KICAgICAgICAgPHByb3BlcnRpZXMgcG9zaXRpb249IjgiLz4NCiAgICAgIDwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMSIgeD0iMTMwIiB5PSIzNTAiIHJvdD0iMCI%DQogICAgICAgICA8cHJvcGVydGllcyBwb3NpdGlvbj0iOCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJibG9jazExIiB4PSIxMzAiIHk9IjM3MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSI4Ii8%DQogICAgICA8L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTIxIiB4PSIyNDAiIHk9IjE5MCIgcm90PSIwIj4NCiAgICAgICAgIDxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIxNCIvPg0KICAgICAgPC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMTczIiB5PSIxMjkiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjE1Ii8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMjg2IiB5PSIxMjEiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjE1Ii8%PC9vYmplY3Q%PC9sZXZlbD48bGV2ZWwgbmFtZT0iMjQiIHRpdGxlPSJyb2xseSByb2xseSI%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjQwIiB5PSIxMDAiIHJvdD0iMjkuMjEiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjIwMCIgeT0iMTMwIiByb3Q9IjMxLjQ3Ij48Z2VvbWV0cnkgdHlwZT0icG9seSIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgblZlcnRpY2VzPSI0IiB2ZXJ0aWNlcz0iMjAsMCwyMCwyMCwwLDIwLDAsMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iY2lyY2xlMjIiIHg9IjcwIiB5PSIyMCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMyIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iYmxvY2sxMjEiIHg9IjEzMCIgeT0iODAiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEiLz48L29iamVjdD48b2JqZWN0IHR5cGU9ImJsb2NrMTIxIiB4PSIzNjAiIHk9IjIxMCIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iNCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSIyODAiIHk9IjI3MCIgcm90PSIyOS4yMSI%PGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iNCIgdmVydGljZXM9IjIwLDAsMjAsMjAsMCwyMCwwLDAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9InN0YXRpY2dyZWVueSIgeD0iNDYwIiB5PSIyMzAiIHJvdD0iMzEuNDciPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMTYzIiB5PSI1MDgiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjEwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iNzIiIHk9IjQ4MSIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMTAiLz48L29iamVjdD48L2xldmVsPjxsZXZlbCBuYW1lPSIyNSIgdGl0bGU9Imxhc3QgaG9vZGEiPjxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiB4PSI2MCIgeT0iNTAwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjE4MCIgeT0iNTAwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjMwMCIgeT0iNTAwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJzdGF0aWNncmVlbnkiIHg9IjQyMCIgeT0iNTAwIiByb3Q9IjAiPjxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjQiIHZlcnRpY2VzPSIyMCwwLDIwLDIwLDAsMjAsMCwwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMTMyIiB5PSI0OTUiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjIwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMjQ4LjUiIHk9IjQ5Ny41IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjM2NC41IiB5PSI0OTQuNSIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMjAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9Imhvb2RhIiB4PSIxODcuNSIgeT0iNDE4LjUiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjIwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMzA1LjUiIHk9IjQwOC41IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjI0NS41IiB5PSIzMDguNSIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMjAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9Imhvb2RhIiB4PSIyNzQuNSIgeT0iMTk5LjUiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjIwIi8%PC9vYmplY3Q%PG9iamVjdCB0eXBlPSJob29kYSIgeD0iMTMzLjUiIHk9IjE4OC41IiByb3Q9IjAiPjxwcm9wZXJ0aWVzIHBvc2l0aW9uPSIyMCIvPjwvb2JqZWN0PjxvYmplY3QgdHlwZT0iaG9vZGEiIHg9IjI0NS41IiB5PSIxMzQuNSIgcm90PSIwIj48cHJvcGVydGllcyBwb3NpdGlvbj0iMjAiLz48L29iamVjdD48b2JqZWN0IHR5cGU9Imhvb2RhIiB4PSIzMjMuNSIgeT0iMTMxLjUiIHJvdD0iMCI%PHByb3BlcnRpZXMgcG9zaXRpb249IjIwIi8%PC9vYmplY3Q%PC9sZXZlbD48L2xldmVscz4"
  50291. }, {
  50292. name: "definitions",
  50293. data: "s7944:PGRlZmluaXRpb25zPg0KPG9iamVjdHM%DQogICAgPG9iamVjdCB0eXBlPSJibG9jazExIiBlZGl0b3I9ImRvdCI%DQogICAgICAgIDxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJkeW5hbWljIj4NCiAgICAgICAgICAgIDxncmFwaGljcyB0eXBlPSJzcHJpdGUiIHNyYz0iY21jQmxvY2sxeDEiIGRlcHRoPSI1IiAvPg0KICAgICAgICAgICAgPGdlb21ldHJ5IHR5cGU9InJlY3QiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIHJhZGl1cz0iMTciIGhhbGZXaWR0aD0iMTAiIGhhbGZIZWlnaHQ9IjEwIi8%DQogICAgICAgIDwvYm9keT4NCiAgICAgICAgPHByb3BlcnR5IG5hbWU9InBvc2l0aW9uIiAvPg0KICAgIDwvb2JqZWN0Pg0KICAgIDxvYmplY3QgdHlwZT0iYmxvY2syMiIgZWRpdG9yPSJkb3QiPg0KICAgICAgICA8Ym9keSBtYXRlcmlhbD0ib3JnYW5pYyIgdHlwZT0iZHluYW1pYyI%DQogICAgICAgICAgICA8Z3JhcGhpY3MgdHlwZT0ic3ByaXRlIiBzcmM9ImNtY0Jsb2NrMngyIiBkZXB0aD0iNSIgLz4NCiAgICAgICAgICAgIDxnZW9tZXRyeSB0eXBlPSJyZWN0IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiByYWRpdXM9IjE3IiBoYWxmV2lkdGg9IjIwIiBoYWxmSGVpZ2h0PSIyMCIvPg0KICAgICAgICA8L2JvZHk%DQogICAgICAgIDxwcm9wZXJ0eSBuYW1lPSJwb3NpdGlvbiIgLz4NCiAgICA8L29iamVjdD4NCiAgICA8b2JqZWN0IHR5cGU9ImJsb2NrNDQiIGVkaXRvcj0iZG90Ij4NCiAgICAgICAgPGJvZHkgbWF0ZXJpYWw9Im9yZ2FuaWMiIHR5cGU9ImR5bmFtaWMiPg0KICAgICAgICAgICAgPGdyYXBoaWNzIHR5cGU9InNwcml0ZSIgc3JjPSJjbWNCbG9jazR4NCIgZGVwdGg9IjUiIC8%DQogICAgICAgICAgICA8Z2VvbWV0cnkgdHlwZT0icmVjdCIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgcmFkaXVzPSIxNyIgaGFsZldpZHRoPSI0MCIgaGFsZkhlaWdodD0iNDAiLz4NCiAgICAgICAgPC9ib2R5Pg0KICAgICAgICA8cHJvcGVydHkgbmFtZT0icG9zaXRpb24iIC8%DQogICAgPC9vYmplY3Q%DQogICAgPG9iamVjdCB0eXBlPSJibG9jazEyMSIgZWRpdG9yPSJkb3QiPg0KICAgICAgICA8Ym9keSBtYXRlcmlhbD0ib3JnYW5pYyIgdHlwZT0iZHluYW1pYyI%DQogICAgICAgICAgICA8Z3JhcGhpY3MgdHlwZT0ic3ByaXRlIiBzcmM9ImNtY0Jsb2NrMTJ4MSIgZGVwdGg9IjUiIC8%DQogICAgICAgICAgICA8Z2VvbWV0cnkgdHlwZT0icmVjdCIgeD0iMCIgeT0iMCIgZGVncmVlcz0iMCIgcmFkaXVzPSIxNyIgaGFsZldpZHRoPSIxMjAiIGhhbGZIZWlnaHQ9IjEwIi8%DQogICAgICAgIDwvYm9keT4NCiAgICAgICAgPHByb3BlcnR5IG5hbWU9InBvc2l0aW9uIiAvPg0KICAgIDwvb2JqZWN0Pg0KICAgIDxvYmplY3QgdHlwZT0iYmxvY2sxMTIiIGVkaXRvcj0iZG90Ij4NCiAgICAgICAgPGJvZHkgbWF0ZXJpYWw9Im9yZ2FuaWMiIHR5cGU9ImR5bmFtaWMiPg0KICAgICAgICAgICAgPGdyYXBoaWNzIHR5cGU9InNwcml0ZSIgc3JjPSJjbWNCbG9jazF4MTIiIGRlcHRoPSI1IiAvPg0KICAgICAgICAgICAgPGdlb21ldHJ5IHR5cGU9InJlY3QiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIHJhZGl1cz0iMTciIGhhbGZXaWR0aD0iMTAiIGhhbGZIZWlnaHQ9IjEyMCIvPg0KICAgICAgICA8L2JvZHk%DQogICAgICAgIDxwcm9wZXJ0eSBuYW1lPSJwb3NpdGlvbiIgLz4NCiAgICA8L29iamVjdD4NCiAgICA8b2JqZWN0IHR5cGU9ImNpcmNsZTIyIiBlZGl0b3I9ImRvdCI%DQogICAgICAgIDxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJkeW5hbWljIj4NCiAgICAgICAgICAgIDxncmFwaGljcyB0eXBlPSJzcHJpdGUiIHNyYz0iY21jQ2lyY2xlMngyIiBkZXB0aD0iNSIgLz4NCiAgICAgICAgICAgIDxnZW9tZXRyeSB0eXBlPSJjaXJjIiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiByYWRpdXM9IjIwIiAvPg0KICAgICAgICA8L2JvZHk%DQogICAgICAgIDxwcm9wZXJ0eSBuYW1lPSJwb3NpdGlvbiIgLz4NCiAgICA8L29iamVjdD4NCiAgICA8b2JqZWN0IHR5cGU9ImNpcmNsZTQ0IiBlZGl0b3I9ImRvdCI%DQogICAgICAgIDxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJkeW5hbWljIj4NCiAgICAgICAgICAgIDxncmFwaGljcyB0eXBlPSJzcHJpdGUiIHNyYz0iY21jQ2lyY2xlNHg0IiBkZXB0aD0iNSIgLz4NCiAgICAgICAgICAgIDxnZW9tZXRyeSB0eXBlPSJjaXJjIiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiByYWRpdXM9IjQwIi8%DQogICAgICAgIDwvYm9keT4NCiAgICAgICAgPHByb3BlcnR5IG5hbWU9InBvc2l0aW9uIiAvPg0KICAgIDwvb2JqZWN0Pg0KICAgIDxvYmplY3QgdHlwZT0idHJpYW5nbGUyMiIgZWRpdG9yPSJkb3QiPg0KICAgICAgICA8Ym9keSBtYXRlcmlhbD0ib3JnYW5pYyIgdHlwZT0iZHluYW1pYyI%DQogICAgICAgICAgICA8Z3JhcGhpY3MgdHlwZT0ic3ByaXRlIiBzcmM9ImNtY1RyaWFuZ2xlMngyIiBkZXB0aD0iNSIgLz4NCiAgICAgICAgICAgIDxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjMiIHZlcnRpY2VzPSIyMCwxOCwwLC0xOCwtMjAsMTgiLz4NCiAgICAgICAgPC9ib2R5Pg0KICAgICAgICA8cHJvcGVydHkgbmFtZT0icG9zaXRpb24iIC8%DQogICAgPC9vYmplY3Q%DQogICAgPG9iamVjdCB0eXBlPSJ0cmlhbmdsZTQ0IiBlZGl0b3I9ImRvdCI%DQogICAgICAgIDxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJkeW5hbWljIj4NCiAgICAgICAgICAgIDxncmFwaGljcyB0eXBlPSJzcHJpdGUiIHNyYz0iY21jVHJpYW5nbGU0eDQiIGRlcHRoPSI1IiAvPg0KICAgICAgICAgICAgPGdlb21ldHJ5IHR5cGU9InBvbHkiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIG5WZXJ0aWNlcz0iMyIgdmVydGljZXM9IjQwLDM2LDAsLTM2LC00MCwzNiIvPg0KICAgICAgICA8L2JvZHk%DQogICAgICAgIDxwcm9wZXJ0eSBuYW1lPSJwb3NpdGlvbiIgLz4NCiAgICA8L29iamVjdD4NCiAgICA8b2JqZWN0IHR5cGU9Imhvb2RhIiBlZGl0b3I9ImRvdCI%DQogICAgICAgIDxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJkeW5hbWljIj4NCiAgICAgICAgICAgIDxncmFwaGljcyB0eXBlPSJzcHJpdGUiIHNyYz0iaG9vZGFHYW1lT2JqZWN0IiBkZXB0aD0iNSIgLz4NCiAgICAgICAgICAgIDxnZW9tZXRyeSB0eXBlPSJwb2x5IiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiBuVmVydGljZXM9IjEwIiB2ZXJ0aWNlcz0iLTM0LjUsMTUuNSwtNTYuNSwtMTQuNSwtMTkuNSwtMjQuNSwtMC41LC01Ni41LDIwLjUsLTIyLjUsNTYuNSwtMTQuNSwzMi41LDEzLjUsMzUuNSw1Ni41LC0xLjUsMzguNSwtMzYuNSw1My41Ii8%DQogICAgICAgIDwvYm9keT4NCiAgICAgICAgPHByb3BlcnR5IG5hbWU9InBvc2l0aW9uIiAvPg0KICAgIDwvb2JqZWN0Pg0KICAgIDxvYmplY3QgdHlwZT0ic3RhdGljYmxvY2syMiIgZWRpdG9yPSJkb3QiPg0KICAgICAgICA8Ym9keSBtYXRlcmlhbD0ib3JnYW5pYyIgdHlwZT0ic3RhdGljIj4NCiAgICAgICAgICAgIDxncmFwaGljcyB0eXBlPSJzcHJpdGUiIHNyYz0iY21jU3RhdGljQmxvY2syeDIiIGRlcHRoPSI1IiAvPg0KICAgICAgICAgICAgPGdlb21ldHJ5IHR5cGU9InJlY3QiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIHJhZGl1cz0iMTciIGhhbGZXaWR0aD0iMjAiIGhhbGZIZWlnaHQ9IjIwIi8%DQogICAgICAgIDwvYm9keT4NCiAgICA8L29iamVjdD4NCgk8IS0tIDxvYmplY3QgdHlwZT0idmFtcGlyZSIgZWRpdG9yPSJkb3QiPg0KCQk8Ym9keSBtYXRlcmlhbD0ib3JnYW5pYyIgdHlwZT0iZHluYW1pYyI%DQoJCQk8Z3JhcGhpY3MgdHlwZT0ic3ByaXRlIiBzcmM9ImNtY0Jsb2NrSGFwcHkiIGRlcHRoPSI1IiAvPg0KCQkJPGdlb21ldHJ5IHR5cGU9InJlY3QiIHg9IjAiIHk9IjAiIGRlZ3JlZXM9IjAiIHJhZGl1cz0iMTciIGhhbGZXaWR0aD0iMjAiIGhhbGZIZWlnaHQ9IjIwIi8%DQoJCTwvYm9keT4NCgkJPHByb3BlcnR5IG5hbWU9InJvdGF0aW9uIiAvPg0KCQk8cHJvcGVydHkgbmFtZT0iY29sb3JfbG9vcCIgLz4NCgkJPHByb3BlcnR5IG5hbWU9ImxvZ2ljIiAvPg0KCTwvb2JqZWN0Pg0KICAgIDxvYmplY3QgdHlwZT0iY2lyY2FpcmUiIGVkaXRvcj0iZG90Ij4NCiAgICAgICAgPGJvZHkgbWF0ZXJpYWw9Im9yZ2FuaWMiIHR5cGU9ImR5bmFtaWMiPg0KICAgICAgICAgICAgPGdyYXBoaWNzIHR5cGU9InNwcml0ZSIgc3JjPSJjbWNCbG9ja0hhcHB5IiBkZXB0aD0iNSIgLz4NCiAgICAgICAgICAgIDxnZW9tZXRyeSB0eXBlPSJjaXJjIiB4PSIwIiB5PSIwIiBkZWdyZWVzPSIwIiByYWRpdXM9IjIyIi8%DQogICAgICAgIDwvYm9keT4NCiAgICAgICAgPHByb3BlcnR5IG5hbWU9InJvdGF0aW9uIiAvPg0KICAgICAgICA8cHJvcGVydHkgbmFtZT0iY29sb3JfbG9vcCIgLz4NCiAgICAgICAgPHByb3BlcnR5IG5hbWU9ImxvZ2ljIiAvPg0KICAgIDwvb2JqZWN0Pg0KCTxvYmplY3QgdHlwZT0iYnJpY2siIGVkaXRvcj0icmVjdCI%DQoJCTxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJzdGF0aWMiPgkJCQkJCQ0KCQkJPGdyYXBoaWNzIHR5cGU9ImZpbGwiIHNyYz0iYm1wQnJpY2siIGxpbmV3aWR0aD0iMSIgbGluZWNvbG9yPSI1QjNBMTUiIGRlcHRoPSI1IiBoZWlnaHQ9IjI1NiIgd2lkdGg9IjI1NiIgLz4NCgkJPC9ib2R5Pg0KCTwvb2JqZWN0Pg0KCTxvYmplY3QgdHlwZT0iYnJpY2siIGVkaXRvcj0icG9seSI%DQoJCTxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJzdGF0aWMiPgkJCQkJCQ0KCQkJPGdyYXBoaWNzIHR5cGU9ImZpbGwiIHNyYz0iYm1wQnJpY2siIGxpbmV3aWR0aD0iMSIgbGluZWNvbG9yPSI1QjNBMTUiIGRlcHRoPSI1IiBoZWlnaHQ9IjI1NiIgd2lkdGg9IjI1NiIgLz4NCgkJPC9ib2R5Pg0KCTwvb2JqZWN0Pg0KCTxvYmplY3QgdHlwZT0iYnJpY2siIGVkaXRvcj0iY2lyYyI%DQoJCTxib2R5IG1hdGVyaWFsPSJvcmdhbmljIiB0eXBlPSJzdGF0aWMiPgkJCQkJCQ0KCQkJPGdyYXBoaWNzIHR5cGU9ImZpbGwiIHNyYz0iYm1wQnJpY2siIGxpbmV3aWR0aD0iMSIgbGluZWNvbG9yPSI1QjNBMTUiIGRlcHRoPSI1IiBoZWlnaHQ9IjI1NiIgd2lkdGg9IjI1NiIgLz4NCgkJPC9ib2R5Pg0KCTwvb2JqZWN0Pg0KCTxvYmplY3QgdHlwZT0icm9wZSIgZWRpdG9yPSJsaW5lIj4NCgkJPGpvaW50IHR5cGU9ImRpc3RhbmNlIj4JCQkJCQkNCgkJCTxncmFwaGljcyB0eXBlPSJsaW5lIiBsaW5ld2lkdGg9IjMiIGNvbG9yMT0iMjIyMjIyIiBjb2xvcjI9Ijc3Nzc3NyIvPg0KCQk8L2pvaW50Pg0KCTwvb2JqZWN0Pi0tPg0KICAgIDxvYmplY3QgdHlwZT0ic3RhdGljZ3JlZW55IiBlZGl0b3I9InBvbHkiPg0KICAgICAgICA8Ym9keSBtYXRlcmlhbD0ib3JnYW5pYyIgdHlwZT0ic3RhdGljIj4NCiAgICAgICAgICAgIDxncmFwaGljcyB0eXBlPSJmaWxsIiBzcmM9ImJtcEJyaWNrIiBsaW5ld2lkdGg9IjEiIGxpbmVjb2xvcj0iNUIzQTE1IiBkZXB0aD0iNSIgaGVpZ2h0PSIyNTYiIHdpZHRoPSIyNTYiIC8%DQogICAgICAgIDwvYm9keT4NCiAgICA8L29iamVjdD4NCg0KPC9vYmplY3RzPg0KPHByb3BlcnRpZXM%DQoJPCEtLSA8cHJvcGVydHkgbmFtZT0iY29sb3JfbG9vcCIgY2hvb3NlX3R5cGU9Imxpc3QiIHZhbHVlX3R5cGU9InN0cmluZyIgdmFsdWVzPSJvbmUsdHdvLHRocmVlLGxvb3BfaGVyZV9ub29wIiBkZWZhdWx0PSJvbmUiIC8%DQoJPHByb3BlcnR5IG5hbWU9InJvdGF0aW9uIiB2YWx1ZV90eXBlPSJpbnQiIHJhbmdlPSItOTo5IiBkZWZhdWx0PSIwIiAvPg0KCTxwcm9wZXJ0eSBuYW1lPSJsb2dpYyIgY2hvb3NlX3R5cGU9Im5vbmUiIGRlZmF1bHQ9IjAiIC8%IC0tPg0KICAgIDxwcm9wZXJ0eSBuYW1lPSJwb3NpdGlvbiIgZGVmYXVsdD0iMTAiLz4NCjwvcHJvcGVydGllcz4NCjxtYXRlcmlhbHM%DQoJDQo8L21hdGVyaWFscz4NCjwvZGVmaW5pdGlvbnM%"
  50294. }];
  50295. F.JQuery = window.jQuery;
  50296. R.WIDTH = 480;
  50297. R.HEIGHT = 600;
  50298. R.FPS = 30;
  50299. T.currentLevel = 0;
  50300. T.NUMLEVELS = 25;
  50301. D.KEYNUM = 256;
  50302. D.UP = 38;
  50303. D.DOWN = 40;
  50304. D.LEFT = 37;
  50305. D.RIGHT = 39;
  50306. D.INSERT = 45;
  50307. D.DELETE = 46;
  50308. D.PAGE_UP = 33;
  50309. D.PAGE_DOWN = 34;
  50310. D.END = 35;
  50311. D.HOME = 36;
  50312. D.SPACE = 32;
  50313. D.D0 = 48;
  50314. D.D1 = 49;
  50315. D.D2 = 50;
  50316. D.D3 = 51;
  50317. D.D4 = 52;
  50318. D.D5 = 53;
  50319. D.D6 = 54;
  50320. D.D7 = 55;
  50321. D.D8 = 56;
  50322. D.D9 = 57;
  50323. D.mOffsetX = 0;
  50324. D.mOffsetY = 0;
  50325. E.Frames = [
  50326. [485, 237, 256, 256, 0, 0],
  50327. [795, 178, 190, 82, 150.7, 41],
  50328. [520, 918, 151, 63, 150.65, 41],
  50329. [629, 813, 106, 103, 54.5, 54.5],
  50330. [743, 327, 107, 103, 51.2, 48.7],
  50331. [743, 262, 212, 63, 196.7, 41],
  50332. [852,
  50333. 327, 107, 103, 51.2, 48.7
  50334. ],
  50335. [825, 638, 56, 55, 28.75, 27.7],
  50336. [737, 813, 144, 63, 150.7, 41],
  50337. [520, 813, 107, 103, 51.2, 48.7],
  50338. [2, 2, 481, 600, 0, 0],
  50339. [967, 2, 48, 60, 24, 30],
  50340. [743, 432, 242, 22, 121, 11],
  50341. [737, 878, 20, 20, 10, 10],
  50342. [975, 456, 22, 242, 11, 121],
  50343. [967, 126, 40, 40, 20, 20],
  50344. [673, 918, 84, 84, 41.5, 41.5],
  50345. [924, 896, 44, 44, 21.5, 21.5],
  50346. [759, 878, 84, 84, 41.5, 41.5],
  50347. [883, 823, 18, 53, 8.9, 43.4],
  50348. [883, 574, 90, 93, 45, 45],
  50349. [485, 2, 308, 233, 12.05, 6.05],
  50350. [967, 64, 48, 60, 24, 30],
  50351. [2, 876, 516, 78, 257.35, 38.6],
  50352. [391, 604, 149, 150, 72.85, 79.75],
  50353. [795, 2, 170, 174, 85, 86.5],
  50354. [845, 878, 77, 75,
  50355. 33.5, 32.5
  50356. ],
  50357. [883, 669, 77, 75, 33.5, 32.5],
  50358. [883, 746, 77, 75, 33.5, 32.5],
  50359. [485, 495, 482, 77, 241, 23.75],
  50360. [542, 702, 282, 61, 124.3, 34.35],
  50361. [2, 956, 483, 62, 225.85, 34.55],
  50362. [804, 964, 40, 40, 20, 20],
  50363. [2, 604, 387, 270, 191.05, 69],
  50364. [759, 964, 43, 38, 20.8, 18.55],
  50365. [924, 823, 81, 71, 39.5, 34.95],
  50366. [542, 574, 339, 62, 152.4, 34.8],
  50367. [542, 638, 281, 62, 123.55, 34.3],
  50368. [391, 756, 114, 110, 56.9, 54.15],
  50369. [520, 765, 304, 46, 140.35, 22.7]
  50370. ];
  50371. E.bmpBrick = {
  50372. name: "bmpBrick",
  50373. tilesheetId: -1,
  50374. frames: [0]
  50375. };
  50376. E.btnBack = {
  50377. name: "btnBack",
  50378. tilesheetId: -1,
  50379. frames: [1]
  50380. };
  50381. E.btnCredits = {
  50382. name: "btnCredits",
  50383. tilesheetId: -1,
  50384. frames: [2]
  50385. };
  50386. E.btnIconPlay = {
  50387. name: "btnIconPlay",
  50388. tilesheetId: -1,
  50389. frames: [3]
  50390. };
  50391. E.btnLevels = {
  50392. name: "btnLevels",
  50393. tilesheetId: -1,
  50394. frames: [4]
  50395. };
  50396. E.btnMoreGames = {
  50397. name: "btnMoreGames",
  50398. tilesheetId: -1,
  50399. frames: [5]
  50400. };
  50401. E.btnNext = {
  50402. name: "btnNext",
  50403. tilesheetId: -1,
  50404. frames: [6]
  50405. };
  50406. E.btnPause = {
  50407. name: "btnPause",
  50408. tilesheetId: -1,
  50409. frames: [7]
  50410. };
  50411. E.btnPlay = {
  50412. name: "btnPlay",
  50413. tilesheetId: -1,
  50414. frames: [8]
  50415. };
  50416. E.btnRestart = {
  50417. name: "btnRestart",
  50418. tilesheetId: -1,
  50419. frames: [9]
  50420. };
  50421. E.cmcBG = {
  50422. name: "cmcBG",
  50423. tilesheetId: -1,
  50424. frames: [10]
  50425. };
  50426. E.cmcBGGGG = {
  50427. name: "cmcBGGGG",
  50428. tilesheetId: -1,
  50429. frames: [11]
  50430. };
  50431. E.cmcBlock12x1 = {
  50432. name: "cmcBlock12x1",
  50433. tilesheetId: -1,
  50434. frames: [12]
  50435. };
  50436. E.cmcBlock1x1 = {
  50437. name: "cmcBlock1x1",
  50438. tilesheetId: -1,
  50439. frames: [13]
  50440. };
  50441. E.cmcBlock1x12 = {
  50442. name: "cmcBlock1x12",
  50443. tilesheetId: -1,
  50444. frames: [14]
  50445. };
  50446. E.cmcBlock2x2 = {
  50447. name: "cmcBlock2x2",
  50448. tilesheetId: -1,
  50449. frames: [15]
  50450. };
  50451. E.cmcBlock4x4 = {
  50452. name: "cmcBlock4x4",
  50453. tilesheetId: -1,
  50454. frames: [16]
  50455. };
  50456. E.cmcCircle2x2 = {
  50457. name: "cmcCircle2x2",
  50458. tilesheetId: -1,
  50459. frames: [17]
  50460. };
  50461. E.cmcCircle4x4 = {
  50462. name: "cmcCircle4x4",
  50463. tilesheetId: -1,
  50464. frames: [18]
  50465. };
  50466. E.cmcClockArrow = {
  50467. name: "cmcClockArrow",
  50468. tilesheetId: -1,
  50469. frames: [19]
  50470. };
  50471. E.cmcClockBG = {
  50472. name: "cmcClockBG",
  50473. tilesheetId: -1,
  50474. frames: [20]
  50475. };
  50476. E.cmcCreditsText = {
  50477. name: "cmcCreditsText",
  50478. tilesheetId: -1,
  50479. frames: [21]
  50480. };
  50481. E.cmcDialogBG = {
  50482. name: "cmcDialogBG",
  50483. tilesheetId: -1,
  50484. frames: [22]
  50485. };
  50486. E.cmcGGGBig = {
  50487. name: "cmcGGGBig",
  50488. tilesheetId: -1,
  50489. frames: [23]
  50490. };
  50491. E.cmcHooda = {
  50492. name: "cmcHooda",
  50493. tilesheetId: -1,
  50494. frames: [24]
  50495. };
  50496. E.cmcInstructions = {
  50497. name: "cmcInstructions",
  50498. tilesheetId: -1,
  50499. frames: [25]
  50500. };
  50501. E.cmcLevelSelectButton = {
  50502. name: "cmcLevelSelectButton",
  50503. tilesheetId: -1,
  50504. frames: [26, 27, 28]
  50505. };
  50506. E.cmcNext = {
  50507. name: "cmcNext",
  50508. tilesheetId: -1,
  50509. frames: [29]
  50510. };
  50511. E.cmcPausedText = {
  50512. name: "cmcPausedText",
  50513. tilesheetId: -1,
  50514. frames: [30]
  50515. };
  50516. E.cmcSelectALevel = {
  50517. name: "cmcSelectALevel",
  50518. tilesheetId: -1,
  50519. frames: [31]
  50520. };
  50521. E.cmcStaticBlock2x2 = {
  50522. name: "cmcStaticBlock2x2",
  50523. tilesheetId: -1,
  50524. frames: [32]
  50525. };
  50526. E.cmcSuperHoodaTitle = {
  50527. name: "cmcSuperHoodaTitle",
  50528. tilesheetId: -1,
  50529. frames: [33]
  50530. };
  50531. E.cmcTriangle2x2 = {
  50532. name: "cmcTriangle2x2",
  50533. tilesheetId: -1,
  50534. frames: [34]
  50535. };
  50536. E.cmcTriangle4x4 = {
  50537. name: "cmcTriangle4x4",
  50538. tilesheetId: -1,
  50539. frames: [35]
  50540. };
  50541. E.cmcYouLoseText = {
  50542. name: "cmcYouLoseText",
  50543. tilesheetId: -1,
  50544. frames: [36]
  50545. };
  50546. E.cmcYouWinText = {
  50547. name: "cmcYouWinText",
  50548. tilesheetId: -1,
  50549. frames: [37]
  50550. };
  50551. E.hoodaGameObject = {
  50552. name: "hoodaGameObject",
  50553. tilesheetId: -1,
  50554. frames: [38]
  50555. };
  50556. E.sponsorGGG = {
  50557. name: "sponsorGGG",
  50558. tilesheetId: -1,
  50559. frames: [39]
  50560. };
  50561. E.BitmapName = "Objects.png";
  50562. k.Lib.qTimeStamp = Date.now() + 0;
  50563. k.Lib.mouseX = 0;
  50564. k.Lib.mouseY = 0;
  50565. k.geom.Transform.DEG_TO_RAD = Math.PI / 180;
  50566. y.Serializer.USE_CACHE = !1;
  50567. y.Serializer.USE_ENUM_INDEX = !1;
  50568. y.Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
  50569. y.Unserializer.DEFAULT_RESOLVER =
  50570. Y;
  50571. y.Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
  50572. y.ds.ObjectMap.count = 0;
  50573. y.xml.Parser.escapes = function (a) {
  50574. a = new y.ds.StringMap;
  50575. a.set("lt", "<");
  50576. a.set("gt", ">");
  50577. a.set("amp", "&");
  50578. a.set("quot", '"');
  50579. a.set("apos", "'");
  50580. a.set("nbsp", String.fromCharCode(160));
  50581. return a
  50582. }(this);
  50583. F.Browser.window = "undefined" != typeof window ? window : null;
  50584. F.Browser.document = "undefined" != typeof window ? window.document : null;
  50585. h.Config.epsilon = 1E-8;
  50586. h.Config.fluidAngularDragFriction = 2.5;
  50587. h.Config.fluidAngularDrag =
  50588. 100;
  50589. h.Config.fluidVacuumDrag = 0.5;
  50590. h.Config.fluidLinearDrag = 0.5;
  50591. h.Config.collisionSlop = 0.2;
  50592. h.Config.collisionSlopCCD = 0.5;
  50593. h.Config.distanceThresholdCCD = 0.05;
  50594. h.Config.staticCCDLinearThreshold = 0.05;
  50595. h.Config.staticCCDAngularThreshold = 0.005;
  50596. h.Config.bulletCCDLinearThreshold = 0.125;
  50597. h.Config.bulletCCDAngularThreshold = 0.0125;
  50598. h.Config.dynamicSweepLinearThreshold = 17;
  50599. h.Config.dynamicSweepAngularThreshold = 0.6;
  50600. h.Config.angularCCDSlipScale = 0.75;
  50601. h.Config.arbiterExpirationDelay = 6;
  50602. h.Config.staticFrictionThreshold = 2;
  50603. h.Config.elasticThreshold = 20;
  50604. h.Config.sleepDelay = 60;
  50605. h.Config.linearSleepThreshold = 0.2;
  50606. h.Config.angularSleepThreshold = 0.4;
  50607. h.Config.contactBiasCoef = 0.3;
  50608. h.Config.contactStaticBiasCoef = 0.6;
  50609. h.Config.contactContinuousBiasCoef = 0.4;
  50610. h.Config.contactContinuousStaticBiasCoef = 0.5;
  50611. h.Config.constraintLinearSlop = 0.1;
  50612. h.Config.constraintAngularSlop = 0.001;
  50613. h.Config.illConditionedThreshold = 2E8;
  50614. X.className = new y.ds.StringMap;
  50615. X.library = new y.ds.StringMap;
  50616. X.path = new y.ds.StringMap;
  50617. X.type = new y.ds.StringMap;
  50618. X.initialized = !1;
  50619. J.Assets.cachedBitmapData = new y.ds.StringMap;
  50620. J.Assets.initialized = !1;
  50621. q.OzEvent.CLICK = 1;
  50622. q.OzEvent.DOWN = 2;
  50623. q.OzEvent.OVER = 3;
  50624. q.OzEvent.OUT = 4;
  50625. q.OzGeometry.MAX_OBJECTS = 1E4;
  50626. q.OzGeometry.RECTANGLE = 1;
  50627. q.OzGeometry.CIRCLE = 2;
  50628. q.OzGeometry.POLYGON = 3;
  50629. q.OzGeometry.LINE = 4;
  50630. q.OzGeometry.DOT = 5;
  50631. q.OzGeometry.TRIANGLE = 6;
  50632. q.OzGeometry.oo = 2E6;
  50633. q.OzGeometry._d = ":";
  50634. q.OzGeometry.temp2 = [];
  50635. q.OzMatrix.MAX_MATRICES = 1E3;
  50636. q.OzUtil.EPS = 1E-6;
  50637. M.StatePlay.NORMAL = 0;
  50638. M.StatePlay.WAITING = 1;
  50639. M.StatePlay.WIN = 2;
  50640. M.StatePlay.LOSE = 3;
  50641. c.ZPP_Const.FMAX =
  50642. 1E100;
  50643. c.ZPP_ID._Constraint = 0;
  50644. c.ZPP_ID._Interactor = 0;
  50645. c.ZPP_ID._CbType = 0;
  50646. c.ZPP_ID._CbSet = 0;
  50647. c.ZPP_ID._Listener = 0;
  50648. c.ZPP_ID._ZPP_SimpleVert = 0;
  50649. c.ZPP_ID._ZPP_SimpleSeg = 0;
  50650. c.ZPP_ID._Space = 0;
  50651. c.ZPP_ID._InteractionGroup = 0;
  50652. c.callbacks.ZPP_Callback.internal = !1;
  50653. c.callbacks.ZPP_CbType.ANY_SHAPE = new h.callbacks.CbType;
  50654. c.callbacks.ZPP_CbType.ANY_BODY = new h.callbacks.CbType;
  50655. c.callbacks.ZPP_CbType.ANY_COMPOUND = new h.callbacks.CbType;
  50656. c.callbacks.ZPP_CbType.ANY_CONSTRAINT = new h.callbacks.CbType;
  50657. c.util.ZPP_Flags.internal = !1;
  50658. c.util.ZPP_Flags.id_ImmState_ACCEPT = 1;
  50659. c.util.ZPP_Flags.id_ImmState_IGNORE = 2;
  50660. c.util.ZPP_Flags.id_ImmState_ALWAYS = 4;
  50661. c.util.ZPP_Flags.id_GravMassMode_DEFAULT = 0;
  50662. c.util.ZPP_Flags.id_GravMassMode_FIXED = 1;
  50663. c.util.ZPP_Flags.id_GravMassMode_SCALED = 2;
  50664. c.util.ZPP_Flags.id_InertiaMode_DEFAULT = 0;
  50665. c.util.ZPP_Flags.id_InertiaMode_FIXED = 1;
  50666. c.util.ZPP_Flags.id_MassMode_DEFAULT = 0;
  50667. c.util.ZPP_Flags.id_MassMode_FIXED = 1;
  50668. c.util.ZPP_Flags.id_BodyType_STATIC = 1;
  50669. c.util.ZPP_Flags.id_BodyType_DYNAMIC = 2;
  50670. c.util.ZPP_Flags.id_BodyType_KINEMATIC =
  50671. 3;
  50672. c.util.ZPP_Flags.id_ListenerType_BODY = 0;
  50673. c.util.ZPP_Flags.id_PreFlag_ACCEPT = 1;
  50674. c.util.ZPP_Flags.id_ListenerType_CONSTRAINT = 1;
  50675. c.util.ZPP_Flags.id_PreFlag_IGNORE = 2;
  50676. c.util.ZPP_Flags.id_ListenerType_INTERACTION = 2;
  50677. c.util.ZPP_Flags.id_PreFlag_ACCEPT_ONCE = 3;
  50678. c.util.ZPP_Flags.id_ListenerType_PRE = 3;
  50679. c.util.ZPP_Flags.id_PreFlag_IGNORE_ONCE = 4;
  50680. c.util.ZPP_Flags.id_InteractionType_COLLISION = 1;
  50681. c.util.ZPP_Flags.id_CbEvent_BEGIN = 0;
  50682. c.util.ZPP_Flags.id_InteractionType_SENSOR = 2;
  50683. c.util.ZPP_Flags.id_CbEvent_ONGOING = 6;
  50684. c.util.ZPP_Flags.id_InteractionType_FLUID =
  50685. 4;
  50686. c.util.ZPP_Flags.id_CbEvent_END = 1;
  50687. c.util.ZPP_Flags.id_InteractionType_ANY = 7;
  50688. c.util.ZPP_Flags.id_CbEvent_WAKE = 2;
  50689. c.util.ZPP_Flags.id_CbEvent_SLEEP = 3;
  50690. c.util.ZPP_Flags.id_CbEvent_BREAK = 4;
  50691. c.util.ZPP_Flags.id_CbEvent_PRE = 5;
  50692. c.util.ZPP_Flags.id_Winding_UNDEFINED = 0;
  50693. c.util.ZPP_Flags.id_Winding_CLOCKWISE = 1;
  50694. c.util.ZPP_Flags.id_Winding_ANTICLOCKWISE = 2;
  50695. c.util.ZPP_Flags.id_ValidationResult_VALID = 0;
  50696. c.util.ZPP_Flags.id_ValidationResult_DEGENERATE = 1;
  50697. c.util.ZPP_Flags.id_ValidationResult_CONCAVE = 2;
  50698. c.util.ZPP_Flags.id_ValidationResult_SELF_INTERSECTING =
  50699. 3;
  50700. c.util.ZPP_Flags.id_ShapeType_CIRCLE = 0;
  50701. c.util.ZPP_Flags.id_ShapeType_POLYGON = 1;
  50702. c.util.ZPP_Flags.id_Broadphase_DYNAMIC_AABB_TREE = 0;
  50703. c.util.ZPP_Flags.id_Broadphase_SWEEP_AND_PRUNE = 1;
  50704. c.util.ZPP_Flags.id_ArbiterType_COLLISION = 1;
  50705. c.util.ZPP_Flags.id_ArbiterType_SENSOR = 2;
  50706. c.util.ZPP_Flags.id_ArbiterType_FLUID = 4;
  50707. c.callbacks.ZPP_Listener.internal = !1;
  50708. ca = c.callbacks.ZPP_Listener;
  50709. null == c.util.ZPP_Flags.ListenerType_BODY && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_BODY = new h.callbacks.ListenerType,
  50710. c.util.ZPP_Flags.internal = !1);
  50711. var ha = c.util.ZPP_Flags.ListenerType_BODY,
  50712. ia;
  50713. null == c.util.ZPP_Flags.ListenerType_CONSTRAINT && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_CONSTRAINT = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1);
  50714. ia = c.util.ZPP_Flags.ListenerType_CONSTRAINT;
  50715. null == c.util.ZPP_Flags.ListenerType_INTERACTION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_INTERACTION = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1);
  50716. var oa = c.util.ZPP_Flags.ListenerType_INTERACTION;
  50717. null == c.util.ZPP_Flags.ListenerType_PRE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ListenerType_PRE = new h.callbacks.ListenerType, c.util.ZPP_Flags.internal = !1);
  50718. ca.types = [ha, ia, oa, c.util.ZPP_Flags.ListenerType_PRE];
  50719. ca = c.callbacks.ZPP_Listener;
  50720. null == c.util.ZPP_Flags.CbEvent_BEGIN && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BEGIN = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  50721. ha = c.util.ZPP_Flags.CbEvent_BEGIN;
  50722. null == c.util.ZPP_Flags.CbEvent_END && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_END =
  50723. new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  50724. ia = c.util.ZPP_Flags.CbEvent_END;
  50725. null == c.util.ZPP_Flags.CbEvent_WAKE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_WAKE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  50726. var oa = c.util.ZPP_Flags.CbEvent_WAKE,
  50727. ua;
  50728. null == c.util.ZPP_Flags.CbEvent_SLEEP && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_SLEEP = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  50729. ua = c.util.ZPP_Flags.CbEvent_SLEEP;
  50730. null == c.util.ZPP_Flags.CbEvent_BREAK &&
  50731. (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_BREAK = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  50732. var Aa = c.util.ZPP_Flags.CbEvent_BREAK;
  50733. null == c.util.ZPP_Flags.CbEvent_PRE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_PRE = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  50734. var Ba = c.util.ZPP_Flags.CbEvent_PRE;
  50735. null == c.util.ZPP_Flags.CbEvent_ONGOING && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.CbEvent_ONGOING = new h.callbacks.CbEvent, c.util.ZPP_Flags.internal = !1);
  50736. ca.events = [ha, ia, oa, ua, Aa, Ba, c.util.ZPP_Flags.CbEvent_ONGOING];
  50737. c.callbacks.ZPP_InteractionListener.UCbSet = new c.util.ZNPList_ZPP_CbSet;
  50738. c.callbacks.ZPP_InteractionListener.VCbSet = new c.util.ZNPList_ZPP_CbSet;
  50739. c.callbacks.ZPP_InteractionListener.WCbSet = new c.util.ZNPList_ZPP_CbSet;
  50740. c.callbacks.ZPP_InteractionListener.UCbType = new c.util.ZNPList_ZPP_CbType;
  50741. c.callbacks.ZPP_InteractionListener.VCbType = new c.util.ZNPList_ZPP_CbType;
  50742. c.callbacks.ZPP_InteractionListener.WCbType = new c.util.ZNPList_ZPP_CbType;
  50743. c.constraint.ZPP_AngleDraw.maxarc =
  50744. Math.PI / 4;
  50745. c.dynamics.ZPP_Arbiter.internal = !1;
  50746. c.dynamics.ZPP_Arbiter.COL = 1;
  50747. c.dynamics.ZPP_Arbiter.FLUID = 4;
  50748. c.dynamics.ZPP_Arbiter.SENSOR = 2;
  50749. ca = c.dynamics.ZPP_Arbiter;
  50750. null == c.util.ZPP_Flags.ArbiterType_COLLISION && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_COLLISION = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1);
  50751. ha = c.util.ZPP_Flags.ArbiterType_COLLISION;
  50752. null == c.util.ZPP_Flags.ArbiterType_FLUID && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_FLUID = new h.dynamics.ArbiterType,
  50753. c.util.ZPP_Flags.internal = !1);
  50754. ia = c.util.ZPP_Flags.ArbiterType_FLUID;
  50755. null == c.util.ZPP_Flags.ArbiterType_SENSOR && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ArbiterType_SENSOR = new h.dynamics.ArbiterType, c.util.ZPP_Flags.internal = !1);
  50756. ca.types = [ha, ia, c.util.ZPP_Flags.ArbiterType_SENSOR];
  50757. c.dynamics.ZPP_ColArbiter.FACE1 = 0;
  50758. c.dynamics.ZPP_ColArbiter.FACE2 = 1;
  50759. c.dynamics.ZPP_ColArbiter.CIRCLE = 2;
  50760. c.dynamics.ZPP_Contact.internal = !1;
  50761. c.dynamics.ZPP_InteractionGroup.SHAPE = 1;
  50762. c.dynamics.ZPP_InteractionGroup.BODY =
  50763. 2;
  50764. c.geom.ZPP_Collide.flowpoly = new c.util.ZNPList_ZPP_Vec2;
  50765. c.geom.ZPP_Collide.flowsegs = new c.util.ZNPList_ZPP_Vec2;
  50766. c.geom.ZPP_ConvexRayResult.internal = !1;
  50767. c.geom.ZPP_GeomVertexIterator.internal = !1;
  50768. c.geom.ZPP_MarchingSquares.me = new c.geom.ZPP_MarchingSquares;
  50769. c.geom.ZPP_MarchingSquares.look_march = [-1, 224, 56, 216, 14, -1, 54, 214, 131, 99, -1, 91, 141, 109, 181, 85];
  50770. c.geom.ZPP_PartitionVertex.nextId = 0;
  50771. c.geom.ZPP_Ray.internal = !1;
  50772. ca = c.phys.ZPP_Body;
  50773. null == c.util.ZPP_Flags.BodyType_STATIC && (c.util.ZPP_Flags.internal = !0,
  50774. c.util.ZPP_Flags.BodyType_STATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  50775. ha = c.util.ZPP_Flags.BodyType_STATIC;
  50776. null == c.util.ZPP_Flags.BodyType_DYNAMIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_DYNAMIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  50777. ia = c.util.ZPP_Flags.BodyType_DYNAMIC;
  50778. null == c.util.ZPP_Flags.BodyType_KINEMATIC && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.BodyType_KINEMATIC = new h.phys.BodyType, c.util.ZPP_Flags.internal = !1);
  50779. ca.types = [null, ha, ia, c.util.ZPP_Flags.BodyType_KINEMATIC];
  50780. c.phys.ZPP_Body.cur_graph_depth = 0;
  50781. c.phys.ZPP_Material.WAKE = 1;
  50782. c.phys.ZPP_Material.PROPS = 2;
  50783. c.phys.ZPP_Material.ANGDRAG = 4;
  50784. c.phys.ZPP_Material.ARBITERS = 8;
  50785. ca = c.shape.ZPP_Shape;
  50786. null == c.util.ZPP_Flags.ShapeType_CIRCLE && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ShapeType_CIRCLE = new h.shape.ShapeType, c.util.ZPP_Flags.internal = !1);
  50787. ha = c.util.ZPP_Flags.ShapeType_CIRCLE;
  50788. null == c.util.ZPP_Flags.ShapeType_POLYGON && (c.util.ZPP_Flags.internal = !0, c.util.ZPP_Flags.ShapeType_POLYGON = new h.shape.ShapeType, c.util.ZPP_Flags.internal = !1);
  50789. ca.types = [ha, c.util.ZPP_Flags.ShapeType_POLYGON];
  50790. c.shape.ZPP_Edge.internal = !1;
  50791. c.space.ZPP_AABBTree.tmpaabb = new c.geom.ZPP_AABB;
  50792. c.space.ZPP_DynAABBPhase.FATTEN = 3;
  50793. c.space.ZPP_DynAABBPhase.VEL_STEPS = 2;
  50794. c.util.ZPP_Debug.internal = !1;
  50795. c.util.ZPP_ConstraintList.internal = !1;
  50796. c.util.ZPP_BodyList.internal = !1;
  50797. c.util.ZPP_InteractorList.internal = !1;
  50798. c.util.ZPP_CompoundList.internal = !1;
  50799. c.util.ZPP_ListenerList.internal = !1;
  50800. c.util.ZPP_CbTypeList.internal = !1;
  50801. c.util.ZPP_Vec2List.internal = !1;
  50802. c.util.ZPP_GeomPolyList.internal = !1;
  50803. c.util.ZPP_RayResultList.internal = !1;
  50804. c.util.ZPP_ConvexResultList.internal = !1;
  50805. c.util.ZPP_EdgeList.internal = !1;
  50806. c.util.ZPP_ShapeList.internal = !1;
  50807. c.util.ZPP_InteractionGroupList.internal = !1;
  50808. c.util.ZPP_ArbiterList.internal = !1;
  50809. c.util.ZPP_ContactList.internal = !1;
  50810. P.main()
  50811. })();