123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814 |
- (function () {
- function I(a, b) {
- function d() {}
- d.prototype = a;
- var c = new d,
- e;
- for (e in b) c[e] = b[e];
- b.toString !== Object.prototype.toString && (c.toString = b.toString);
- return c
- }
- function A(a, b) {
- if (null == b) return null;
- null == b.__id__ && (b.__id__ = va++);
- var d;
- null == a.hx__closures__ ? a.hx__closures__ = {} : d = a.hx__closures__[b.__id__];
- null == d && (d = function () {
- return d.method.apply(d.scope, arguments)
- }, d.scope = a, d.method = b, a.hx__closures__[b.__id__] = d);
- return d
- }
- var s = {},
- N = function () {
- return F.Boot.__string_rec(this, "")
- },
- P = function () {};
- s.ApplicationMain = P;
- P.__name__ = ["ApplicationMain"];
- P.main = function () {
- P.completed = 0;
- P.loaders = new y.ds.StringMap;
- P.urlLoaders = new y.ds.StringMap;
- P.total = 0;
- k.Lib.get_current().loaderInfo = k.display.LoaderInfo.create(null);
- k.Lib.get_stage().frameRate = 45;
- k.Lib.get_current().addChild(P.preloader = new ja);
- P.preloader.onInit();
- P.loadFile("assets/ggg.png");
- P.loadFile("assets/FontCourier.png");
- P.loadFile("assets/FontGame.png");
- P.loadFile("assets/Objects.png");
- for (var a = 0, b = y.Resource.listNames(); a < b.length;) {
- var d =
- b[a];
- ++a;
- $.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])))
- }
- if (0 != P.total) {
- P.loaderStack = [];
- for (b = P.loaders.keys(); b.hasNext();) a = b.next(), P.loaderStack.push(a);
- P.urlLoaderStack = [];
- for (b = P.urlLoaders.keys(); b.hasNext();) a = b.next(), P.urlLoaderStack.push(a);
- for (a = 0; 8 > a;) a++, P.nextLoader()
- } else P.begin()
- };
- P.nextLoader = function () {
- if (0 != P.loaderStack.length) {
- var a = P.loaderStack.shift(),
- b = P.loaders.get(a);
- b.contentLoaderInfo.addEventListener("complete", P.loader_onComplete);
- b.load(new k.net.URLRequest(a))
- } 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)))
- };
- P.loadFile = function (a) {
- P.loaders.set(a, new k.display.Loader);
- P.total++
- };
- P.loadBinary = function (a) {
- var b = new k.net.URLLoader;
- b.set_dataFormat(k.net.URLLoaderDataFormat.BINARY);
- P.urlLoaders.set(a, b);
- P.total++
- };
- P.loadSound =
- function (a) {};
- P.begin = function () {
- P.preloader.addEventListener("complete", P.preloader_onComplete);
- P.preloader.onLoaded()
- };
- P.bitmapClass_onComplete = function (a) {
- P.completed++;
- Y.getClass(a).preload = a;
- P.completed == P.total && P.begin()
- };
- P.loader_onComplete = function (a) {
- P.completed++;
- P.preloader.onUpdate(P.completed, P.total);
- P.completed == P.total ? P.begin() : P.nextLoader()
- };
- P.preloader_onComplete = function (a) {
- P.preloader.removeEventListener("complete", P.preloader_onComplete);
- k.Lib.get_current().removeChild(P.preloader);
- P.preloader = null;
- 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, [])
- };
- var k = {
- events: {}
- };
- k.events.IEventDispatcher = function () {};
- s["flash.events.IEventDispatcher"] = k.events.IEventDispatcher;
- k.events.IEventDispatcher.__name__ = ["flash", "events", "IEventDispatcher"];
- k.events.IEventDispatcher.prototype = {
- __class__: k.events.IEventDispatcher
- };
- k.events.EventDispatcher = function () {
- this.eventList = new y.ds.StringMap
- };
- s["flash.events.EventDispatcher"] = k.events.EventDispatcher;
- k.events.EventDispatcher.__name__ = ["flash", "events", "EventDispatcher"];
- k.events.EventDispatcher.__interfaces__ = [k.events.IEventDispatcher];
- k.events.EventDispatcher.prototype = {
- dispatchEvent: function (a) {
- null == a.get_target() && a.set_target(this);
- var b = a.type;
- if (this.eventList.exists(b))
- for (var d = 0, b = this.eventList.get(b); d < b.length;) {
- var c = b[d];
- ++d;
- c(a)
- }
- return !0
- },
- hasEventListener: function (a) {
- return this.eventList.exists(a)
- },
- removeEventListener: function (a,
- b, d, c, e) {
- if (this.eventList.exists(a)) {
- d = this.eventList.get(a);
- for (c = 0; c < d.length;)
- if (e = d[c], ++c, W.compareMethods(e, b)) {
- S.remove(d, e);
- break
- }
- 0 == d.length && this.eventList.remove(a)
- }
- },
- addEventListener: function (a, b, d, c, e) {
- var f;
- this.eventList.exists(a) ? f = this.eventList.get(a) : this.eventList.set(a, f = []);
- f.push(b)
- },
- __class__: k.events.EventDispatcher
- };
- k.events.EventWrapper = function () {
- k.events.EventDispatcher.call(this);
- this.eventMap = new y.ds.ObjectMap
- };
- s["flash.events.EventWrapper"] = k.events.EventWrapper;
- k.events.EventWrapper.__name__ = ["flash", "events", "EventWrapper"];
- k.events.EventWrapper.__super__ = k.events.EventDispatcher;
- k.events.EventWrapper.prototype = I(k.events.EventDispatcher.prototype, {
- removeEventListener: function (a, b, d, c, e) {
- null == e && (e = !1);
- null == c && (c = 0);
- null == d && (d = !1);
- k.events.EventDispatcher.prototype.removeEventListener.call(this, a, b, d, c, e);
- this.eventMap.h.hasOwnProperty(b.__id__) && (this.component.removeEventListener(a, this.eventMap.h[b.__id__], d), this.eventMap.remove(b))
- },
- addEventListener: function (a,
- b, d, c, e) {
- null == e && (e = !1);
- null == c && (c = 0);
- null == d && (d = !1);
- var f = this;
- k.events.EventDispatcher.prototype.addEventListener.call(this, a, b, d, c, e);
- c = function (a) {
- return function (a) {
- a.get_target() == f.component && a.set_target(f);
- a.set_currentTarget(f);
- b(a)
- }
- }(this);
- this.eventMap.h.hasOwnProperty(b.__id__) || this.eventMap.set(b, c);
- this.component.addEventListener(a, c, d)
- },
- __class__: k.events.EventWrapper
- });
- k.display = {};
- k.display.DisplayObject = function () {
- this.rotation = this.x = this.y = 0;
- this.alpha = this.scaleX = this.scaleY =
- 1;
- this.visible = !0;
- k.events.EventWrapper.call(this);
- this.eventRemap = new y.ds.StringMap;
- null == this.component && (this.component = k.Lib.jsDiv());
- this.component.node = this;
- this.transform = new k.geom.Transform(this)
- };
- s["flash.display.DisplayObject"] = k.display.DisplayObject;
- k.display.DisplayObject.__name__ = ["flash", "display", "DisplayObject"];
- k.display.DisplayObject.__super__ = k.events.EventWrapper;
- k.display.DisplayObject.prototype = I(k.events.EventWrapper.prototype, {
- toString: function () {
- return Y.getClassName(Y.getClass(this))
- },
- addEventListener: function (a, b, d, c, e) {
- null == e && (e = !1);
- null == c && (c = 0);
- null == d && (d = !1);
- var f = this;
- k.events.EventWrapper.prototype.addEventListener.call(this, a, b, d, c, e);
- k.display.DisplayObject.remapTouch.exists(a) && k.events.EventWrapper.prototype.addEventListener.call(this, k.display.DisplayObject.remapTouch.get(a), function (b) {
- var d = new k.events.MouseEvent(a, b.bubbles, b.cancelable, 0, 0, f, b.ctrlKey, b.altKey, b.shiftKey, !1);
- b = b.targetTouches;
- 0 < b.length ? (d.pageX = b[0].pageX, d.pageY = b[0].pageY) : (d.pageX = f.get_stage().mousePos.x,
- d.pageY = f.get_stage().mousePos.y);
- f.dispatchEvent(d)
- }, d, c, e)
- },
- get_mouseY: function () {
- return (k.display.DisplayObject.convPoint = this.globalToLocal(k.Lib.get_current().get_stage().mousePos, k.display.DisplayObject.convPoint)).y
- },
- get_mouseX: function () {
- return (k.display.DisplayObject.convPoint = this.globalToLocal(k.Lib.get_current().get_stage().mousePos, k.display.DisplayObject.convPoint)).x
- },
- localToGlobal: function (a, b) {
- null == b && (b = new k.geom.Point);
- var d = k.display.DisplayObject.convMatrix,
- c = a.x,
- e = a.y;
- null ==
- d && (d = k.display.DisplayObject.convMatrix = new k.geom.Matrix);
- d.identity();
- d = this.getGlobalMatrix(d);
- b.x = c * d.a + e * d.c + d.tx;
- b.y = c * d.b + e * d.d + d.ty;
- return b
- },
- globalToLocal: function (a, b) {
- null == b && (b = new k.geom.Point);
- var d = k.display.DisplayObject.convMatrix,
- c = a.x,
- e = a.y;
- null == d && (d = k.display.DisplayObject.convMatrix = new k.geom.Matrix);
- d.identity();
- d = this.getGlobalMatrix(d);
- d.invert();
- b.x = c * d.a + e * d.c + d.tx;
- b.y = c * d.b + e * d.d + d.ty;
- return b
- },
- getGlobalMatrix: function (a) {
- null == a && (a = new k.geom.Matrix);
- for (var b = this; null !=
- 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;
- return a
- },
- getBounds: function (a) {
- return null
- },
- set_stage: function (a) {
- if (this._stage != a) {
- var b = null != this._stage != (null != a);
- this._stage = a;
- b && this.dispatchEvent(new k.events.Event(null != a ? "addedToStage" : "removedFromStage"))
- }
- return a
- },
- get_stage: function () {
- return this._stage
- },
- set_scrollRect: function (a) {
- return a
- },
- set_visible: function (a) {
- this.component.style.display = (this.visible = a) ? null : "none";
- return a
- },
- set_alpha: function (a) {
- a != this.alpha && (this.component.style.opacity = (this.alpha = a).toFixed(4));
- return a
- },
- set_height: function (a) {
- return a
- },
- set_width: function (a) {
- return a
- },
- get_height: function () {
- return this.qHeight || 0
- },
- get_width: function () {
- return this.qWidth || 0
- },
- set_scaleY: function (a) {
- this.scaleY != a && (this.scaleY = a, this.syncMtx());
- return a
- },
- set_scaleX: function (a) {
- this.scaleX != a && (this.scaleX = a, this.syncMtx());
- return a
- },
- set_rotation: function (a) {
- this.rotation != a && (this.rotation = a, this.syncMtx());
- return a
- },
- set_y: function (a) {
- this.y != a && (this.y = a, this.syncMtx());
- return a
- },
- set_x: function (a) {
- this.x != a && (this.x = a, this.syncMtx());
- return a
- },
- syncMtx: function () {
- var a = this.component.style,
- b, d;
- !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));
- b = "";
- if (0 != this.x || 0 != this.y) b += "translate(" + this.x + "px, " + this.y + "px) ";
- if (1 != this.scaleX || 1 != this.scaleY) b += "scale(" + this.scaleX + ", " + this.scaleY + ") ";
- 0 != this.rotation && (b += "rotate(" + this.rotation + "deg) ");
- 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 + ") "));
- d = "transform";
- 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)
- },
- invalidate: function () {},
- broadcastEvent: function (a) {
- this.dispatchEvent(a)
- },
- __class__: k.display.DisplayObject
- });
- k.display.InteractiveObject = function () {
- k.display.DisplayObject.call(this);
- this.tabEnabled = !1;
- this.tabIndex = 0;
- this.mouseEnabled = this.doubleClickEnabled = !0
- };
- s["flash.display.InteractiveObject"] = k.display.InteractiveObject;
- k.display.InteractiveObject.__name__ = ["flash", "display", "InteractiveObject"];
- k.display.InteractiveObject.__super__ = k.display.DisplayObject;
- k.display.InteractiveObject.prototype =
- I(k.display.DisplayObject.prototype, {
- __class__: k.display.InteractiveObject
- });
- k.display.DisplayObjectContainer = function () {
- k.display.InteractiveObject.call(this);
- this.children = []
- };
- s["flash.display.DisplayObjectContainer"] = k.display.DisplayObjectContainer;
- k.display.DisplayObjectContainer.__name__ = ["flash", "display", "DisplayObjectContainer"];
- k.display.DisplayObjectContainer.__super__ = k.display.InteractiveObject;
- k.display.DisplayObjectContainer.prototype = I(k.display.InteractiveObject.prototype, {
- set_stage: function (a) {
- k.display.InteractiveObject.prototype.set_stage.call(this,
- a);
- for (var b = 0, d = this.children; b < d.length;) {
- var c = d[b];
- ++b;
- c.set_stage(a)
- }
- return a
- },
- broadcastEvent: function (a) {
- this.dispatchEvent(a);
- for (var b = 0, d = this.children; b < d.length;) {
- var c = d[b];
- ++b;
- c.broadcastEvent(a)
- }
- },
- contains: function (a) {
- for (var b = 0, d = this.children; b < d.length;) {
- var c = d[b];
- ++b;
- if (c == a) return !0
- }
- return !1
- },
- getChildIndex: function (a) {
- for (var b = -1, d = this.children.length; ++b < d;)
- if (this.children[b] == a) return b;
- return -1
- },
- getChildAt: function (a) {
- return this.children[a]
- },
- removeChildAt: function (a) {
- return this.removeChild(this.children[a])
- },
- addChildAt: function (a, b) {
- 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)
- },
- removeChild: function (a) {
- a.parent = null;
- a.set_stage(null);
- S.remove(this.children, a);
- this.component.removeChild(a.component);
- var b = new k.events.Event("removed");
- a.dispatchEvent(b);
- this.dispatchEvent(b);
- return a
- },
- addChild: function (a) {
- null != a.parent &&
- a.parent.removeChild(a);
- a.parent = this;
- a.set_stage(this.get_stage());
- this.children.push(a);
- this.component.appendChild(a.component);
- var b = new k.events.Event("added");
- a.dispatchEvent(b);
- this.dispatchEvent(b);
- return a
- },
- __class__: k.display.DisplayObjectContainer
- });
- k.display.IBitmapDrawable = function () {};
- s["flash.display.IBitmapDrawable"] = k.display.IBitmapDrawable;
- k.display.IBitmapDrawable.__name__ = ["flash", "display", "IBitmapDrawable"];
- k.display.IBitmapDrawable.prototype = {
- __class__: k.display.IBitmapDrawable
- };
- k.display.Sprite = function () {
- k.display.DisplayObjectContainer.call(this)
- };
- s["flash.display.Sprite"] = k.display.Sprite;
- k.display.Sprite.__name__ = ["flash", "display", "Sprite"];
- k.display.Sprite.__interfaces__ = [k.display.IBitmapDrawable];
- k.display.Sprite.__super__ = k.display.DisplayObjectContainer;
- k.display.Sprite.prototype = I(k.display.DisplayObjectContainer.prototype, {
- drawToSurface: function (a, b, d, c, e, f, l) {
- this.get_graphics().drawToSurface(a, b, d, c, e, f, l)
- },
- set_useHandCursor: function (a) {
- this.component.style.cursor =
- a ? "pointer" : null;
- return this.useHandCursor = a
- },
- set_stage: function (a) {
- var b = null == this.get_stage() && null != a;
- a = k.display.DisplayObjectContainer.prototype.set_stage.call(this, a);
- b && null != this._graphics && this._graphics.invalidate();
- return a
- },
- get_graphics: function () {
- if (null == this._graphics) {
- var a = new k.display.Graphics,
- b = a.component;
- a.set_displayObject(this);
- 0 == this.children.length ? this.component.appendChild(b) : this.component.insertBefore(b, this.children[0].component);
- this._graphics = a
- }
- return this._graphics
- },
- __class__: k.display.Sprite
- });
- var R = function () {
- this.oldFrames = 0;
- this.initted = !1;
- this.frameCount = 0;
- k.display.Sprite.call(this);
- this.ScreenBMD = new k.display.BitmapData(R.WIDTH, R.HEIGHT, !0, 0);
- this.ScreenBitmap = new k.display.Bitmap(this.ScreenBMD, k.display.PixelSnapping.AUTO, !0);
- this.addChild(this.ScreenBitmap);
- R.RESIZE_WIDTH = R.WIDTH;
- R.RESIZE_HEIGHT = R.HEIGHT;
- R.instance = this;
- T.Init();
- q.OzSprite.StaticInit();
- q.OzMatrix.InitPool();
- E.Register();
- G.Register();
- n.Register();
- q.OzUtil.SortIdsByName(q.OzSprite.BitmapsIds,
- q.OzSprite.BitmapsNames);
- k.Lib.get_current().get_stage().addEventListener("resize", A(this, this.onResize));
- k.Lib.get_current().get_stage().addEventListener("enterFrame", A(this, this.update));
- D.init(this);
- this.doc = new q.OzSprite;
- this.stateSprite = new q.OzSprite;
- this.debugSprite = new q.OzSprite;
- this.doc.addChild(this.stateSprite);
- this.doc.addChild(this.debugSprite);
- this.debugText = new q.OzSprite(null, q.SpriteType.TEXT);
- this.debugText.font = G.Font;
- this.debugText.text = "Hello, guys!";
- this.debugSprite.addChild(this.debugText);
- this.debugSprite.visible = !1;
- this.s = new M.StateGGG(this);
- (new y.Timer(1E3)).run = A(this, this.measureFPS)
- };
- s.Main = R;
- R.__name__ = ["Main"];
- R.__super__ = k.display.Sprite;
- R.prototype = I(k.display.Sprite.prototype, {
- measureFPS: function () {
- this.debugText.text = "" + (this.frameCount - this.oldFrames) + ":" + q.OzSprite.TilesheetBitmapDatas[E.cmcYouLoseText.tilesheetId][E.cmcYouLoseText.frames[0]].component.width;
- this.oldFrames = this.frameCount
- },
- draw: function (a) {
- q.OzSprite.TilesheetId = -1;
- this.doc.draw();
- q.OzSprite.Flush()
- },
- changeState: function (a) {
- null != this.s && this.s.destroy();
- this.s = a;
- this.s.update()
- },
- update: function (a) {
- this.frameCount++;
- a = 1 == this.frameCount;
- !a && Z.PlatformHTML5.invalidRect() && (a = !0);
- if (a) this.onResize();
- this.s.update();
- this.draw();
- },
- onResize: function (a) {
- Z.PlatformHTML5.resize()
- },
- __class__: R
- });
- var ka = function () {
- R.call(this)
- };
- s.DocumentClass = ka;
- ka.__name__ = ["DocumentClass"];
- ka.__super__ = R;
- ka.prototype = I(R.prototype, {
- get_stage: function () {
- return k.Lib.get_current().get_stage()
- },
- __class__: ka
- });
- var G = function () {};
- s.FontCourier = G;
- G.__name__ = ["FontCourier"];
- G.Register = function () {
- G.Font = new q.OzFont;
- G.Font.face = "Courier";
- G.Font.size = 12;
- G.Font.padding = [0, 0, 0, 0];
- G.Font.spacing = [2, 2];
- G.Font.lineHeight = 14;
- G.Font.base = 9;
- G.Font.numPages = 1;
- G.Font.bitmapName = "FontCourier.png";
- G.Font.numChars = 95;
- G.Font.chars[32] = {
- id: 32,
- x: 110,
- y: 70,
- width: 0,
- height: 0,
- xOffset: 0,
- yOffset: 11,
- xAdvance: 7,
- page: 0,
- letter: " ",
- movieClip: null
- };
- G.Font.chars[33] = {
- id: 33,
- x: 34,
- y: 40,
- width: 4,
- height: 9,
- xOffset: 3,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "!",
- movieClip: null
- };
- G.Font.chars[34] = {
- id: 34,
- x: 56,
- y: 70,
- width: 5,
- height: 4,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: '"',
- movieClip: null
- };
- G.Font.chars[35] = {
- id: 35,
- x: 76,
- y: 2,
- width: 9,
- height: 10,
- xOffset: 0,
- yOffset: 1,
- xAdvance: 7,
- page: 0,
- letter: "#",
- movieClip: null
- };
- G.Font.chars[36] = {
- id: 36,
- x: 14,
- y: 2,
- width: 6,
- height: 11,
- xOffset: 1,
- yOffset: 1,
- xAdvance: 7,
- page: 0,
- letter: "$",
- movieClip: null
- };
- G.Font.chars[37] = {
- id: 37,
- x: 2,
- y: 40,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "%",
- movieClip: null
- };
- G.Font.chars[38] = {
- id: 38,
- x: 106,
- y: 51,
- width: 6,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "&",
- movieClip: null
- };
- G.Font.chars[39] = {
- id: 39,
- x: 69,
- y: 70,
- width: 3,
- height: 4,
- xOffset: 3,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "'",
- movieClip: null
- };
- G.Font.chars[40] = {
- id: 40,
- x: 58,
- y: 2,
- width: 4,
- height: 11,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "(",
- movieClip: null
- };
- G.Font.chars[41] = {
- id: 41,
- x: 52,
- y: 2,
- width: 4,
- height: 11,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: ")",
- movieClip: null
- };
- G.Font.chars[42] = {
- id: 42,
- x: 25,
- y: 70,
- width: 6,
- height: 6,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "*",
- movieClip: null
- };
- G.Font.chars[43] = {
- id: 43,
- x: 62,
- y: 51,
- width: 8,
- height: 8,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "+",
- movieClip: null
- };
- G.Font.chars[44] = {
- id: 44,
- x: 33,
- y: 70,
- width: 4,
- height: 5,
- xOffset: 2,
- yOffset: 8,
- xAdvance: 7,
- page: 0,
- letter: ",",
- movieClip: null
- };
- G.Font.chars[45] = {
- id: 45,
- x: 83,
- y: 70,
- width: 7,
- height: 3,
- xOffset: 1,
- yOffset: 6,
- xAdvance: 7,
- page: 0,
- letter: "-",
- movieClip: null
- };
- G.Font.chars[46] = {
- id: 46,
- x: 63,
- y: 70,
- width: 4,
- height: 4,
- xOffset: 2,
- yOffset: 7,
- xAdvance: 7,
- page: 0,
- letter: ".",
- movieClip: null
- };
- G.Font.chars[47] = {
- id: 47,
- x: 22,
- y: 2,
- width: 6,
- height: 11,
- xOffset: 1,
- yOffset: 1,
- xAdvance: 7,
- page: 0,
- letter: "/",
- movieClip: null
- };
- G.Font.chars[48] = {
- id: 48,
- x: 75,
- y: 29,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "0",
- movieClip: null
- };
- G.Font.chars[49] = {
- id: 49,
- x: 18,
- y: 40,
- width: 6,
- height: 9,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "1",
- movieClip: null
- };
- G.Font.chars[50] = {
- id: 50,
- x: 107,
- y: 29,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "2",
- movieClip: null
- };
- G.Font.chars[51] = {
- id: 51,
- x: 67,
- y: 29,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "3",
- movieClip: null
- };
- G.Font.chars[52] = {
- id: 52,
- x: 115,
- y: 29,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "4",
- movieClip: null
- };
- G.Font.chars[53] = {
- id: 53,
- x: 58,
- y: 29,
- width: 7,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "5",
- movieClip: null
- };
- G.Font.chars[54] = {
- id: 54,
- x: 83,
- y: 29,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "6",
- movieClip: null
- };
- G.Font.chars[55] = {
- id: 55,
- x: 10,
- y: 40,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "7",
- movieClip: null
- };
- G.Font.chars[56] = {
- id: 56,
- x: 99,
- y: 29,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "8",
- movieClip: null
- };
- G.Font.chars[57] = {
- id: 57,
- x: 91,
- y: 29,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "9",
- movieClip: null
- };
- G.Font.chars[58] = {
- id: 58,
- x: 19,
- y: 70,
- width: 4,
- height: 7,
- xOffset: 2,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: ":",
- movieClip: null
- };
- G.Font.chars[59] = {
- id: 59,
- x: 40,
- y: 40,
- width: 4,
- height: 9,
- xOffset: 2,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: ";",
- movieClip: null
- };
- G.Font.chars[60] = {
- id: 60,
- x: 33,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "<",
- movieClip: null
- };
- G.Font.chars[61] = {
- id: 61,
- x: 39,
- y: 70,
- width: 7,
- height: 4,
- xOffset: 1,
- yOffset: 5,
- xAdvance: 7,
- page: 0,
- letter: "=",
- movieClip: null
- };
- G.Font.chars[62] = {
- id: 62,
- x: 43,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: ">",
- movieClip: null
- };
- G.Font.chars[63] = {
- id: 63,
- x: 26,
- y: 40,
- width: 6,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "?",
- movieClip: null
- };
- G.Font.chars[64] = {
- id: 64,
- x: 106,
- y: 2,
- width: 6,
- height: 10,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "@",
- movieClip: null
- };
- G.Font.chars[65] = {
- id: 65,
- x: 46,
- y: 40,
- width: 9,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "A",
- movieClip: null
- };
- G.Font.chars[66] = {
- id: 66,
- x: 12,
- y: 51,
- width: 8,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "B",
- movieClip: null
- };
- G.Font.chars[67] = {
- id: 67,
- x: 112,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "C",
- movieClip: null
- };
- G.Font.chars[68] = {
- id: 68,
- x: 32,
- y: 51,
- width: 8,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "D",
- movieClip: null
- };
- G.Font.chars[69] = {
- id: 69,
- x: 81,
- y: 51,
- width: 7,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "E",
- movieClip: null
- };
- G.Font.chars[70] = {
- id: 70,
- x: 72,
- y: 51,
- width: 7,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "F",
- movieClip: null
- };
- G.Font.chars[71] = {
- id: 71,
- x: 72,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "G",
- movieClip: null
- };
- G.Font.chars[72] = {
- id: 72,
- x: 42,
- y: 51,
- width: 8,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "H",
- movieClip: null
- };
- G.Font.chars[73] = {
- id: 73,
- x: 90,
- y: 51,
- width: 6,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "I",
- movieClip: null
- };
- G.Font.chars[74] = {
- id: 74,
- x: 2,
- y: 29,
- width: 8,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "J",
- movieClip: null
- };
- G.Font.chars[75] = {
- id: 75,
- x: 89,
- y: 40,
- width: 8,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "K",
- movieClip: null
- };
- G.Font.chars[76] = {
- id: 76,
- x: 99,
- y: 40,
- width: 8,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "L",
- movieClip: null
- };
- G.Font.chars[77] = {
- id: 77,
- x: 68,
- y: 40,
- width: 9,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "M",
- movieClip: null
- };
- G.Font.chars[78] = {
- id: 78,
- x: 82,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "N",
- movieClip: null
- };
- G.Font.chars[79] = {
- id: 79,
- x: 102,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "O",
- movieClip: null
- };
- G.Font.chars[80] = {
- id: 80,
- x: 52,
- y: 51,
- width: 8,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "P",
- movieClip: null
- };
- G.Font.chars[81] = {
- id: 81,
- x: 87,
- y: 2,
- width: 8,
- height: 10,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "Q",
- movieClip: null
- };
- G.Font.chars[82] = {
- id: 82,
- x: 79,
- y: 40,
- width: 8,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "R",
- movieClip: null
- };
- G.Font.chars[83] = {
- id: 83,
- x: 49,
- y: 29,
- width: 7,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "S",
- movieClip: null
- };
- G.Font.chars[84] = {
- id: 84,
- x: 22,
- y: 51,
- width: 8,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "T",
- movieClip: null
- };
- G.Font.chars[85] = {
- id: 85,
- x: 92,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "U",
- movieClip: null
- };
- G.Font.chars[86] = {
- id: 86,
- x: 114,
- y: 2,
- width: 9,
- height: 9,
- xOffset: 0,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "V",
- movieClip: null
- };
- G.Font.chars[87] = {
- id: 87,
- x: 57,
- y: 40,
- width: 9,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "W",
- movieClip: null
- };
- G.Font.chars[88] = {
- id: 88,
- x: 2,
- y: 51,
- width: 8,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "X",
- movieClip: null
- };
- G.Font.chars[89] = {
- id: 89,
- x: 109,
- y: 40,
- width: 8,
- height: 8,
- xOffset: 0,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "Y",
- movieClip: null
- };
- G.Font.chars[90] = {
- id: 90,
- x: 98,
- y: 51,
- width: 6,
- height: 8,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 7,
- page: 0,
- letter: "Z",
- movieClip: null
- };
- G.Font.chars[91] = {
- id: 91,
- x: 64,
- y: 2,
- width: 4,
- height: 11,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "[",
- movieClip: null
- };
- G.Font.chars[92] = {
- id: 92,
- x: 30,
- y: 2,
- width: 6,
- height: 11,
- xOffset: 1,
- yOffset: 1,
- xAdvance: 7,
- page: 0,
- letter: "\\",
- movieClip: null
- };
- G.Font.chars[93] = {
- id: 93,
- x: 70,
- y: 2,
- width: 4,
- height: 11,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "]",
- movieClip: null
- };
- G.Font.chars[94] = {
- id: 94,
- x: 48,
- y: 70,
- width: 6,
- height: 4,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "^",
- movieClip: null
- };
- G.Font.chars[95] = {
- id: 95,
- x: 99,
- y: 70,
- width: 9,
- height: 2,
- xOffset: 0,
- yOffset: 12,
- xAdvance: 7,
- page: 0,
- letter: "_",
- movieClip: null
- };
- G.Font.chars[96] = {
- id: 96,
- x: 92,
- y: 70,
- width: 5,
- height: 3,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "`",
- movieClip: null
- };
- G.Font.chars[97] = {
- id: 97,
- x: 93,
- y: 61,
- width: 7,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "a",
- movieClip: null
- };
- G.Font.chars[98] = {
- id: 98,
- x: 22,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "b",
- movieClip: null
- };
- G.Font.chars[99] = {
- id: 99,
- x: 111,
- y: 61,
- width: 7,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "c",
- movieClip: null
- };
- G.Font.chars[100] = {
- id: 100,
- x: 12,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "d",
- movieClip: null
- };
- G.Font.chars[101] = {
- id: 101,
- x: 102,
- y: 61,
- width: 7,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "e",
- movieClip: null
- };
- G.Font.chars[102] = {
- id: 102,
- x: 31,
- y: 29,
- width: 7,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "f",
- movieClip: null
- };
- G.Font.chars[103] = {
- id: 103,
- x: 22,
- y: 29,
- width: 7,
- height: 9,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "g",
- movieClip: null
- };
- G.Font.chars[104] = {
- id: 104,
- x: 62,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "h",
- movieClip: null
- };
- G.Font.chars[105] = {
- id: 105,
- x: 97,
- y: 2,
- width: 7,
- height: 10,
- xOffset: 1,
- yOffset: 1,
- xAdvance: 7,
- page: 0,
- letter: "i",
- movieClip: null
- };
- G.Font.chars[106] = {
- id: 106,
- x: 6,
- y: 2,
- width: 6,
- height: 12,
- xOffset: 1,
- yOffset: 1,
- xAdvance: 7,
- page: 0,
- letter: "j",
- movieClip: null
- };
- G.Font.chars[107] = {
- id: 107,
- x: 52,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "k",
- movieClip: null
- };
- G.Font.chars[108] = {
- id: 108,
- x: 40,
- y: 29,
- width: 7,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "l",
- movieClip: null
- };
- G.Font.chars[109] = {
- id: 109,
- x: 2,
- y: 61,
- width: 9,
- height: 7,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "m",
- movieClip: null
- };
- G.Font.chars[110] = {
- id: 110,
- x: 53,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "n",
- movieClip: null
- };
- G.Font.chars[111] = {
- id: 111,
- x: 23,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "o",
- movieClip: null
- };
- G.Font.chars[112] = {
- id: 112,
- x: 32,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "p",
- movieClip: null
- };
- G.Font.chars[113] = {
- id: 113,
- x: 42,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "q",
- movieClip: null
- };
- G.Font.chars[114] = {
- id: 114,
- x: 63,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "r",
- movieClip: null
- };
- G.Font.chars[115] = {
- id: 115,
- x: 2,
- y: 70,
- width: 7,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "s",
- movieClip: null
- };
- G.Font.chars[116] = {
- id: 116,
- x: 12,
- y: 29,
- width: 8,
- height: 9,
- xOffset: 1,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "t",
- movieClip: null
- };
- G.Font.chars[117] = {
- id: 117,
- x: 73,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "u",
- movieClip: null
- };
- G.Font.chars[118] = {
- id: 118,
- x: 13,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "v",
- movieClip: null
- };
- G.Font.chars[119] = {
- id: 119,
- x: 114,
- y: 51,
- width: 9,
- height: 7,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "w",
- movieClip: null
- };
- G.Font.chars[120] = {
- id: 120,
- x: 83,
- y: 61,
- width: 8,
- height: 7,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "x",
- movieClip: null
- };
- G.Font.chars[121] = {
- id: 121,
- x: 2,
- y: 18,
- width: 8,
- height: 9,
- xOffset: 0,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "y",
- movieClip: null
- };
- G.Font.chars[122] = {
- id: 122,
- x: 11,
- y: 70,
- width: 6,
- height: 7,
- xOffset: 1,
- yOffset: 4,
- xAdvance: 7,
- page: 0,
- letter: "z",
- movieClip: null
- };
- G.Font.chars[123] = {
- id: 123,
- x: 38,
- y: 2,
- width: 5,
- height: 11,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "{",
- movieClip: null
- };
- G.Font.chars[124] = {
- id: 124,
- x: 2,
- y: 2,
- width: 2,
- height: 14,
- xOffset: 3,
- yOffset: 0,
- xAdvance: 7,
- page: 0,
- letter: "|",
- movieClip: null
- };
- G.Font.chars[125] = {
- id: 125,
- x: 45,
- y: 2,
- width: 5,
- height: 11,
- xOffset: 2,
- yOffset: 2,
- xAdvance: 7,
- page: 0,
- letter: "}",
- movieClip: null
- };
- G.Font.RegisterCharacters()
- };
- var n = function () {};
- s.FontGame = n;
- n.__name__ = ["FontGame"];
- n.Register = function () {
- n.Font = new q.OzFont;
- n.Font.face = "Cookies";
- n.Font.size = 20;
- n.Font.padding = [0, 0, 0, 0];
- n.Font.spacing = [2, 2];
- n.Font.lineHeight = 22;
- n.Font.base = 16;
- n.Font.numPages = 1;
- n.Font.bitmapName = "FontGame.png";
- n.Font.numChars = 95;
- n.Font.chars[32] = {
- id: 32,
- x: 118,
- y: 134,
- width: 0,
- height: 0,
- xOffset: 0,
- yOffset: 18,
- xAdvance: 6,
- page: 0,
- letter: " ",
- movieClip: null
- };
- n.Font.chars[33] = {
- id: 33,
- x: 125,
- y: 92,
- width: 10,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 6,
- page: 0,
- letter: "!",
- movieClip: null
- };
- n.Font.chars[34] = {
- id: 34,
- x: 228,
- y: 114,
- width: 15,
- height: 12,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: '"',
- movieClip: null
- };
- n.Font.chars[35] = {
- id: 35,
- x: 158,
- y: 114,
- width: 16,
- height: 16,
- xOffset: 0,
- yOffset: -1,
- xAdvance: 12,
- page: 0,
- letter: "#",
- movieClip: null
- };
- n.Font.chars[36] = {
- id: 36,
- x: 230,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "$",
- movieClip: null
- };
- n.Font.chars[37] = {
- id: 37,
- x: 50,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "%",
- movieClip: null
- };
- n.Font.chars[38] = {
- id: 38,
- x: 2,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "&",
- movieClip: null
- };
- n.Font.chars[39] = {
- id: 39,
- x: 18,
- y: 134,
- width: 10,
- height: 12,
- xOffset: 2,
- yOffset: -2,
- xAdvance: 8,
- page: 0,
- letter: "'",
- movieClip: null
- };
- n.Font.chars[40] = {
- id: 40,
- x: 19,
- y: 92,
- width: 14,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "(",
- movieClip: null
- };
- n.Font.chars[41] = {
- id: 41,
- x: 35,
- y: 92,
- width: 14,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: ")",
- movieClip: null
- };
- n.Font.chars[42] = {
- id: 42,
- x: 193,
- y: 114,
- width: 16,
- height: 14,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "*",
- movieClip: null
- };
- n.Font.chars[43] = {
- id: 43,
- x: 176,
- y: 114,
- width: 15,
- height: 16,
- xOffset: 0,
- yOffset: -1,
- xAdvance: 11,
- page: 0,
- letter: "+",
- movieClip: null
- };
- n.Font.chars[44] = {
- id: 44,
- x: 30,
- y: 134,
- width: 10,
- height: 12,
- xOffset: 2,
- yOffset: 8,
- xAdvance: 8,
- page: 0,
- letter: ",",
- movieClip: null
- };
- n.Font.chars[45] = {
- id: 45,
- x: 84,
- y: 134,
- width: 15,
- height: 9,
- xOffset: 1,
- yOffset: 3,
- xAdvance: 12,
- page: 0,
- letter: "-",
- movieClip: null
- };
- n.Font.chars[46] = {
- id: 46,
- x: 72,
- y: 134,
- width: 10,
- height: 10,
- xOffset: 2,
- yOffset: 8,
- xAdvance: 8,
- page: 0,
- letter: ".",
- movieClip: null
- };
- n.Font.chars[47] = {
- id: 47,
- x: 2,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "/",
- movieClip: null
- };
- n.Font.chars[48] = {
- id: 48,
- x: 19,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "0",
- movieClip: null
- };
- n.Font.chars[49] = {
- id: 49,
- x: 98,
- y: 92,
- width: 13,
- height: 20,
- xOffset: 3,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "1",
- movieClip: null
- };
- n.Font.chars[50] = {
- id: 50,
- x: 36,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "2",
- movieClip: null
- };
- n.Font.chars[51] = {
- id: 51,
- x: 53,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "3",
- movieClip: null
- };
- n.Font.chars[52] = {
- id: 52,
- x: 20,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "4",
- movieClip: null
- };
- n.Font.chars[53] = {
- id: 53,
- x: 70,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "5",
- movieClip: null
- };
- n.Font.chars[54] = {
- id: 54,
- x: 87,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "6",
- movieClip: null
- };
- n.Font.chars[55] = {
- id: 55,
- x: 104,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "7",
- movieClip: null
- };
- n.Font.chars[56] = {
- id: 56,
- x: 38,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "8",
- movieClip: null
- };
- n.Font.chars[57] = {
- id: 57,
- x: 121,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "9",
- movieClip: null
- };
- n.Font.chars[58] = {
- id: 58,
- x: 146,
- y: 114,
- width: 10,
- height: 18,
- xOffset: 2,
- yOffset: 0,
- xAdvance: 8,
- page: 0,
- letter: ":",
- movieClip: null
- };
- n.Font.chars[59] = {
- id: 59,
- x: 20,
- y: 2,
- width: 10,
- height: 21,
- xOffset: 2,
- yOffset: -1,
- xAdvance: 8,
- page: 0,
- letter: ";",
- movieClip: null
- };
- n.Font.chars[60] = {
- id: 60,
- x: 223,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "<",
- movieClip: null
- };
- n.Font.chars[61] = {
- id: 61,
- x: 211,
- y: 114,
- width: 15,
- height: 13,
- xOffset: 1,
- yOffset: 1,
- xAdvance: 12,
- page: 0,
- letter: "=",
- movieClip: null
- };
- n.Font.chars[62] = {
- id: 62,
- x: 2,
- y: 92,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: ">",
- movieClip: null
- };
- n.Font.chars[63] = {
- id: 63,
- x: 138,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "?",
- movieClip: null
- };
- n.Font.chars[64] = {
- id: 64,
- x: 56,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "@",
- movieClip: null
- };
- n.Font.chars[65] = {
- id: 65,
- x: 86,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "A",
- movieClip: null
- };
- n.Font.chars[66] = {
- id: 66,
- x: 74,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "B",
- movieClip: null
- };
- n.Font.chars[67] = {
- id: 67,
- x: 92,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "C",
- movieClip: null
- };
- n.Font.chars[68] = {
- id: 68,
- x: 110,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "D",
- movieClip: null
- };
- n.Font.chars[69] = {
- id: 69,
- x: 146,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "E",
- movieClip: null
- };
- n.Font.chars[70] = {
- id: 70,
- x: 164,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "F",
- movieClip: null
- };
- n.Font.chars[71] = {
- id: 71,
- x: 128,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "G",
- movieClip: null
- };
- n.Font.chars[72] = {
- id: 72,
- x: 155,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "H",
- movieClip: null
- };
- n.Font.chars[73] = {
- id: 73,
- x: 137,
- y: 92,
- width: 10,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 6,
- page: 0,
- letter: "I",
- movieClip: null
- };
- n.Font.chars[74] = {
- id: 74,
- x: 172,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "J",
- movieClip: null
- };
- n.Font.chars[75] = {
- id: 75,
- x: 140,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "K",
- movieClip: null
- };
- n.Font.chars[76] = {
- id: 76,
- x: 146,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "L",
- movieClip: null
- };
- n.Font.chars[77] = {
- id: 77,
- x: 68,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "M",
- movieClip: null
- };
- n.Font.chars[78] = {
- id: 78,
- x: 104,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "N",
- movieClip: null
- };
- n.Font.chars[79] = {
- id: 79,
- x: 164,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "O",
- movieClip: null
- };
- n.Font.chars[80] = {
- id: 80,
- x: 182,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "P",
- movieClip: null
- };
- n.Font.chars[81] = {
- id: 81,
- x: 158,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "Q",
- movieClip: null
- };
- n.Font.chars[82] = {
- id: 82,
- x: 176,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "R",
- movieClip: null
- };
- n.Font.chars[83] = {
- id: 83,
- x: 200,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "S",
- movieClip: null
- };
- n.Font.chars[84] = {
- id: 84,
- x: 218,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "T",
- movieClip: null
- };
- n.Font.chars[85] = {
- id: 85,
- x: 236,
- y: 26,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "U",
- movieClip: null
- };
- n.Font.chars[86] = {
- id: 86,
- x: 122,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "V",
- movieClip: null
- };
- n.Font.chars[87] = {
- id: 87,
- x: 32,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "W",
- movieClip: null
- };
- n.Font.chars[88] = {
- id: 88,
- x: 2,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "X",
- movieClip: null
- };
- n.Font.chars[89] = {
- id: 89,
- x: 20,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "Y",
- movieClip: null
- };
- n.Font.chars[90] = {
- id: 90,
- x: 182,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "Z",
- movieClip: null
- };
- n.Font.chars[91] = {
- id: 91,
- x: 235,
- y: 48,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "[",
- movieClip: null
- };
- n.Font.chars[92] = {
- id: 92,
- x: 189,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "\\",
- movieClip: null
- };
- n.Font.chars[93] = {
- id: 93,
- x: 218,
- y: 48,
- width: 15,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "]",
- movieClip: null
- };
- n.Font.chars[94] = {
- id: 94,
- x: 2,
- y: 134,
- width: 14,
- height: 12,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "^",
- movieClip: null
- };
- n.Font.chars[95] = {
- id: 95,
- x: 101,
- y: 134,
- width: 15,
- height: 9,
- xOffset: 1,
- yOffset: 9,
- xAdvance: 12,
- page: 0,
- letter: "_",
- movieClip: null
- };
- n.Font.chars[96] = {
- id: 96,
- x: 60,
- y: 134,
- width: 10,
- height: 10,
- xOffset: 3,
- yOffset: -2,
- xAdvance: 9,
- page: 0,
- letter: "`",
- movieClip: null
- };
- n.Font.chars[97] = {
- id: 97,
- x: 161,
- y: 92,
- width: 16,
- height: 19,
- xOffset: 0,
- yOffset: -1,
- xAdvance: 12,
- page: 0,
- letter: "a",
- movieClip: null
- };
- n.Font.chars[98] = {
- id: 98,
- x: 38,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "b",
- movieClip: null
- };
- n.Font.chars[99] = {
- id: 99,
- x: 20,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 11,
- page: 0,
- letter: "c",
- movieClip: null
- };
- n.Font.chars[100] = {
- id: 100,
- x: 56,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "d",
- movieClip: null
- };
- n.Font.chars[101] = {
- id: 101,
- x: 110,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "e",
- movieClip: null
- };
- n.Font.chars[102] = {
- id: 102,
- x: 200,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "f",
- movieClip: null
- };
- n.Font.chars[103] = {
- id: 103,
- x: 74,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "g",
- movieClip: null
- };
- n.Font.chars[104] = {
- id: 104,
- x: 206,
- y: 70,
- width: 15,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 11,
- page: 0,
- letter: "h",
- movieClip: null
- };
- n.Font.chars[105] = {
- id: 105,
- x: 149,
- y: 92,
- width: 10,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 6,
- page: 0,
- letter: "i",
- movieClip: null
- };
- n.Font.chars[106] = {
- id: 106,
- x: 2,
- y: 2,
- width: 16,
- height: 22,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "j",
- movieClip: null
- };
- n.Font.chars[107] = {
- id: 107,
- x: 194,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "k",
- movieClip: null
- };
- n.Font.chars[108] = {
- id: 108,
- x: 83,
- y: 92,
- width: 13,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 8,
- page: 0,
- letter: "l",
- movieClip: null
- };
- n.Font.chars[109] = {
- id: 109,
- x: 197,
- y: 92,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "m",
- movieClip: null
- };
- n.Font.chars[110] = {
- id: 110,
- x: 215,
- y: 92,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "n",
- movieClip: null
- };
- n.Font.chars[111] = {
- id: 111,
- x: 38,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "o",
- movieClip: null
- };
- n.Font.chars[112] = {
- id: 112,
- x: 92,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "p",
- movieClip: null
- };
- n.Font.chars[113] = {
- id: 113,
- x: 212,
- y: 2,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "q",
- movieClip: null
- };
- n.Font.chars[114] = {
- id: 114,
- x: 2,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 11,
- page: 0,
- letter: "r",
- movieClip: null
- };
- n.Font.chars[115] = {
- id: 115,
- x: 56,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "s",
- movieClip: null
- };
- n.Font.chars[116] = {
- id: 116,
- x: 110,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "t",
- movieClip: null
- };
- n.Font.chars[117] = {
- id: 117,
- x: 74,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "u",
- movieClip: null
- };
- n.Font.chars[118] = {
- id: 118,
- x: 233,
- y: 92,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "v",
- movieClip: null
- };
- n.Font.chars[119] = {
- id: 119,
- x: 179,
- y: 92,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "w",
- movieClip: null
- };
- n.Font.chars[120] = {
- id: 120,
- x: 92,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "x",
- movieClip: null
- };
- n.Font.chars[121] = {
- id: 121,
- x: 128,
- y: 48,
- width: 16,
- height: 20,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "y",
- movieClip: null
- };
- n.Font.chars[122] = {
- id: 122,
- x: 128,
- y: 114,
- width: 16,
- height: 18,
- xOffset: 0,
- yOffset: 0,
- xAdvance: 12,
- page: 0,
- letter: "z",
- movieClip: null
- };
- n.Font.chars[123] = {
- id: 123,
- x: 67,
- y: 92,
- width: 14,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 10,
- page: 0,
- letter: "{",
- movieClip: null
- };
- n.Font.chars[124] = {
- id: 124,
- x: 113,
- y: 92,
- width: 10,
- height: 20,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 6,
- page: 0,
- letter: "|",
- movieClip: null
- };
- n.Font.chars[125] = {
- id: 125,
- x: 51,
- y: 92,
- width: 14,
- height: 20,
- xOffset: 1,
- yOffset: -2,
- xAdvance: 10,
- page: 0,
- letter: "}",
- movieClip: null
- };
- n.Font.chars[126] = {
- id: 126,
- x: 42,
- y: 134,
- width: 16,
- height: 10,
- xOffset: 0,
- yOffset: -2,
- xAdvance: 12,
- page: 0,
- letter: "~",
- movieClip: null
- };
- n.Font.numKernings = 480;
- n.Font.addKerning(32, 115, -2);
- n.Font.addKerning(33, 46, -2);
- n.Font.addKerning(33, 49, -2);
- n.Font.addKerning(33, 104, -5);
- n.Font.addKerning(33, 105, -2);
- n.Font.addKerning(34, 44, -8);
- n.Font.addKerning(34, 45, -3);
- n.Font.addKerning(34, 46, -8);
- n.Font.addKerning(34, 47, -5);
- n.Font.addKerning(34, 49, -2);
- n.Font.addKerning(34, 52, -3);
- n.Font.addKerning(34, 74, -5);
- n.Font.addKerning(34, 99, -2);
- n.Font.addKerning(34, 100, -5);
- n.Font.addKerning(34, 106, -5);
- n.Font.addKerning(34, 111, -2);
- n.Font.addKerning(35, 39, -2);
- n.Font.addKerning(35, 41, -3);
- n.Font.addKerning(35, 44, -4);
- n.Font.addKerning(35, 46, -4);
- n.Font.addKerning(35, 47, -2);
- n.Font.addKerning(35, 49, -4);
- n.Font.addKerning(35, 51, -2);
- n.Font.addKerning(35, 58, -2);
- n.Font.addKerning(35, 59, -2);
- n.Font.addKerning(35, 64, -3);
- n.Font.addKerning(35,
- 93, -2);
- n.Font.addKerning(35, 106, -3);
- n.Font.addKerning(35, 124, -3);
- n.Font.addKerning(36, 64, -1);
- n.Font.addKerning(36, 84, -3);
- n.Font.addKerning(36, 124, -2);
- n.Font.addKerning(36, 125, -2);
- n.Font.addKerning(39, 44, -8);
- n.Font.addKerning(39, 45, -3);
- n.Font.addKerning(39, 46, -8);
- n.Font.addKerning(39, 47, -7);
- n.Font.addKerning(39, 49, -2);
- n.Font.addKerning(39, 52, -3);
- n.Font.addKerning(39, 74, -7);
- n.Font.addKerning(39, 99, -2);
- n.Font.addKerning(39, 100, -7);
- n.Font.addKerning(39, 106, -6);
- n.Font.addKerning(39, 111, -2);
- n.Font.addKerning(39,
- 115, -1);
- n.Font.addKerning(40, 35, -2);
- n.Font.addKerning(40, 45, -4);
- n.Font.addKerning(40, 49, -2);
- n.Font.addKerning(40, 52, -2);
- n.Font.addKerning(40, 102, -3);
- n.Font.addKerning(40, 113, -2);
- n.Font.addKerning(41, 39, -2);
- n.Font.addKerning(41, 41, -2);
- n.Font.addKerning(41, 44, -2);
- n.Font.addKerning(41, 46, -2);
- n.Font.addKerning(41, 49, -3);
- n.Font.addKerning(41, 51, -2);
- n.Font.addKerning(41, 58, -2);
- n.Font.addKerning(41, 59, -2);
- n.Font.addKerning(44, 34, -6);
- n.Font.addKerning(44, 35, -2);
- n.Font.addKerning(44, 39, -8);
- n.Font.addKerning(44,
- 45, -6);
- n.Font.addKerning(44, 49, -4);
- n.Font.addKerning(44, 52, -2);
- n.Font.addKerning(44, 55, -3);
- n.Font.addKerning(44, 63, -3);
- n.Font.addKerning(44, 84, -3);
- n.Font.addKerning(44, 89, -2);
- n.Font.addKerning(44, 92, -6);
- n.Font.addKerning(44, 102, -3);
- n.Font.addKerning(44, 113, -3);
- n.Font.addKerning(44, 116, -3);
- n.Font.addKerning(45, 39, -3);
- n.Font.addKerning(45, 41, -5);
- n.Font.addKerning(45, 44, -8);
- n.Font.addKerning(45, 46, -8);
- n.Font.addKerning(45, 47, -2);
- n.Font.addKerning(45, 49, -4);
- n.Font.addKerning(45, 50, -3);
- n.Font.addKerning(45,
- 51, -2);
- n.Font.addKerning(45, 55, -2);
- n.Font.addKerning(45, 57, -2);
- n.Font.addKerning(45, 58, -3);
- n.Font.addKerning(45, 59, -3);
- n.Font.addKerning(45, 63, -4);
- n.Font.addKerning(45, 74, -2);
- n.Font.addKerning(45, 84, -3);
- n.Font.addKerning(45, 88, -2);
- n.Font.addKerning(45, 92, -2);
- n.Font.addKerning(45, 93, -5);
- n.Font.addKerning(45, 106, -6);
- n.Font.addKerning(46, 34, -7);
- n.Font.addKerning(46, 35, -2);
- n.Font.addKerning(46, 39, -8);
- n.Font.addKerning(46, 45, -7);
- n.Font.addKerning(46, 49, -4);
- n.Font.addKerning(46, 52, -2);
- n.Font.addKerning(46,
- 55, -3);
- n.Font.addKerning(46, 63, -3);
- n.Font.addKerning(46, 84, -3);
- n.Font.addKerning(46, 89, -3);
- n.Font.addKerning(46, 92, -7);
- n.Font.addKerning(46, 102, -3);
- n.Font.addKerning(46, 113, -3);
- n.Font.addKerning(46, 116, -3);
- n.Font.addKerning(47, 44, -5);
- n.Font.addKerning(47, 45, -2);
- n.Font.addKerning(47, 46, -5);
- n.Font.addKerning(47, 47, -4);
- n.Font.addKerning(47, 49, -2);
- n.Font.addKerning(47, 52, -2);
- n.Font.addKerning(47, 58, -2);
- n.Font.addKerning(47, 59, -2);
- n.Font.addKerning(47, 74, -3);
- n.Font.addKerning(47, 99, -2);
- n.Font.addKerning(47,
- 100, -3);
- n.Font.addKerning(47, 106, -4);
- n.Font.addKerning(48, 39, -2);
- n.Font.addKerning(48, 44, -2);
- n.Font.addKerning(48, 46, -2);
- n.Font.addKerning(49, 39, -3);
- n.Font.addKerning(49, 40, -2);
- n.Font.addKerning(49, 41, -2);
- n.Font.addKerning(49, 44, -3);
- n.Font.addKerning(49, 46, -3);
- n.Font.addKerning(49, 47, -2);
- n.Font.addKerning(49, 58, -3);
- n.Font.addKerning(49, 59, -3);
- n.Font.addKerning(49, 63, -2);
- n.Font.addKerning(49, 74, -2);
- n.Font.addKerning(49, 92, -2);
- n.Font.addKerning(49, 93, -2);
- n.Font.addKerning(49, 106, -2);
- n.Font.addKerning(50,
- 39, -2);
- n.Font.addKerning(51, 39, -2);
- n.Font.addKerning(51, 46, -2);
- n.Font.addKerning(51, 58, -2);
- n.Font.addKerning(51, 59, -2);
- n.Font.addKerning(52, 34, -2);
- n.Font.addKerning(52, 39, -3);
- n.Font.addKerning(52, 41, -2);
- n.Font.addKerning(52, 44, -2);
- n.Font.addKerning(52, 46, -2);
- n.Font.addKerning(52, 58, -2);
- n.Font.addKerning(52, 59, -2);
- n.Font.addKerning(52, 63, -2);
- n.Font.addKerning(52, 92, -2);
- n.Font.addKerning(53, 39, -2);
- n.Font.addKerning(53, 58, -2);
- n.Font.addKerning(53, 59, -2);
- n.Font.addKerning(54, 39, -2);
- n.Font.addKerning(54,
- 59, -2);
- n.Font.addKerning(55, 44, -3);
- n.Font.addKerning(55, 46, -3);
- n.Font.addKerning(55, 47, -2);
- n.Font.addKerning(55, 106, -2);
- n.Font.addKerning(56, 39, -2);
- n.Font.addKerning(57, 39, -2);
- n.Font.addKerning(57, 44, -2);
- n.Font.addKerning(57, 46, -2);
- n.Font.addKerning(57, 58, -2);
- n.Font.addKerning(57, 59, -2);
- n.Font.addKerning(58, 45, -2);
- n.Font.addKerning(58, 49, -3);
- n.Font.addKerning(59, 45, -2);
- n.Font.addKerning(59, 49, -3);
- n.Font.addKerning(63, 44, -4);
- n.Font.addKerning(63, 46, -4);
- n.Font.addKerning(63, 47, -3);
- n.Font.addKerning(63,
- 49, -3);
- n.Font.addKerning(63, 74, -3);
- n.Font.addKerning(63, 100, -2);
- n.Font.addKerning(63, 106, -3);
- n.Font.addKerning(64, 39, -2);
- n.Font.addKerning(64, 49, -3);
- n.Font.addKerning(65, 39, -3);
- n.Font.addKerning(65, 49, -4);
- n.Font.addKerning(65, 55, -2);
- n.Font.addKerning(65, 63, -2);
- n.Font.addKerning(65, 84, -1);
- n.Font.addKerning(65, 86, -1);
- n.Font.addKerning(65, 89, -1);
- n.Font.addKerning(65, 92, -2);
- n.Font.addKerning(66, 39, -2);
- n.Font.addKerning(66, 49, -3);
- n.Font.addKerning(66, 55, -2);
- n.Font.addKerning(67, 35, -2);
- n.Font.addKerning(67,
- 39, -2);
- n.Font.addKerning(67, 45, -6);
- n.Font.addKerning(67, 49, -3);
- n.Font.addKerning(67, 55, -2);
- n.Font.addKerning(67, 63, -2);
- n.Font.addKerning(67, 102, -3);
- n.Font.addKerning(68, 39, -2);
- n.Font.addKerning(68, 44, -2);
- n.Font.addKerning(68, 46, -2);
- n.Font.addKerning(68, 49, -3);
- n.Font.addKerning(68, 51, -2);
- n.Font.addKerning(68, 58, -2);
- n.Font.addKerning(68, 59, -2);
- n.Font.addKerning(69, 39, -2);
- n.Font.addKerning(69, 49, -3);
- n.Font.addKerning(70, 36, -2);
- n.Font.addKerning(70, 44, -5);
- n.Font.addKerning(70, 46, -5);
- n.Font.addKerning(70,
- 47, -2);
- n.Font.addKerning(70, 49, -2);
- n.Font.addKerning(70, 74, -2);
- n.Font.addKerning(70, 106, -4);
- n.Font.addKerning(71, 39, -3);
- n.Font.addKerning(71, 49, -4);
- n.Font.addKerning(71, 55, -2);
- n.Font.addKerning(71, 58, -2);
- n.Font.addKerning(71, 59, -2);
- n.Font.addKerning(71, 63, -2);
- n.Font.addKerning(71, 92, -2);
- n.Font.addKerning(71, 116, -2);
- n.Font.addKerning(72, 49, -3);
- n.Font.addKerning(73, 49, -2);
- n.Font.addKerning(74, 39, -2);
- n.Font.addKerning(74, 44, -2);
- n.Font.addKerning(74, 46, -2);
- n.Font.addKerning(74, 49, -3);
- n.Font.addKerning(74,
- 58, -2);
- n.Font.addKerning(74, 59, -2);
- n.Font.addKerning(75, 45, -2);
- n.Font.addKerning(75, 49, -2);
- n.Font.addKerning(76, 34, -5);
- n.Font.addKerning(76, 35, -2);
- n.Font.addKerning(76, 39, -6);
- n.Font.addKerning(76, 45, -6);
- n.Font.addKerning(76, 49, -4);
- n.Font.addKerning(76, 55, -3);
- n.Font.addKerning(76, 63, -3);
- n.Font.addKerning(76, 84, -2);
- n.Font.addKerning(76, 86, -1);
- n.Font.addKerning(76, 89, -2);
- n.Font.addKerning(76, 92, -4);
- n.Font.addKerning(76, 102, -3);
- n.Font.addKerning(76, 113, -2);
- n.Font.addKerning(76, 116, -2);
- n.Font.addKerning(77,
- 39, -2);
- n.Font.addKerning(77, 49, -3);
- n.Font.addKerning(77, 78, 1);
- n.Font.addKerning(78, 46, -2);
- n.Font.addKerning(78, 49, -3);
- n.Font.addKerning(79, 39, -2);
- n.Font.addKerning(79, 44, -2);
- n.Font.addKerning(79, 46, -2);
- n.Font.addKerning(79, 49, -3);
- n.Font.addKerning(79, 58, -2);
- n.Font.addKerning(79, 59, -2);
- n.Font.addKerning(79, 92, -2);
- n.Font.addKerning(80, 34, -8);
- n.Font.addKerning(80, 35, -3);
- n.Font.addKerning(80, 36, -8);
- n.Font.addKerning(80, 37, -5);
- n.Font.addKerning(80, 44, -6);
- n.Font.addKerning(80, 46, -6);
- n.Font.addKerning(80,
- 47, -3);
- n.Font.addKerning(80, 49, -3);
- n.Font.addKerning(80, 74, -2);
- n.Font.addKerning(80, 106, -5);
- n.Font.addKerning(81, 32, -3);
- n.Font.addKerning(81, 39, -3);
- n.Font.addKerning(81, 49, -4);
- n.Font.addKerning(81, 55, -2);
- n.Font.addKerning(81, 63, -2);
- n.Font.addKerning(81, 92, -2);
- n.Font.addKerning(82, 39, -2);
- n.Font.addKerning(82, 49, -3);
- n.Font.addKerning(83, 34, -5);
- n.Font.addKerning(83, 39, -2);
- n.Font.addKerning(83, 49, -3);
- n.Font.addKerning(84, 44, -4);
- n.Font.addKerning(84, 45, -3);
- n.Font.addKerning(84, 46, -4);
- n.Font.addKerning(84,
- 47, -3);
- n.Font.addKerning(84, 49, -2);
- n.Font.addKerning(84, 52, -2);
- n.Font.addKerning(84, 58, -2);
- n.Font.addKerning(84, 59, -2);
- n.Font.addKerning(84, 65, -1);
- n.Font.addKerning(84, 74, -3);
- n.Font.addKerning(84, 99, -2);
- n.Font.addKerning(84, 100, -3);
- n.Font.addKerning(84, 101, -1);
- n.Font.addKerning(84, 106, -3);
- n.Font.addKerning(84, 111, -1);
- n.Font.addKerning(84, 115, -1);
- n.Font.addKerning(85, 44, -2);
- n.Font.addKerning(85, 46, -2);
- n.Font.addKerning(85, 49, -3);
- n.Font.addKerning(86, 36, -5);
- n.Font.addKerning(86, 44, -3);
- n.Font.addKerning(86,
- 46, -3);
- n.Font.addKerning(86, 47, -2);
- n.Font.addKerning(86, 49, -2);
- n.Font.addKerning(86, 58, -1);
- n.Font.addKerning(86, 59, -1);
- n.Font.addKerning(87, 44, -2);
- n.Font.addKerning(87, 46, -2);
- n.Font.addKerning(87, 49, -2);
- n.Font.addKerning(87, 58, -1);
- n.Font.addKerning(87, 59, -1);
- n.Font.addKerning(88, 45, -2);
- n.Font.addKerning(88, 49, -2);
- n.Font.addKerning(89, 44, -4);
- n.Font.addKerning(89, 45, -1);
- n.Font.addKerning(89, 46, -4);
- n.Font.addKerning(89, 47, -3);
- n.Font.addKerning(89, 49, -2);
- n.Font.addKerning(89, 52, -2);
- n.Font.addKerning(89,
- 58, -2);
- n.Font.addKerning(89, 59, -2);
- n.Font.addKerning(89, 65, -1);
- n.Font.addKerning(89, 74, -3);
- n.Font.addKerning(89, 100, -2);
- n.Font.addKerning(89, 101, -1);
- n.Font.addKerning(89, 106, -3);
- n.Font.addKerning(89, 111, -1);
- n.Font.addKerning(90, 34, -4);
- n.Font.addKerning(90, 36, -4);
- n.Font.addKerning(90, 37, -2);
- n.Font.addKerning(90, 49, -2);
- n.Font.addKerning(91, 38, -2);
- n.Font.addKerning(92, 34, -3);
- n.Font.addKerning(92, 39, -5);
- n.Font.addKerning(92, 49, -4);
- n.Font.addKerning(92, 55, -3);
- n.Font.addKerning(92, 63, -3);
- n.Font.addKerning(92,
- 84, -2);
- n.Font.addKerning(92, 89, -2);
- n.Font.addKerning(92, 92, -4);
- n.Font.addKerning(92, 102, -2);
- n.Font.addKerning(92, 116, -2);
- n.Font.addKerning(93, 39, -2);
- n.Font.addKerning(93, 44, -2);
- n.Font.addKerning(93, 46, -2);
- n.Font.addKerning(93, 49, -3);
- n.Font.addKerning(93, 58, -2);
- n.Font.addKerning(93, 59, -2);
- n.Font.addKerning(95, 33, -2);
- n.Font.addKerning(96, 36, -3);
- n.Font.addKerning(97, 39, -2);
- n.Font.addKerning(97, 49, -3);
- n.Font.addKerning(97, 58, -2);
- n.Font.addKerning(97, 59, -2);
- n.Font.addKerning(98, 34, -3);
- n.Font.addKerning(98,
- 39, -4);
- n.Font.addKerning(98, 49, -4);
- n.Font.addKerning(98, 55, -3);
- n.Font.addKerning(98, 58, -2);
- n.Font.addKerning(98, 59, -2);
- n.Font.addKerning(98, 63, -3);
- n.Font.addKerning(98, 92, -3);
- n.Font.addKerning(98, 116, -3);
- n.Font.addKerning(99, 39, -3);
- n.Font.addKerning(99, 45, -5);
- n.Font.addKerning(99, 49, -4);
- n.Font.addKerning(99, 55, -2);
- n.Font.addKerning(99, 63, -2);
- n.Font.addKerning(99, 92, -2);
- n.Font.addKerning(100, 39, -2);
- n.Font.addKerning(100, 44, -2);
- n.Font.addKerning(100, 46, -2);
- n.Font.addKerning(100, 49, -3);
- n.Font.addKerning(100,
- 58, -2);
- n.Font.addKerning(100, 59, -2);
- n.Font.addKerning(101, 39, -2);
- n.Font.addKerning(101, 49, -4);
- n.Font.addKerning(101, 92, -2);
- n.Font.addKerning(102, 34, -1);
- n.Font.addKerning(102, 39, -2);
- n.Font.addKerning(102, 41, -2);
- n.Font.addKerning(102, 44, -4);
- n.Font.addKerning(102, 46, -4);
- n.Font.addKerning(102, 47, -2);
- n.Font.addKerning(102, 49, -4);
- n.Font.addKerning(102, 51, -2);
- n.Font.addKerning(102, 58, -2);
- n.Font.addKerning(102, 59, -2);
- n.Font.addKerning(102, 63, -2);
- n.Font.addKerning(102, 93, -2);
- n.Font.addKerning(102, 106, -3);
- n.Font.addKerning(103, 39, -2);
- n.Font.addKerning(103, 44, -2);
- n.Font.addKerning(103, 46, -2);
- n.Font.addKerning(103, 49, -4);
- n.Font.addKerning(103, 58, -2);
- n.Font.addKerning(103, 59, -2);
- n.Font.addKerning(103, 92, -2);
- n.Font.addKerning(104, 34, -3);
- n.Font.addKerning(104, 39, -4);
- n.Font.addKerning(104, 49, -4);
- n.Font.addKerning(104, 55, -3);
- n.Font.addKerning(104, 63, -3);
- n.Font.addKerning(104, 92, -3);
- n.Font.addKerning(104, 116, -2);
- n.Font.addKerning(105, 49, -2);
- n.Font.addKerning(106, 39, -2);
- n.Font.addKerning(106, 49, -3);
- n.Font.addKerning(106,
- 55, -2);
- n.Font.addKerning(107, 39, -2);
- n.Font.addKerning(107, 49, -3);
- n.Font.addKerning(108, 34, -2);
- n.Font.addKerning(108, 35, -2);
- n.Font.addKerning(108, 39, -3);
- n.Font.addKerning(108, 45, -2);
- n.Font.addKerning(108, 49, -4);
- n.Font.addKerning(108, 55, -3);
- n.Font.addKerning(108, 63, -3);
- n.Font.addKerning(108, 92, -2);
- n.Font.addKerning(108, 102, -2);
- n.Font.addKerning(108, 113, -2);
- n.Font.addKerning(108, 116, -2);
- n.Font.addKerning(109, 39, -2);
- n.Font.addKerning(109, 46, -2);
- n.Font.addKerning(109, 49, -3);
- n.Font.addKerning(109, 58, -2);
- n.Font.addKerning(109, 59, -2);
- n.Font.addKerning(110, 39, -2);
- n.Font.addKerning(110, 49, -4);
- n.Font.addKerning(110, 58, -2);
- n.Font.addKerning(110, 59, -2);
- n.Font.addKerning(111, 39, -3);
- n.Font.addKerning(111, 46, -2);
- n.Font.addKerning(111, 49, -4);
- n.Font.addKerning(111, 55, -2);
- n.Font.addKerning(111, 58, -2);
- n.Font.addKerning(111, 59, -2);
- n.Font.addKerning(111, 63, -2);
- n.Font.addKerning(111, 92, -2);
- n.Font.addKerning(112, 39, -2);
- n.Font.addKerning(112, 41, -2);
- n.Font.addKerning(112, 44, -4);
- n.Font.addKerning(112, 46, -4);
- n.Font.addKerning(112,
- 47, -2);
- n.Font.addKerning(112, 49, -4);
- n.Font.addKerning(112, 51, -2);
- n.Font.addKerning(112, 58, -2);
- n.Font.addKerning(112, 59, -2);
- n.Font.addKerning(112, 93, -2);
- n.Font.addKerning(112, 106, -5);
- n.Font.addKerning(113, 39, -2);
- n.Font.addKerning(113, 49, -3);
- n.Font.addKerning(114, 41, -2);
- n.Font.addKerning(114, 44, -6);
- n.Font.addKerning(114, 45, -1);
- n.Font.addKerning(114, 46, -6);
- n.Font.addKerning(114, 47, -3);
- n.Font.addKerning(114, 49, -4);
- n.Font.addKerning(114, 99, -1);
- n.Font.addKerning(114, 100, -2);
- n.Font.addKerning(114, 106, -5);
- n.Font.addKerning(114, 111, -1);
- n.Font.addKerning(115, 39, -2);
- n.Font.addKerning(115, 49, -4);
- n.Font.addKerning(116, 49, -3);
- n.Font.addKerning(117, 39, -2);
- n.Font.addKerning(117, 44, -2);
- n.Font.addKerning(117, 46, -2);
- n.Font.addKerning(117, 49, -3);
- n.Font.addKerning(117, 58, -2);
- n.Font.addKerning(117, 59, -2);
- n.Font.addKerning(118, 44, -2);
- n.Font.addKerning(118, 46, -3);
- n.Font.addKerning(118, 49, -2);
- n.Font.addKerning(119, 44, -2);
- n.Font.addKerning(119, 46, -2);
- n.Font.addKerning(119, 49, -3);
- n.Font.addKerning(120, 49, -3);
- n.Font.addKerning(120,
- 52, -2);
- n.Font.addKerning(121, 44, -4);
- n.Font.addKerning(121, 46, -4);
- n.Font.addKerning(121, 47, -3);
- n.Font.addKerning(121, 49, -2);
- n.Font.addKerning(121, 106, -3);
- n.Font.addKerning(122, 39, -2);
- n.Font.RegisterCharacters()
- };
- var T = function () {};
- s.Globals = T;
- T.__name__ = ["Globals"];
- T.Init = function () {
- T.levelsXML = O.parse(y.Resource.getString("levels")).firstElement();
- T.levelsXMLLoaded = !0;
- T.definitionsXML = O.parse(y.Resource.getString("definitions")).firstElement();
- T.definitionsXMLLoaded = !0;
- T.load()
- };
- T.load = function () {
- T.so =
- k.net.SharedObject.getLocal("we_save_it3");
- if (null == T.so.data || null == T.so.data.levelScores) {
- T.so.data.edit_data = "<level/>";
- T.so.data.levelScores = [];
- for (var a = 0, b = T.NUMLEVELS; a < b;) {
- var d = a++;
- T.so.data.levelScores[d] = -1
- }
- }
- T.edit_data = O.parse(F.Boot.__cast(T.so.data.edit_data, String)).firstElement();
- T.levelScores = T.so.data.levelScores
- };
- T.save = function () {
- T.so.data.edit_data = T.edit_data.toString();
- T.so.data.levelScores = T.levelScores;
- var a = null;
- try {
- a = F.Boot.__cast(T.so.flush(), String)
- } catch (b) {
- y.Log.trace("couldnt write...", {
- fileName: "Globals.hx",
- lineNumber: 74,
- className: "Globals",
- methodName: "save"
- })
- }
- null != a && (a == F.Boot.__cast(k.net.SharedObjectFlushStatus.PENDING, String) && y.Log.trace("requesting permission to save", {
- fileName: "Globals.hx",
- lineNumber: 88,
- className: "Globals",
- methodName: "save"
- }), a == F.Boot.__cast(k.net.SharedObjectFlushStatus.FLUSHED, String) && y.Log.trace("value saved", {
- fileName: "Globals.hx",
- lineNumber: 91,
- className: "Globals",
- methodName: "save"
- }))
- };
- T.moreGames = function (a) {
- // Play68.goHome();
- };
- var S = function () {};
- s.HxOverrides = S;
- S.__name__ = ["HxOverrides"];
- S.dateStr = function (a) {
- var b = a.getMonth() + 1,
- d = a.getDate(),
- c = a.getHours(),
- e = a.getMinutes(),
- f = a.getSeconds();
- 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)
- };
- S.strDate = function (a) {
- switch (a.length) {
- case 8:
- a = a.split(":");
- var b = new Date;
- b.setTime(0);
- b.setUTCHours(a[0]);
- b.setUTCMinutes(a[1]);
- b.setUTCSeconds(a[2]);
- return b;
- case 10:
- return a = a.split("-"), new Date(a[0],
- a[1] - 1, a[2], 0, 0, 0);
- case 19:
- 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]);
- default:
- throw "Invalid date format : " + a;
- }
- };
- S.cca = function (a, b) {
- var d = a.charCodeAt(b);
- return d != d ? void 0 : d
- };
- S.substr = function (a, b, d) {
- if (null != b && 0 != b && null != d && 0 > d) return "";
- null == d && (d = a.length);
- 0 > b ? (b = a.length + b, 0 > b && (b = 0)) : 0 > d && (d = a.length + d - b);
- return a.substr(b, d)
- };
- S.remove = function (a, b) {
- for (var d = 0, c = a.length; d < c;) {
- if (a[d] == b) return a.splice(d, 1), !0;
- d++
- }
- return !1
- };
- S.iter =
- function (a) {
- return {
- cur: 0,
- arr: a,
- hasNext: function () {
- return this.cur < this.arr.length
- },
- next: function () {
- return this.arr[this.cur++]
- }
- }
- };
- var D = function () {};
- s.Input = D;
- D.__name__ = ["Input"];
- D.key = function (a) {
- return S.cca(a, 0)
- };
- D.init = function (a) {
- D.mouseWheelDelta = 0;
- D.mctrl = !1;
- D.mshift = !1;
- D.kctrl = !1;
- D.kshift = !1;
- D.down = [];
- D.kproc = [];
- for (var b = 0; 256 > b;) b++, D.down.push(!1), D.kproc.push(!1);
- D.hasFocus = !0;
- D.iDoc = a;
- D.iStage = a.get_stage();
- a.get_stage().addEventListener("keydown", D.keyDownHandler);
- a.get_stage().addEventListener("keyup",
- D.keyUpHandler);
- a.get_stage().addEventListener("mousemove", D.mouseMoveHandler);
- a.get_stage().addEventListener("mousedown", D.mouseDownHandler);
- a.get_stage().addEventListener("mouseup", D.mouseUpHandler);
- a.get_stage().addEventListener("mousewheel", D.mouseWheelHandler);
- a.get_stage().addEventListener("focusOut", D.focusOutHandler);
- a.get_stage().addEventListener("focusIn", D.focusInHandler)
- };
- D.reFocus = function (a) {
- D.iStage.focus != D.iStage && (D.iStage.focus = D.iStage)
- };
- D.keyDownHandler = function (a) {
- D.down[a.keyCode %
- 256] = !0;
- D.kshift = a.shiftKey;
- D.kctrl = a.ctrlKey
- };
- D.keyUpHandler = function (a) {
- a = a.keyCode;
- D.down[a % 256] = !1;
- D.kproc[a % 256] = !1
- };
- D.mouseMoveHandler = function (a) {
- D.mx = a.get_stageX() - D.mOffsetX;
- D.my = a.get_stageY() - D.mOffsetY;
- D.mx -= Z.PlatformHTML5.offsetX;
- D.my -= Z.PlatformHTML5.offsetY;
- D.mx /= R.instance.scaleX;
- D.my /= R.instance.scaleY
- };
- D.mouseWheelHandler = function (a) {
- D.mouseWheelDelta = a.get_delta()
- };
- D.mouseDownHandler = function (a) {
- D.mx = a.get_stageX() - D.mOffsetX;
- D.my = a.get_stageY() - D.mOffsetY;
- D.mx -= Z.PlatformHTML5.offsetX;
- D.my -= Z.PlatformHTML5.offsetY;
- D.mx /= R.instance.scaleX;
- D.my /= R.instance.scaleY;
- D.clicked = !0;
- var b = q.OzSprite.GetSpriteAtPoint(R.instance.doc, D.mx, D.my);
- 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);
- D.mup = !1;
- D.mctrl = a.ctrlKey;
- D.mshift = a.shiftKey
- };
- D.mouseUpHandler = function (a) {
- D.mdown = !1;
- D.mup = !0
- };
- D.touchMoveHandler = function (a) {
- D.mx = a.stageX - D.mOffsetX;
- D.my = a.stageY - D.mOffsetY;
- D.mx -= Z.PlatformHTML5.offsetX;
- D.my -= Z.PlatformHTML5.offsetY;
- D.mx /= R.instance.scaleX;
- D.my /= R.instance.scaleY
- };
- D.touchDownHandler = function (a) {
- D.mx = a.stageX - D.mOffsetX;
- D.my = a.stageY - D.mOffsetY;
- D.mx -= Z.PlatformHTML5.offsetX;
- D.my -= Z.PlatformHTML5.offsetY;
- D.mx /= R.instance.scaleX;
- D.my /= R.instance.scaleY;
- D.clicked = !0;
- var b = q.OzSprite.GetSpriteAtPoint(R.instance.doc, D.mx, D.my);
- 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);
- D.mup = !1;
- D.mctrl = a.ctrlKey;
- D.mshift = a.shiftKey
- };
- D.touchUpHandler = function (a) {
- D.mdown = !1;
- D.mup = !0
- };
- D.focusOutHandler = function (a) {
- D.hasFocus = !1;
- for (a = 0; 256 > a;) a++
- };
- D.focusInHandler = function (a) {
- D.hasFocus = !0
- };
- var la = function () {
- this.length = 0
- };
- s.List = la;
- la.__name__ = ["List"];
- la.prototype = {
- iterator: function () {
- return {
- h: this.h,
- hasNext: function () {
- return null != this.h
- },
- next: function () {
- if (null == this.h) return null;
- var a = this.h[0];
- this.h = this.h[1];
- return a
- }
- }
- },
- add: function (a) {
- a = [a];
- null == this.h ? this.h = a : this.q[1] = a;
- this.q = a;
- this.length++
- },
- __class__: la
- };
- var ca = function () {};
- s.IMap = ca;
- ca.__name__ = ["IMap"];
- var ga = function () {
- k.display.Sprite.call(this);
- var a = this.getBackgroundColor(),
- b = 0;
- 70 > 0.299 * (a >> 16 & 255) + 0.587 * (a >> 8 & 255) + 0.114 * (a & 255) && (b = 16777215);
- var a = this.getHeight() / 2 - 4.5,
- d = this.getWidth() - 60;
- this.outline = new k.display.Sprite;
- this.outline.get_graphics().lineStyle(1, b, 0.15, !0);
- this.outline.get_graphics().drawRoundRect(0, 0, d, 9, 6, 6);
- this.outline.set_x(30);
- this.outline.set_y(a);
- this.addChild(this.outline);
- this.progress = new k.display.Sprite;
- this.progress.get_graphics().beginFill(b, 0.35);
- this.progress.get_graphics().drawRect(0, 0, d - 6, 3);
- this.progress.set_x(33);
- this.progress.set_y(a + 3);
- this.progress.set_scaleX(0);
- this.addChild(this.progress)
- };
- s.NMEPreloader = ga;
- ga.__name__ = ["NMEPreloader"];
- ga.__super__ = k.display.Sprite;
- ga.prototype = I(k.display.Sprite.prototype, {
- onUpdate: function (a, b) {
- var d = a / b;
- 1 < d && 1 == d;
- this.progress.set_scaleX(d)
- },
- onLoaded: function () {
- this.dispatchEvent(new k.events.Event("complete"))
- },
- onInit: function () {},
- getWidth: function () {
- return k.Lib.get_current().get_stage().get_stageWidth()
- },
- getHeight: function () {
- return k.Lib.get_current().get_stage().get_stageHeight()
- },
- getBackgroundColor: function () {
- return 0
- },
- __class__: ga
- });
- var E = function () {};
- s.Objects = E;
- E.__name__ = ["Objects"];
- E.Register = function () {
- 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,
- 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
- ];
- q.OzSprite.RegisterTilesheet(E.BitmapName, E.MovieClips, E.Frames)
- };
- var ba = function () {};
- s.ObjectsLayouts = ba;
- ba.__name__ = ["ObjectsLayouts"];
- ba.cmcGGG = function (a) {
- var b;
- b = new q.OzSprite(E.cmcBGGGG);
- a.addChild(b);
- b.name = "bg";
- b.x = -2;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 10;
- b.scaleY = 10;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcGGGBig);
- a.addChild(b);
- b.name = "sponsor";
- b.x = 0;
- b.y = 4.05;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- ba.cmcClock = function (a) {
- var b;
- b = new q.OzSprite(E.cmcClockBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcClockArrow);
- a.addChild(b);
- b.name = "arrow";
- b.x = 0.25;
- b.y = 0.35;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- ba.cmcCredits = function (a) {
- var b;
- b = new q.OzSprite(E.cmcBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnBack);
- a.addChild(b);
- b.name = "btnBack";
- b.x = 296;
- b.y = 492.9;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcCreditsText);
- a.addChild(b);
- b.name = "";
- b.x = 113;
- b.y = 101.05;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.sponsorGGG);
- a.addChild(b);
- b.name = "sponsor";
- b.x = 229.95;
- b.y = 380.45;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- ba.cmcLevels = function (a) {
- var b;
- b = new q.OzSprite(E.cmcBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnBack);
- a.addChild(b);
- b.name = "btnBack";
- b.x = 159.95;
- b.y = 554.9;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcSelectALevel);
- a.addChild(b);
- b.name = "";
- b.x = 241.6;
- b.y = 42.85;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.sponsorGGG);
- a.addChild(b);
- b.name = "sponsor";
- b.x = 328.7;
- b.y = 558.4;
- b.rotation = 0;
- b.scaleX = 0.8950958251953125;
- b.scaleY = 0.8950958251953125;
- b.alpha = 1
- };
- ba.cmcMenu = function (a) {
- var b;
- b = new q.OzSprite(E.cmcBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.sponsorGGG);
- a.addChild(b);
- b.name = "sponsor";
- b.x = 243;
- b.y = 569.4;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcSuperHoodaTitle);
- a.addChild(b);
- b.name = "";
- b.x = 241;
- b.y = 90.4;
- b.rotation = 0;
- b.scaleX = 1.1876220703125;
- b.scaleY = 1.1876220703125;
- b.alpha =
- 1;
- b = new q.OzSprite(E.btnPlay);
- a.addChild(b);
- b.name = "btnPlay";
- b.x = 325.6;
- b.y = 382.4;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnCredits);
- a.addChild(b);
- b.name = "btnCredits";
- b.x = 325.55;
- b.y = 514.25;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnMoreGames);
- a.addChild(b);
- b.name = "btnMore";
- b.x = 335.8;
- b.y = 449.15;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- ba.cmcPaused = function (a) {
- var b;
- b = new q.OzSprite(E.cmcDialogBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 10;
- b.scaleY = 10;
- b.alpha = 1;
- b = new q.OzSprite(E.btnRestart);
- a.addChild(b);
- b.name = "btnRestart";
- b.x = 122.9;
- b.y = 17.7;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnLevels);
- a.addChild(b);
- b.name = "btnLevels";
- b.x = 0.2;
- b.y = 17.7;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcPausedText);
- a.addChild(b);
- b.name = "";
- b.x = -0.35;
- b.y = -85.15;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnIconPlay);
- a.addChild(b);
- b.name = "btnPlay";
- b.x = -127.95;
- b.y = 23.5;
- b.rotation =
- 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnMoreGames);
- a.addChild(b);
- b.name = "btnMore";
- b.x = 101.45;
- b.y = 136.95;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- ba.cmcPlay = function (a) {
- var b;
- b = new q.OzSprite(E.cmcBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcNext);
- a.addChild(b);
- b.name = "";
- b.x = 240;
- b.y = 22.05;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnPause);
- a.addChild(b);
- b.name = "btnPause";
- b.x = 443.35;
- b.y = 568.25;
- b.rotation =
- 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcInstructions);
- a.addChild(b);
- b.name = "instructions";
- b.x = 112;
- b.y = 278.45;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.sponsorGGG);
- a.addChild(b);
- b.name = "sponsor";
- b.x = 128.45;
- b.y = 572.7;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- ba.cmcYouLose = function (a) {
- var b;
- b = new q.OzSprite(E.cmcDialogBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0.05;
- b.rotation = 0;
- b.scaleX = 10;
- b.scaleY = 10;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcYouLoseText);
- a.addChild(b);
- b.name =
- "";
- b.x = 4.8;
- b.y = -111.15;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnRestart);
- a.addChild(b);
- b.name = "btnRestart";
- b.x = 66.9;
- b.y = 2.9;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnLevels);
- a.addChild(b);
- b.name = "btnLevels";
- b.x = -60.8;
- b.y = 2.9;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnMoreGames);
- a.addChild(b);
- b.name = "btnMore";
- b.x = 96.45;
- b.y = 116.95;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- ba.cmcYouWin = function (a) {
- var b;
- b = new q.OzSprite(E.cmcDialogBG);
- a.addChild(b);
- b.name = "";
- b.x = 0;
- b.y = 0;
- b.rotation = 0;
- b.scaleX = 10;
- b.scaleY = 10;
- b.alpha = 1;
- b = new q.OzSprite(E.cmcYouWinText);
- a.addChild(b);
- b.name = "";
- b.x = -2.25;
- b.y = -115.1;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnRestart);
- a.addChild(b);
- b.name = "btnRestart";
- b.x = 0.75;
- b.y = 1.95;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnLevels);
- a.addChild(b);
- b.name = "btnLevels";
- b.x = -126.95;
- b.y = 1.95;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnNext);
- a.addChild(b);
- b.name = "btnNext";
- b.x = 128.05;
- b.y = 1.95;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1;
- b = new q.OzSprite(E.btnMoreGames);
- a.addChild(b);
- b.name = "btnMore";
- b.x = 107.45;
- b.y = 125.9;
- b.rotation = 0;
- b.scaleX = 1;
- b.scaleY = 1;
- b.alpha = 1
- };
- var ja = function () {
- this._painted = !1;
- ga.call(this);
- this.set_visible(!1)
- };
- s.Preloader = ja;
- ja.__name__ = ["Preloader"];
- ja.__super__ = ga;
- ja.prototype = I(ga.prototype, {
- putBitmap: function (a) {
- y.Log.trace("adding bitmap!", {
- fileName: "Preloader.hx",
- lineNumber: 39,
- className: "Preloader",
- methodName: "putBitmap",
- customParams: [a.component.width, a.component.height]
- });
- this.set_visible(!0);
- a = new k.display.Bitmap(a);
- this.addChildAt(a, 0);
- a.set_scaleX(a.set_scaleY(this.getWidth() / a.bitmapData.component.width));
- a.addEventListener("click", T.moreGames)
- },
- onUpdate: function (a, b) {
- ga.prototype.onUpdate.call(this, a, b);
- if (!this._painted) try {
- var d = J.Assets.getBitmapData("assets/ggg.png");
- this.putBitmap(d);
- this._painted = !0
- } catch (c) {}
- },
- __class__: ja
- });
- var W = function () {};
- s.Reflect = W;
- W.__name__ = ["Reflect"];
- W.hasField = function (a,
- b) {
- return Object.prototype.hasOwnProperty.call(a, b)
- };
- W.field = function (a, b) {
- var d = null;
- try {
- d = a[b]
- } catch (c) {}
- return d
- };
- W.fields = function (a) {
- var b = [];
- if (null != a) {
- var d = Object.prototype.hasOwnProperty,
- c;
- for (c in a) "__id__" != c && "hx__closures__" != c && d.call(a, c) && b.push(c)
- }
- return b
- };
- W.isFunction = function (a) {
- return "function" == typeof a && !(a.__name__ || a.__ename__)
- };
- W.compareMethods = function (a, b) {
- return a == b ? !0 : W.isFunction(a) && W.isFunction(b) ? a.scope == b.scope && a.method == b.method && null != a.method : !1
- };
- W.deleteField =
- function (a, b) {
- if (!W.hasField(a, b)) return !1;
- delete a[b];
- return !0
- };
- W.copy = function (a) {
- for (var b = {}, d = 0, c = W.fields(a); d < c.length;) {
- var e = c[d];
- ++d;
- b[e] = W.field(a, e)
- }
- return b
- };
- var K = function () {};
- s.Std = K;
- K.__name__ = ["Std"];
- K.string = function (a) {
- return F.Boot.__string_rec(a, "")
- };
- K.parseInt = function (a) {
- var b = parseInt(a, 10);
- 0 != b || 120 != S.cca(a, 1) && 88 != S.cca(a, 1) || (b = parseInt(a));
- return isNaN(b) ? null : b
- };
- K.parseFloat = function (a) {
- return parseFloat(a)
- };
- var fa = function () {
- this.b = ""
- };
- s.StringBuf = fa;
- fa.__name__ = ["StringBuf"];
- fa.prototype = {
- addSub: function (a, b, d) {
- this.b += null == d ? S.substr(a, b, null) : S.substr(a, b, d)
- },
- __class__: fa
- };
- var $ = function () {};
- s.StringTools = $;
- $.__name__ = ["StringTools"];
- $.urlEncode = function (a) {
- return encodeURIComponent(a)
- };
- $.urlDecode = function (a) {
- return decodeURIComponent(a.split("+").join(" "))
- };
- $.htmlEscape = function (a, b) {
- a = a.split("&").join("&").split("<").join("<").split(">").join(">");
- return b ? a.split('"').join(""").split("'").join("'") : a
- };
- $.startsWith = function (a, b) {
- return a.length >=
- b.length && S.substr(a, 0, b.length) == b
- };
- $.replace = function (a, b, d) {
- return a.split(b).join(d)
- };
- $.hex = function (a, b) {
- var d = "";
- do d = "0123456789ABCDEF".charAt(a & 15) + d, a >>>= 4; while (0 < a);
- if (null != b)
- for (; d.length < b;) d = "0" + d;
- return d
- };
- var U = s.ValueType = {
- __ename__: ["ValueType"],
- __constructs__: "TNull TInt TFloat TBool TObject TFunction TClass TEnum TUnknown".split(" ")
- };
- U.TNull = ["TNull", 0];
- U.TNull.toString = N;
- U.TNull.__enum__ = U;
- U.TInt = ["TInt", 1];
- U.TInt.toString = N;
- U.TInt.__enum__ = U;
- U.TFloat = ["TFloat", 2];
- U.TFloat.toString =
- N;
- U.TFloat.__enum__ = U;
- U.TBool = ["TBool", 3];
- U.TBool.toString = N;
- U.TBool.__enum__ = U;
- U.TObject = ["TObject", 4];
- U.TObject.toString = N;
- U.TObject.__enum__ = U;
- U.TFunction = ["TFunction", 5];
- U.TFunction.toString = N;
- U.TFunction.__enum__ = U;
- U.TClass = function (a) {
- a = ["TClass", 6, a];
- a.__enum__ = U;
- a.toString = N;
- return a
- };
- U.TEnum = function (a) {
- a = ["TEnum", 7, a];
- a.__enum__ = U;
- a.toString = N;
- return a
- };
- U.TUnknown = ["TUnknown", 8];
- U.TUnknown.toString = N;
- U.TUnknown.__enum__ = U;
- var Y = function () {};
- s.Type = Y;
- Y.__name__ = ["Type"];
- Y.getClass = function (a) {
- return null ==
- a ? null : a.__class__
- };
- Y.getClassName = function (a) {
- return a.__name__.join(".")
- };
- Y.getEnumName = function (a) {
- return a.__ename__.join(".")
- };
- Y.resolveClass = function (a) {
- a = s[a];
- return null != a && a.__name__ ? a : null
- };
- Y.resolveEnum = function (a) {
- a = s[a];
- return null != a && a.__ename__ ? a : null
- };
- Y.createInstance = function (a, b) {
- switch (b.length) {
- case 0:
- return new a;
- case 1:
- return new a(b[0]);
- case 2:
- return new a(b[0], b[1]);
- case 3:
- return new a(b[0], b[1], b[2]);
- case 4:
- return new a(b[0], b[1], b[2], b[3]);
- case 5:
- return new a(b[0], b[1],
- b[2], b[3], b[4]);
- case 6:
- return new a(b[0], b[1], b[2], b[3], b[4], b[5]);
- case 7:
- return new a(b[0], b[1], b[2], b[3], b[4], b[5], b[6]);
- case 8:
- return new a(b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]);
- default:
- throw "Too many arguments";
- }
- };
- Y.createEmptyInstance = function (a) {
- function b() {}
- b.prototype = a.prototype;
- return new b
- };
- Y.createEnum = function (a, b, d) {
- var c = W.field(a, b);
- if (null == c) throw "No such constructor " + b;
- if (W.isFunction(c)) {
- if (null == d) throw "Constructor " + b + " need parameters";
- return c.apply(a, d)
- }
- if (null != d && 0 !=
- d.length) throw "Constructor " + b + " does not need parameters";
- return c
- };
- Y.getEnumConstructs = function (a) {
- return a.__constructs__.slice()
- };
- Y["typeof"] = function (a) {
- switch (typeof a) {
- case "boolean":
- return U.TBool;
- case "string":
- return U.TClass(String);
- case "number":
- return Math.ceil(a) == a % 2147483648 ? U.TInt : U.TFloat;
- case "object":
- if (null == a) return U.TNull;
- var b = a.__enum__;
- if (null != b) return U.TEnum(b);
- a = a.__class__;
- return null != a ? U.TClass(a) : U.TObject;
- case "function":
- return a.__name__ || a.__ename__ ? U.TObject :
- U.TFunction;
- case "undefined":
- return U.TNull;
- default:
- return U.TUnknown
- }
- };
- s.XmlType = {
- __ename__: ["XmlType"],
- __constructs__: []
- };
- var O = function () {};
- s.Xml = O;
- O.__name__ = ["Xml"];
- O.parse = function (a) {
- return y.xml.Parser.parse(a)
- };
- O.createElement = function (a) {
- var b = new O;
- b.nodeType = O.Element;
- b._children = [];
- b._attributes = new y.ds.StringMap;
- b.set_nodeName(a);
- return b
- };
- O.createPCData = function (a) {
- var b = new O;
- b.nodeType = O.PCData;
- b.set_nodeValue(a);
- return b
- };
- O.createCData = function (a) {
- var b = new O;
- b.nodeType = O.CData;
- b.set_nodeValue(a);
- return b
- };
- O.createComment = function (a) {
- var b = new O;
- b.nodeType = O.Comment;
- b.set_nodeValue(a);
- return b
- };
- O.createDocType = function (a) {
- var b = new O;
- b.nodeType = O.DocType;
- b.set_nodeValue(a);
- return b
- };
- O.createProcessingInstruction = function (a) {
- var b = new O;
- b.nodeType = O.ProcessingInstruction;
- b.set_nodeValue(a);
- return b
- };
- O.createDocument = function () {
- var a = new O;
- a.nodeType = O.Document;
- a._children = [];
- return a
- };
- O.prototype = {
- toString: function () {
- if (this.nodeType == O.PCData) return $.htmlEscape(this._nodeValue);
- if (this.nodeType == O.CData) return "<![CDATA[" + this._nodeValue + "]]\x3e";
- if (this.nodeType == O.Comment) return "\x3c!--" + this._nodeValue + "--\x3e";
- if (this.nodeType == O.DocType) return "<!DOCTYPE " + this._nodeValue + ">";
- if (this.nodeType == O.ProcessingInstruction) return "<?" + this._nodeValue + "?>";
- var a = new fa;
- if (this.nodeType == O.Element) {
- a.b += "<";
- a.b += K.string(this._nodeName);
- for (var b = this._attributes.keys(); b.hasNext();) {
- var d = b.next();
- a.b += " ";
- a.b += K.string(d);
- a.b += '="';
- a.b += K.string(this._attributes.get(d));
- a.b +=
- '"'
- }
- if (0 == this._children.length) return a.b += "/>", a.b;
- a.b += ">"
- }
- for (b = this.iterator(); b.hasNext();) d = b.next(), a.b += K.string(d.toString());
- this.nodeType == O.Element && (a.b += "</", a.b += K.string(this._nodeName), a.b += ">");
- return a.b
- },
- removeChild: function (a) {
- if (null == this._children) throw "bad nodetype";
- var b = S.remove(this._children, a);
- b && (a._parent = null);
- return b
- },
- addChild: function (a) {
- if (null == this._children) throw "bad nodetype";
- null != a._parent && S.remove(a._parent._children, a);
- a._parent = this;
- this._children.push(a)
- },
- firstElement: function () {
- if (null == this._children) throw "bad nodetype";
- for (var a = 0, b = this._children.length; a < b;) {
- var d = this._children[a];
- if (d.nodeType == O.Element) return d;
- a++
- }
- return null
- },
- elementsNamed: function (a) {
- if (null == this._children) throw "bad nodetype";
- return {
- cur: 0,
- x: this._children,
- hasNext: function () {
- for (var b = this.cur, d = this.x.length; b < d;) {
- var c = this.x[b];
- if (c.nodeType == O.Element && c._nodeName == a) break;
- b++
- }
- this.cur = b;
- return b < d
- },
- next: function () {
- for (var b = this.cur, d = this.x.length; b < d;) {
- var c = this.x[b];
- b++;
- if (c.nodeType == O.Element && c._nodeName == a) return this.cur = b, c
- }
- return null
- }
- }
- },
- iterator: function () {
- if (null == this._children) throw "bad nodetype";
- return {
- cur: 0,
- x: this._children,
- hasNext: function () {
- return this.cur < this.x.length
- },
- next: function () {
- return this.x[this.cur++]
- }
- }
- },
- exists: function (a) {
- if (this.nodeType != O.Element) throw "bad nodeType";
- return this._attributes.exists(a)
- },
- set: function (a, b) {
- if (this.nodeType != O.Element) throw "bad nodeType";
- this._attributes.set(a, b)
- },
- get: function (a) {
- if (this.nodeType != O.Element) throw "bad nodeType";
- return this._attributes.get(a)
- },
- set_nodeValue: function (a) {
- if (this.nodeType == O.Element || this.nodeType == O.Document) throw "bad nodeType";
- return this._nodeValue = a
- },
- set_nodeName: function (a) {
- if (this.nodeType != O.Element) throw "bad nodeType";
- return this._nodeName = a
- },
- get_nodeName: function () {
- if (this.nodeType != O.Element) throw "bad nodeType";
- return this._nodeName
- },
- __class__: O
- };
- k.Lib = function () {};
- s["flash.Lib"] = k.Lib;
- k.Lib.__name__ = ["flash", "Lib"];
- k.Lib.getTimer = function () {
- return~~ (Date.now() - k.Lib.qTimeStamp)
- };
- k.Lib.getURL = function (a, b) {
- F.Browser.window.open(a.url, b)
- };
- k.Lib.jsNode = function (a) {
- a = F.Browser.document.createElement(a);
- a.style.position = "absolute";
- return a
- };
- k.Lib.jsDiv = function () {
- return k.Lib.jsNode("div")
- };
- k.Lib.jsCanvas = function () {
- return k.Lib.jsNode("canvas")
- };
- k.Lib.jsHelper = function () {
- if (null == k.Lib.qHelper) {
- var a = k.Lib.jsDiv();
- k.Lib.get_stage().component.appendChild(a);
- a.style.visibility = "hidden";
- a.appendChild(k.Lib.qHelper = k.Lib.jsDiv())
- }
- return k.Lib.qHelper
- };
- k.Lib.get_current = function () {
- null ==
- k.Lib.qCurrent && k.Lib.get_stage().addChild(k.Lib.qCurrent = new k.display.MovieClip);
- return k.Lib.qCurrent
- };
- k.Lib.get_stage = function () {
- null == k.Lib.qStage && F.Browser.document.body.appendChild((k.Lib.qStage = new k.display.Stage).component);
- return k.Lib.qStage
- };
- k.Lib.requestAnimationFrame = function (a) {
- window.reqAnimFrame(a)
- };
- k.Lib.schedule = function (a) {
- k.Lib.schList[k.Lib.schLength++] = a
- };
- k.Lib.rgba = function (a) {
- return "rgba(" + (a >> 16 & 255) + "," + (a >> 8 & 255) + "," + (a & 255) + "," + ((a >> 24 & 255) / 255).toFixed(4) + ")"
- };
- k.Lib.rgbf =
- function (a, b) {
- return "rgba(" + (a >> 16 & 255) + "," + (a >> 8 & 255) + "," + (a & 255) + "," + b.toFixed(4) + ")"
- };
- k.display.Bitmap = function (a, b, d) {
- this.smoothing = !1;
- k.display.DisplayObject.call(this);
- this.set_bitmapData(a)
- };
- s["flash.display.Bitmap"] = k.display.Bitmap;
- k.display.Bitmap.__name__ = ["flash", "display", "Bitmap"];
- k.display.Bitmap.__interfaces__ = [k.display.IBitmapDrawable];
- k.display.Bitmap.__super__ = k.display.DisplayObject;
- k.display.Bitmap.prototype = I(k.display.DisplayObject.prototype, {
- drawToSurface: function (a, b, d,
- c, e, f, l) {
- this.bitmapData.drawToSurface(a, b, d, c, e, f, l)
- },
- get_height: function () {
- return null != this.qHeight ? this.qHeight : null != this.bitmapData ? this.bitmapData.component.height : 0
- },
- get_width: function () {
- return null != this.qWidth ? this.qWidth : null != this.bitmapData ? this.bitmapData.component.width : 0
- },
- set_smoothing: function (a) {
- var b = this.bitmapData.qContext;
- return b.imageSmoothingEnabled = b.oImageSmoothingEnabled = b.msImageSmoothingEnabled = b.webkitImageSmoothingEnabled = b.mozImageSmoothingEnabled = a
- },
- set_bitmapData: function (a) {
- null !=
- this.bitmapData && this.component.removeChild(this.bitmapData.component);
- null != a && this.component.appendChild(a.handle());
- return this.bitmapData = a
- },
- __class__: k.display.Bitmap
- });
- k.display.ImageDataLease = function () {};
- s["flash.display.ImageDataLease"] = k.display.ImageDataLease;
- k.display.ImageDataLease.__name__ = ["flash", "display", "ImageDataLease"];
- k.display.ImageDataLease.prototype = {
- clone: function () {
- var a = new k.display.ImageDataLease;
- a.seed = this.seed;
- a.time = this.time;
- return a
- },
- set: function (a, b) {
- this.seed =
- a;
- this.time = b
- },
- __class__: k.display.ImageDataLease
- };
- k.display.BitmapData = function (a, b, d, c) {
- null == d && (d = !0);
- this.qSync = 1;
- this.qTransparent = d;
- this.qTick = 0;
- this.qTime = (new Date).getTime();
- this.rect = new k.geom.Rectangle(0, 0, a, b);
- this.component = k.Lib.jsCanvas();
- this.component.width = a;
- this.component.height = b;
- this.qContext = this.component.getContext("2d");
- k.display.BitmapData.setSmoothing(this.qContext, !0);
- this.qPixel = this.qContext.createImageData(1, 1);
- null == c && (c = -1);
- d || (c |= -16777216);
- 0 != (c & -16777216) && this.fillRect(this.rect,
- c)
- };
- s["flash.display.BitmapData"] = k.display.BitmapData;
- k.display.BitmapData.__name__ = ["flash", "display", "BitmapData"];
- k.display.BitmapData.__interfaces__ = [k.display.IBitmapDrawable];
- k.display.BitmapData.setSmoothing = function (a, b) {
- a.imageSmoothingEnabled = a.oImageSmoothingEnabled = a.msImageSmoothingEnabled = a.webkitImageSmoothingEnabled = a.mozImageSmoothingEnabled = b
- };
- k.display.BitmapData.makeColor = function (a) {
- return "rgba(" + (a >> 16 & 255) + "," + (a >> 8 & 255) + "," + (a & 255) + "," + ((a >> 24 & 255) / 255).toFixed(4) + ")"
- };
- k.display.BitmapData.loadFromBytes =
- function (a, b, d) {
- var c = new k.display.BitmapData(0, 0);
- c.nmeLoadFromBytes(a, b, d);
- return c
- };
- k.display.BitmapData.nmeBase64Encode = function (a) {
- var b = "";
- for (a.position = 0; a.position < a.length;) {
- var d = 0,
- c = 0,
- e = 0,
- d = a.data.getUint8(a.position++);
- a.position < a.length && (c = a.data.getUint8(a.position++));
- a.position < a.length && (e = a.data.getUint8(a.position++));
- var f = 0,
- l = 0,
- m = 0,
- h = 0,
- f = d >> 2,
- l = (d & 3) << 4 | c >> 4,
- m = (c & 15) << 2 | e >> 6,
- h = e & 63,
- b = b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f),
- b = b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l),
- b = a.position < a.length ? b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m) : b + "=",
- b = a.position < a.length ? b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h) : b + "="
- }
- return b
- };
- k.display.BitmapData.nmeIsPNG = function (a) {
- a.position = 0;
- 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 ==
- a.data.getUint8(a.position++) && 10 == a.data.getUint8(a.position++)
- };
- k.display.BitmapData.nmeIsJPG = function (a) {
- a.position = 0;
- return 255 == a.data.getUint8(a.position++) && 216 == a.data.getUint8(a.position++)
- };
- k.display.BitmapData.loadFromBase64String = function (a, b) {
- var d = F.Browser.document.createElement("img"),
- c = new k.display.BitmapData(0, 0),
- e = c.component;
- d.addEventListener("load", function (a) {
- e.width = d.width;
- e.height = d.height;
- e.getContext("2d").drawImage(d, 0, 0);
- b(c)
- }, !1);
- d.src = "data:image/png;base64," + a
- };
- k.display.BitmapData.prototype = {
- nmeLoadFromBytes: function (a, b, d) {
- var c = this,
- e = "";
- if (k.display.BitmapData.nmeIsPNG(a)) e = "image/png";
- else if (k.display.BitmapData.nmeIsJPG(a)) e = "image/jpeg";
- else throw new k.errors.IOError("BitmapData tried to read a PNG/JPG ByteArray, but found an invalid header.");
- var f = F.Browser.document.createElement("img"),
- l = this.component;
- f.addEventListener("load", function (a) {
- l.width = f.width;
- l.height = f.height;
- a = l.getContext("2d");
- a.drawImage(f, 0, 0);
- if (null != b) {
- for (var e = a.getImageData(0, 0, f.width, f.height), h =
- 0, C = b.length; h < C;) {
- var r = h++;
- e.data[4 * r + 3] = b.data.getUint8(b.position++)
- }
- a.putImageData(e, 0, 0)
- }
- c.rect = new k.geom.Rectangle(0, 0, l.width, l.height);
- null != d && d(c)
- }, !1);
- f.src = "data:" + e + ";base64," + k.display.BitmapData.nmeBase64Encode(a)
- },
- syncData: function () {
- 1 == (this.qSync & 3) && (this.qImageData = this.qContext.getImageData(0, 0, this.component.width, this.component.height), this.qSync &= -4)
- },
- syncCanvas: function () {
- 2 == (this.qSync & 3) && (this.qContext.putImageData(this.qImageData, 0, 0), this.qSync &= -4)
- },
- nmeLoadFromFile: function (a,
- b) {
- var d = this,
- c = F.Browser.document.createElement("img");
- if (null != b) {
- var e = {
- image: c,
- texture: this.component,
- inLoader: b,
- bitmapData: this
- };
- c.addEventListener("load", function (a, b) {
- return function (d) {
- return a(b, d)
- }
- }(A(this, this.jeashOnLoad), e), !1);
- c.addEventListener("error", function (a) {
- c.complete || d.jeashOnLoad(e, a)
- }, !1)
- }
- c.src = a
- },
- jeashOnLoad: function (a, b) {
- var d = a.texture,
- c = a.image.width,
- e = a.image.height;
- d.width = c;
- d.height = e;
- d.getContext("2d").drawImage(a.image, 0, 0, c, e);
- a.bitmapData.width = c;
- a.bitmapData.height =
- e;
- a.bitmapData.rect = new k.geom.Rectangle(0, 0, c, e);
- null != a.inLoader && (d = new k.events.Event("complete"), d.set_target(a.inLoader), a.inLoader.dispatchEvent(d))
- },
- applyFilter: function (a, b, d, c) {},
- copyChannel: function (a, b, d, c, e) {
- var f = ~~a.x,
- l = ~~d.x,
- m = ~~a.y,
- h = ~~d.y;
- d = ~~b.width;
- var p = ~~b.height;
- b = a.component.width;
- var C = a.component.height,
- r = this.component.width,
- k = this.component.height,
- w, t, n = e;
- 0 > l && (d += l, l = 0);
- 0 > h && (p += h, h = 0);
- 0 > f && (d += f, f = 0);
- 0 > m && (p += m, m = 0);
- f + d > b && (d = b - f);
- m + p > C && (p = C - m);
- l + d > r && (d = r - l);
- h + p > k &&
- (p = k - h);
- if (!(0 >= d || 0 >= p))
- if (8 == c && 8 == n) {
- b = this.qContext.globalCompositeOperation;
- r = this.qContext.fillStyle;
- this.qContext.globalCompositeOperation = "darker";
- for (e = 0; 8 > e++;) this.qContext.drawImage(this.component, l, h, d, p, l, h, d, p);
- this.qContext.globalCompositeOperation = "destination-over";
- this.qContext.fillStyle = "black";
- this.qContext.fillRect(f, m, d, p);
- this.qContext.globalCompositeOperation = "destination-atop";
- this.qContext.drawImage(a.handle(), f, m, d, p, l, h, d, p);
- this.qContext.globalCompositeOperation = b;
- this.qContext.fillStyle =
- r
- } 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)) {
- h += p;
- for (w = m + p; --w >= m;)
- 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;
- this.qSync |= 6;
- C && this.unlock()
- }
- },
- colorTransform: function (a, b) {
- var d = ~~a.x,
- c = ~~a.y,
- e = ~~a.width,
- f = ~~a.height,
- l = this.component.width,
- m = this.component.height,
- h = this.qContext.globalCompositeOperation,
- p = this.qContext.globalAlpha;
- 0 > d && (e += d, d = 0);
- 0 > c && (f += c, c = 0);
- d + e > l && (e = l - d);
- c + f > m && (f = m - c);
- if (!(0 >= e || 0 >= f)) {
- 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;
- 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,
- 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;
- else {
- var C = 2 != (this.qSync & 3);
- this.lock();
- var r = this.qImageData.data,
- k = 4 * l * m,
- w, t = b.redMultiplier,
- n = b.greenMultiplier,
- q = b.blueMultiplier,
- s = b.alphaMultiplier,
- z = b.redOffset,
- x = b.greenOffset,
- B = b.blueOffset,
- v = b.alphaOffset;
- if (0 == d && 0 == c && e == l && f == m)
- 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;
- else
- for (m = c - 1, c += f; ++m < c;)
- for (k = l * m + d - 1 << 2, f = k + 4 * e;
- (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) ?
- 0 : 255 < w ? 255 : ~~w;
- this.qSync |= 6;
- C && this.unlock()
- }
- this.qContext.globalCompositeOperation = h;
- this.qContext.globalAlpha = p
- }
- },
- floodFill: function (a, b, d) {
- var c = 1 == (this.qSync & 3);
- this.lock();
- var e = [a | b << 16],
- f = 1,
- l = this.qImageData.data,
- m, h, p, C, r, k, w, t, n = [],
- q = this.component.width,
- s = this.component.height;
- t = b * this.component.width + a << 4;
- a = l[t];
- b = l[t + 1];
- m = l[t + 2];
- h = l[t + 3];
- r = d >>> 24;
- p = d >> 16 & 255;
- C = d >> 8 & 255;
- d &= 255;
- for (w = -1; ++w < s;)
- for (n.push(t = []), k = 0; k < q;) t.push(0), k += 32;
- for (; 0 < f;) t = e[--f], k = t & 65535, w = t >>> 16, 0 > k || 0 > w || k >=
- 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)));
- this.qSync |= 6;
- c && this.unlock()
- },
- getColorBoundsRect: function (a, b, d) {
- null == d && (d = !0);
- this.syncData();
- a = this.qImageData.data;
- var c = this.component.width,
- e = this.component.height,
- f = 0,
- l = 0,
- m = a.length,
- h, p, C;
- 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;
- 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)
- },
- setPixel32: function (a, b, d) {
- 0 >
- 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))
- },
- setPixel: function (a, b, d) {
- 0 > 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] = 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))
- },
- getPixel32: function (a, b) {
- if (0 > a || 0 > b || a >= this.component.width || b >= this.component.height) return 0;
- if (1 == (this.qSync &
- 3)) {
- var d = this.qContext.getImageData(a, b, 1, 1).data;
- return (this.qTransparent ? d[3] << 24 : -16777216) | d[0] << 16 | d[1] << 8 | d[2]
- }
- d = b * this.component.width + a << 2;
- 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]
- },
- getPixel: function (a, b) {
- if (0 > a || 0 > b || a >= this.component.width || b >= this.component.height) return 0;
- if (1 == (this.qSync & 3)) {
- var d = this.qContext.getImageData(a, b, 1, 1).data;
- return d[0] << 16 | d[1] << 8 | d[2]
- }
- d = b * this.component.width +
- a << 2;
- return this.qImageData.data[d] << 16 | this.qImageData.data[d + 1] << 8 | this.qImageData.data[d + 2]
- },
- unlock: function () {
- this.syncCanvas()
- },
- lock: function () {
- this.syncData()
- },
- draw: function (a, b, d, c, e, f) {
- this.syncCanvas();
- var l = 0,
- m = 0;
- null != d && (l = d.alphaMultiplier, d.alphaMultiplier = 1, m = this.qContext.globalAlpha, this.qContext.globalAlpha *= l);
- null != f && k.display.BitmapData.setSmoothing(this.qContext, f);
- a.drawToSurface(this.handle(), this.qContext, b, d, c, e, null);
- null != d && (d.alphaMultiplier = l, this.qContext.globalAlpha =
- m);
- this.qSync |= 5
- },
- copyPixels: function (a, b, d, c, e, f) {
- null == f && (f = !1);
- this.syncCanvas();
- if (null != c) throw "alphaBitmapData is not supported yet.";
- a = a.handle();
- var l, m;
- c = this.component.width;
- e = this.component.height;
- if (!(null == a || 0 >= (l = a.width) || 0 >= (m = a.height))) {
- var h = ~~d.x;
- d = ~~d.y;
- var p, C, r;
- 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);
- 0 > h && (r += h, p -= h, h = 0);
- 0 > d && (b += d, C -= d, d = 0);
- h + r > c && (r = c - h);
- d + b > e && (b = e - d);
- 0 >= r || 0 >= b || (this.qTransparent &&
- !f && this.qContext.clearRect(h, d, r, b), this.qContext.drawImage(a, p, C, r, b, h, d, r, b), this.qSync |= 5)
- }
- },
- drawToSurface: function (a, b, d, c, e, f, l) {
- b.save();
- null != l && b.imageSmoothingEnabled != l && k.display.BitmapData.setSmoothing(b, l);
- 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));
- b.drawImage(this.handle(), 0, 0);
- b.restore()
- },
- getTick: function () {
- return this.qTick
- },
- getTime: function () {
- return this.qTime
- },
- handle: function () {
- this.syncCanvas();
- 0 != (this.qSync & 4) &&
- (this.qTick++, this.qTime = (new Date).getTime(), this.qSync &= -5);
- return this.component
- },
- dispose: function () {
- this.component.width = this.component.height = 1;
- this.qImageData = null;
- this.qSync = 5
- },
- clone: function () {
- this.syncCanvas();
- var a = new k.display.BitmapData(this.component.width, this.component.height, this.qTransparent, 0);
- a.qContext.drawImage(this.component, 0, 0);
- a.qSync |= 5;
- return a
- },
- fillRect: function (a, b) {
- null == a || 0 >= a.width || 0 >= a.height || (a.equals(this.rect) && this.qTransparent && 0 == (b & -16777216) ? this.component.width =
- 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))
- },
- __class__: k.display.BitmapData
- };
- k.display.BitmapDataChannel = function () {};
- s["flash.display.BitmapDataChannel"] = k.display.BitmapDataChannel;
- k.display.BitmapDataChannel.__name__ = ["flash", "display", "BitmapDataChannel"];
- k.display.BlendMode =
- s["flash.display.BlendMode"] = {
- __ename__: ["flash", "display", "BlendMode"],
- __constructs__: "ADD ALPHA DARKEN DIFFERENCE ERASE HARDLIGHT INVERT LAYER LIGHTEN MULTIPLY NORMAL OVERLAY SCREEN SUBTRACT".split(" ")
- };
- k.display.BlendMode.ADD = ["ADD", 0];
- k.display.BlendMode.ADD.toString = N;
- k.display.BlendMode.ADD.__enum__ = k.display.BlendMode;
- k.display.BlendMode.ALPHA = ["ALPHA", 1];
- k.display.BlendMode.ALPHA.toString = N;
- k.display.BlendMode.ALPHA.__enum__ = k.display.BlendMode;
- k.display.BlendMode.DARKEN = ["DARKEN", 2];
- k.display.BlendMode.DARKEN.toString =
- N;
- k.display.BlendMode.DARKEN.__enum__ = k.display.BlendMode;
- k.display.BlendMode.DIFFERENCE = ["DIFFERENCE", 3];
- k.display.BlendMode.DIFFERENCE.toString = N;
- k.display.BlendMode.DIFFERENCE.__enum__ = k.display.BlendMode;
- k.display.BlendMode.ERASE = ["ERASE", 4];
- k.display.BlendMode.ERASE.toString = N;
- k.display.BlendMode.ERASE.__enum__ = k.display.BlendMode;
- k.display.BlendMode.HARDLIGHT = ["HARDLIGHT", 5];
- k.display.BlendMode.HARDLIGHT.toString = N;
- k.display.BlendMode.HARDLIGHT.__enum__ = k.display.BlendMode;
- k.display.BlendMode.INVERT = ["INVERT", 6];
- k.display.BlendMode.INVERT.toString = N;
- k.display.BlendMode.INVERT.__enum__ = k.display.BlendMode;
- k.display.BlendMode.LAYER = ["LAYER", 7];
- k.display.BlendMode.LAYER.toString = N;
- k.display.BlendMode.LAYER.__enum__ = k.display.BlendMode;
- k.display.BlendMode.LIGHTEN = ["LIGHTEN", 8];
- k.display.BlendMode.LIGHTEN.toString = N;
- k.display.BlendMode.LIGHTEN.__enum__ = k.display.BlendMode;
- k.display.BlendMode.MULTIPLY = ["MULTIPLY", 9];
- k.display.BlendMode.MULTIPLY.toString = N;
- k.display.BlendMode.MULTIPLY.__enum__ = k.display.BlendMode;
- k.display.BlendMode.NORMAL = ["NORMAL", 10];
- k.display.BlendMode.NORMAL.toString = N;
- k.display.BlendMode.NORMAL.__enum__ = k.display.BlendMode;
- k.display.BlendMode.OVERLAY = ["OVERLAY", 11];
- k.display.BlendMode.OVERLAY.toString = N;
- k.display.BlendMode.OVERLAY.__enum__ = k.display.BlendMode;
- k.display.BlendMode.SCREEN = ["SCREEN", 12];
- k.display.BlendMode.SCREEN.toString = N;
- k.display.BlendMode.SCREEN.__enum__ = k.display.BlendMode;
- k.display.BlendMode.SUBTRACT = ["SUBTRACT", 13];
- k.display.BlendMode.SUBTRACT.toString = N;
- k.display.BlendMode.SUBTRACT.__enum__ =
- k.display.BlendMode;
- k.display.Graphics = function () {
- this.rgPending = !1;
- this.synced = !0;
- this.component = k.Lib.jsCanvas();
- this.context = this.component.getContext("2d");
- this.context.save();
- this.bounds = new k.geom.Rectangle;
- this.resetBounds();
- this.rec = [];
- this.len = 0
- };
- s["flash.display.Graphics"] = k.display.Graphics;
- k.display.Graphics.__name__ = ["flash", "display", "Graphics"];
- k.display.Graphics.__interfaces__ = [k.display.IBitmapDrawable];
- k.display.Graphics.prototype = {
- render: function (a, b) {
- var d = 0,
- c = -1,
- e, f = this._drawMatrix,
- l = 0,
- m = null;
- null == f && (this._drawMatrix = f = new k.geom.Matrix);
- try {
- for (; ++c < this.len;) switch (e = this.rec[c]) {
- case 0:
- throw "__break__";
- case 1:
- 0 < l && (d = this._closePath(a, b, d, f, m));
- b.lineWidth = e = this.rec[++c];
- 0 < e ? (d |= 2, b.strokeStyle = this.rec[++c]) : (d &= -3, b.strokeStyle = null);
- break;
- case 2:
- case 3:
- 0 < l && (d = this._closePath(a, b, d, f, m));
- d |= 1;
- if (3 == e) {
- var m = this.rec[++c].handle(),
- h = this.rec[++c];
- 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 =
- this.rec[++c], d |= 4) : (b.fillStyle = b.createPattern(m, h ? "repeat" : "no-repeat"), d &= -5)
- } else b.fillStyle = this.rec[++c], d &= -5;
- b.beginPath();
- l = 0;
- break;
- case 9:
- 0 < l && (d = this._closePath(a, b, d, f, m), l = 0);
- break;
- case 10:
- b.moveTo(this.rec[++c], this.rec[++c]);
- l++;
- break;
- case 11:
- b.lineTo(this.rec[++c], this.rec[++c]);
- l++;
- break;
- case 12:
- b.quadraticCurveTo(this.rec[++c], this.rec[++c], this.rec[++c], this.rec[++c]);
- l++;
- break;
- case 13:
- var p = this.rec[++c],
- C = this.rec[++c],
- r = this.rec[++c],
- Q = this.rec[++c];
- b.rect(p, C, r, Q);
- l++;
- break;
- case 14:
- b.arc(this.rec[++c], this.rec[++c], this.rec[++c], 0, 2 * Math.PI, !0);
- l++;
- break;
- case 15:
- var p = this.rec[++c],
- C = this.rec[++c],
- r = this.rec[++c],
- Q = this.rec[++c],
- w = this.rec[++c],
- t = this.rec[++c];
- 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 +
- w, C), b.quadraticCurveTo(p, C, p, C + t), b.lineTo(p, C + Q - t), b.quadraticCurveTo(p, C + Q, p + w, C + Q));
- l++;
- break;
- case 16:
- var n = this.rec[++c].handle(),
- q = this.rec[++c],
- s = 0 != (q & 1),
- z = 0 != (q & 2),
- x = 0 != (q & 4),
- B = 0 != (q & 8),
- v = 0 != (q & 16),
- H = this.rec[++c] - 1,
- y, D, pa, qa, L, aa, ma, na;
- b.save();
- 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],
- 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();
- b.restore();
- break;
- default:
- throw "__break__";
- }
- } catch (ra) {
- if ("__break__" != ra) throw ra;
- }
- 0 < l && this._closePath(a, b, d, f, m)
- },
- _closePath: function (a, b, d, c, e) {
- b.closePath();
- d & 2 && b.stroke();
- 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(),
- b.restore()) : b.fill());
- return d
- },
- drawToSurface: function (a, b, d, c, e, f, l) {
- b.save();
- null != d && b.transform(d.a, d.b, d.c, d.d, d.tx, d.ty);
- this.render(a, b);
- b.restore()
- },
- rgba: function (a, b) {
- return "rgba(" + (a >> 16 & 255) + ", " + (a >> 8 & 255) + ", " + (a & 255) + ", " + b.toFixed(4) + ")"
- },
- drawCircle: function (a, b, d) {
- this.rec[this.len++] = 14;
- this.rec[this.len++] = a;
- this.rec[this.len++] = b;
- this.rec[this.len++] = d;
- this.grab(a - d, b - d, a + d, b + d)
- },
- drawRoundRect: function (a, b, d, c, e, f) {
- this.rec[this.len++] = 15;
- this.rec[this.len++] = a;
- this.rec[this.len++] =
- b;
- this.rec[this.len++] = d;
- this.rec[this.len++] = c;
- this.rec[this.len++] = e;
- this.rec[this.len++] = f;
- this.grab(a, b, a + d, b + c)
- },
- drawRect: function (a, b, d, c) {
- this.rec[this.len++] = 13;
- this.rec[this.len++] = a;
- this.rec[this.len++] = b;
- this.rec[this.len++] = d;
- this.rec[this.len++] = c;
- this.grab(a, b, a + d, b + c)
- },
- curveTo: function (a, b, d, c) {
- this.rec[this.len++] = 12;
- this.rec[this.len++] = a;
- this.rec[this.len++] = b;
- this.rec[this.len++] = d;
- this.rec[this.len++] = c;
- a = this.lineWidth;
- this.grab(d - a, c - a, d + a, c + a)
- },
- lineTo: function (a, b) {
- this.rec[this.len++] =
- 11;
- this.rec[this.len++] = a;
- this.rec[this.len++] = b;
- var d = this.lineWidth;
- this.grab(a - d, b - d, a + d, b + d)
- },
- moveTo: function (a, b) {
- this.rec[this.len++] = 10;
- this.rec[this.len++] = a;
- this.rec[this.len++] = b;
- var d = this.lineWidth;
- this.grab(a - d, b - d, a + d, b + d)
- },
- endFill: function () {
- this.rec[this.len++] = 9;
- this.invalidate()
- },
- beginBitmapFill: function (a, b, d, c) {
- this.rec[this.len++] = 3;
- this.rec[this.len++] = a;
- this.rec[this.len++] = null != d ? d : !0;
- if (this.rec[this.len++] = null != b) this.rec[this.len++] = b.a, this.rec[this.len++] = b.b, this.rec[this.len++] =
- b.c, this.rec[this.len++] = b.d, this.rec[this.len++] = b.tx, this.rec[this.len++] = b.ty
- },
- beginFill: function (a, b) {
- null == b && (b = 1);
- null == a && (a = 0);
- this.rec[this.len++] = 2;
- this.rec[this.len++] = k.Lib.rgbf(a, b)
- },
- lineStyle: function (a, b, d, c, e) {
- null == d && (d = 1);
- null == b && (b = 0);
- this.rec[this.len++] = 1;
- this.rec[this.len++] = this.lineWidth = null != a && 0 < a ? a : 0;
- 0 < a && (this.rec[this.len++] = k.Lib.rgbf(b, d))
- },
- clear: function () {
- for (var a = 0; a < this.len;) this.rec[a++] = 0;
- this.len = 0;
- this.resetBounds();
- this.invalidate()
- },
- invalidate: function () {
- this.synced &&
- (this.synced = !1, this.rgPending || null == this.displayObject || null == this.displayObject.get_stage() || (k.Lib.schedule(A(this, this.regenerate)), this.rgPending = !0))
- },
- grab: function (a, b, d, c) {
- var e;
- a < (e = this.bounds.x) && (e -= a, this.bounds.x -= e, this.bounds.width += e);
- b < (e = this.bounds.y) && (e -= b, this.bounds.y -= e, this.bounds.height += e);
- d > (e = this.bounds.get_right()) && (this.bounds.width += d - e);
- c > (e = this.bounds.get_bottom()) && (this.bounds.height += c - e);
- this.invalidate()
- },
- resetBounds: function () {
- this.bounds.setVoid();
- this.invalidate()
- },
- set_displayObject: function (a) {
- this.displayObject != a && (this.displayObject = a, this.synced || k.Lib.schedule(A(this, this.regenerate)));
- return a
- },
- regenerate: function () {
- var a = this.component,
- b = this.component.style,
- d = this.context,
- c = this.bounds,
- e = ~~ (c.x - 2),
- f = ~~ (c.y - 2),
- l = Math.ceil(c.width + 4),
- m = Math.ceil(c.height + 4);
- this.synced = !0;
- this.rgPending = !1;
- if (0 >= c.width || 0 >= c.height) a.width = a.height = 1, b.top = b.left = "0";
- else {
- if (this.compX != e || this.compY != f) b.left = e + "px", b.top = f + "px";
- l != a.width || m != a.height ? (a.width = l, a.height =
- m) : d.clearRect(0, 0, a.width, a.height);
- d.save();
- d.translate(-e, -f);
- this.render(a, d);
- d.restore()
- }
- },
- __class__: k.display.Graphics
- };
- k.display.Loader = function () {
- k.display.Sprite.call(this);
- this.contentLoaderInfo = k.display.LoaderInfo.create(this)
- };
- s["flash.display.Loader"] = k.display.Loader;
- k.display.Loader.__name__ = ["flash", "display", "Loader"];
- k.display.Loader.__super__ = k.display.Sprite;
- k.display.Loader.prototype = I(k.display.Sprite.prototype, {
- handleLoad: function (a) {
- a.set_currentTarget(this);
- this.contentLoaderInfo.removeEventListener("complete",
- A(this, this.handleLoad))
- },
- loadBytes: function (a) {
- var b = this;
- try {
- this.contentLoaderInfo.addEventListener("complete", A(this, this.handleLoad), !1), k.display.BitmapData.loadFromBytes(a, null, function (a) {
- b.content = new k.display.Bitmap(a);
- b.contentLoaderInfo.content = b.content;
- b.addChild(b.content);
- a = new k.events.Event("complete");
- a.set_currentTarget(b);
- b.contentLoaderInfo.dispatchEvent(a)
- })
- } catch (d) {
- y.Log.trace("Error " + K.string(d), {
- fileName: "Loader.hx",
- lineNumber: 96,
- className: "flash.display.Loader",
- methodName: "loadBytes"
- }),
- a = new k.events.IOErrorEvent("ioError"), a.set_currentTarget(this), this.contentLoaderInfo.dispatchEvent(a)
- }
- },
- load: function (a, b) {
- var d = "",
- c = a.url.split(".");
- 0 < c.length && (d = c[c.length - 1].toLowerCase());
- c = !0;
- this.contentLoaderInfo.url = a.url;
- var e = this.contentLoaderInfo;
- switch (d) {
- case "swf":
- d = "application/x-shockwave-flash";
- break;
- case "jpg":
- case "jpeg":
- c = !1;
- d = "image/jpeg";
- break;
- case "png":
- d = "image/png";
- break;
- case "gif":
- d = "image/gif";
- break;
- default:
- throw "Unrecognized file " + a.url;
- }
- e.contentType = d;
- this.mImage =
- new k.display.BitmapData(0, 0, c);
- try {
- 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)
- } catch (f) {
- y.Log.trace("Error " + K.string(f), {
- fileName: "Loader.hx",
- lineNumber: 60,
- className: "flash.display.Loader",
- methodName: "load"
- });
- d = new k.events.IOErrorEvent("ioError");
- d.set_currentTarget(this);
- this.contentLoaderInfo.dispatchEvent(d);
- return
- }
- null == this.mShape && (this.mShape = new k.display.Shape, this.addChild(this.mShape))
- },
- __class__: k.display.Loader
- });
- k.display.LoaderInfo = function () {
- k.events.EventDispatcher.call(this);
- this.bytesLoaded = this.bytesTotal = 0;
- this.childAllowsParent = !0;
- this.parameters = {}
- };
- s["flash.display.LoaderInfo"] = k.display.LoaderInfo;
- k.display.LoaderInfo.__name__ = ["flash", "display", "LoaderInfo"];
- k.display.LoaderInfo.create = function (a) {
- var b = new k.display.LoaderInfo;
- null != a ? b.loader = a : b.url = "";
- return b
- };
- k.display.LoaderInfo.__super__ =
- k.events.EventDispatcher;
- k.display.LoaderInfo.prototype = I(k.events.EventDispatcher.prototype, {
- __class__: k.display.LoaderInfo
- });
- k.display.MovieClip = function () {
- k.display.Sprite.call(this);
- this.enabled = !0;
- this.qIndex = this.qTotal = 0;
- this.loaderInfo = k.display.LoaderInfo.create()
- };
- s["flash.display.MovieClip"] = k.display.MovieClip;
- k.display.MovieClip.__name__ = ["flash", "display", "MovieClip"];
- k.display.MovieClip.__super__ = k.display.Sprite;
- k.display.MovieClip.prototype = I(k.display.Sprite.prototype, {
- get_totalFrames: function () {
- return this.qTotal
- },
- get_framesLoaded: function () {
- return this.qTotal
- },
- get_currentFrame: function () {
- return this.qIndex
- },
- stop: function () {},
- prevFrame: function () {},
- play: function () {},
- nextFrame: function () {},
- gotoAndStop: function (a, b) {},
- gotoAndPlay: function (a, b) {},
- __class__: k.display.MovieClip
- });
- k.display.PixelSnapping = s["flash.display.PixelSnapping"] = {
- __ename__: ["flash", "display", "PixelSnapping"],
- __constructs__: ["ALWAYS", "AUTO", "NEVER"]
- };
- k.display.PixelSnapping.ALWAYS = ["ALWAYS", 0];
- k.display.PixelSnapping.ALWAYS.toString = N;
- k.display.PixelSnapping.ALWAYS.__enum__ =
- k.display.PixelSnapping;
- k.display.PixelSnapping.AUTO = ["AUTO", 1];
- k.display.PixelSnapping.AUTO.toString = N;
- k.display.PixelSnapping.AUTO.__enum__ = k.display.PixelSnapping;
- k.display.PixelSnapping.NEVER = ["NEVER", 2];
- k.display.PixelSnapping.NEVER.toString = N;
- k.display.PixelSnapping.NEVER.__enum__ = k.display.PixelSnapping;
- k.display.Shape = function () {
- (this.graphics = new k.display.Graphics).set_displayObject(this);
- this.component = this.graphics.component;
- k.display.DisplayObject.call(this)
- };
- s["flash.display.Shape"] =
- k.display.Shape;
- k.display.Shape.__name__ = ["flash", "display", "Shape"];
- k.display.Shape.__interfaces__ = [k.display.IBitmapDrawable];
- k.display.Shape.__super__ = k.display.DisplayObject;
- k.display.Shape.prototype = I(k.display.DisplayObject.prototype, {
- set_stage: function (a) {
- var b = null == this.get_stage() && null != a;
- a = k.display.DisplayObject.prototype.set_stage.call(this, a);
- b && this.graphics.invalidate();
- return a
- },
- drawToSurface: function (a, b, d, c, e, f, l) {
- this.graphics.drawToSurface(a, b, d, c, e, f, l)
- },
- __class__: k.display.Shape
- });
- k.display.Stage = function () {
- this.isTouchScreen = !1;
- this.frameRate = 0;
- k.display.DisplayObjectContainer.call(this);
- var a = this.component.style;
- a.position = "absolute";
- //a.position = "relative";
- //a.left = ((F.Browser.window.innerWidth - R.WIDTH) / 2) + "px";
- this.component.id = "gameDiv";
- a.overflow = "hidden";
- a.width = a.height = "100%";
- this.qTimeStamp = k.Lib.getTimer();
- k.Lib.requestAnimationFrame(A(this, this.onAnimationFrame));
- this.mousePos = new k.geom.Point;
- a = F.Browser.window;
- a.addEventListener("mousemove", A(this, this.onMouseMove));
- a.addEventListener("touchstart", A(this, this.onTouch));
- a.addEventListener("touchend", A(this, this.onTouch));
- a.addEventListener("touchmove", A(this, this.onTouch))
- };
- s["flash.display.Stage"] = k.display.Stage;
- k.display.Stage.__name__ = ["flash", "display", "Stage"];
- k.display.Stage.__super__ = k.display.DisplayObjectContainer;
- k.display.Stage.prototype = I(k.display.DisplayObjectContainer.prototype, {
- onAnimationFrame: function () {
- for (var a = k.Lib.getTimer(), b = -1; ++b < k.Lib.schLength;) k.Lib.schList[b](), k.Lib.schList[b] = null;
- k.Lib.schLength = 0;
- if (0 >= this.frameRate || a - this.qTimeStamp >= 1E3 / this.frameRate) this.qTimeStamp = a, a = new k.events.Event("enterFrame"),
- this.broadcastEvent(a);
- k.Lib.requestAnimationFrame(A(this, this.onAnimationFrame))
- },
- get_stage: function () {
- return this
- },
- get_stageHeight: function () {
- return F.Browser.window.innerHeight
- },
- get_stageWidth: function () {
- return F.Browser.window.innerWidth
- },
- removeEventListener: function (a, b, d, c, e) {
- null == e && (e = !1);
- null == c && (c = 0);
- null == d && (d = !1);
- var f = this.component;
- this.component = window;
- k.display.DisplayObjectContainer.prototype.removeEventListener.call(this, a, b, d, c, e);
- this.component = f
- },
- addEventListener: function (a,
- b, d, c, e) {
- null == e && (e = !1);
- null == c && (c = 0);
- null == d && (d = !1);
- var f = this.component;
- this.component = window;
- k.display.DisplayObjectContainer.prototype.addEventListener.call(this, a, b, d, c, e);
- this.component = f
- },
- onMouseMove: function (a) {
- this.isTouchScreen || (this.mousePos.x = a.pageX, this.mousePos.y = a.pageY)
- },
- onTouch: function (a) {
- this.isTouchScreen = !0;
- 0 < a.targetTouches.length && (this.mousePos.x = a.targetTouches[0].pageX, this.mousePos.y = a.targetTouches[0].pageY);
- a.preventDefault()
- },
- __class__: k.display.Stage
- });
- k.display.StageAlign =
- s["flash.display.StageAlign"] = {
- __ename__: ["flash", "display", "StageAlign"],
- __constructs__: "TOP_RIGHT TOP_LEFT TOP RIGHT LEFT BOTTOM_RIGHT BOTTOM_LEFT BOTTOM".split(" ")
- };
- k.display.StageAlign.TOP_RIGHT = ["TOP_RIGHT", 0];
- k.display.StageAlign.TOP_RIGHT.toString = N;
- k.display.StageAlign.TOP_RIGHT.__enum__ = k.display.StageAlign;
- k.display.StageAlign.TOP_LEFT = ["TOP_LEFT", 1];
- k.display.StageAlign.TOP_LEFT.toString = N;
- k.display.StageAlign.TOP_LEFT.__enum__ = k.display.StageAlign;
- k.display.StageAlign.TOP = ["TOP", 2];
- k.display.StageAlign.TOP.toString =
- N;
- k.display.StageAlign.TOP.__enum__ = k.display.StageAlign;
- k.display.StageAlign.RIGHT = ["RIGHT", 3];
- k.display.StageAlign.RIGHT.toString = N;
- k.display.StageAlign.RIGHT.__enum__ = k.display.StageAlign;
- k.display.StageAlign.LEFT = ["LEFT", 4];
- k.display.StageAlign.LEFT.toString = N;
- k.display.StageAlign.LEFT.__enum__ = k.display.StageAlign;
- k.display.StageAlign.BOTTOM_RIGHT = ["BOTTOM_RIGHT", 5];
- k.display.StageAlign.BOTTOM_RIGHT.toString = N;
- k.display.StageAlign.BOTTOM_RIGHT.__enum__ = k.display.StageAlign;
- k.display.StageAlign.BOTTOM_LEFT = ["BOTTOM_LEFT", 6];
- k.display.StageAlign.BOTTOM_LEFT.toString = N;
- k.display.StageAlign.BOTTOM_LEFT.__enum__ = k.display.StageAlign;
- k.display.StageAlign.BOTTOM = ["BOTTOM", 7];
- k.display.StageAlign.BOTTOM.toString = N;
- k.display.StageAlign.BOTTOM.__enum__ = k.display.StageAlign;
- k.display.StageDisplayState = s["flash.display.StageDisplayState"] = {
- __ename__: ["flash", "display", "StageDisplayState"],
- __constructs__: ["FULL_SCREEN", "FULL_SCREEN_INTERACTIVE", "NORMAL"]
- };
- k.display.StageDisplayState.FULL_SCREEN = ["FULL_SCREEN",
- 0
- ];
- k.display.StageDisplayState.FULL_SCREEN.toString = N;
- k.display.StageDisplayState.FULL_SCREEN.__enum__ = k.display.StageDisplayState;
- k.display.StageDisplayState.FULL_SCREEN_INTERACTIVE = ["FULL_SCREEN_INTERACTIVE", 1];
- k.display.StageDisplayState.FULL_SCREEN_INTERACTIVE.toString = N;
- k.display.StageDisplayState.FULL_SCREEN_INTERACTIVE.__enum__ = k.display.StageDisplayState;
- k.display.StageDisplayState.NORMAL = ["NORMAL", 2];
- k.display.StageDisplayState.NORMAL.toString = N;
- k.display.StageDisplayState.NORMAL.__enum__ =
- k.display.StageDisplayState;
- k.display.StageScaleMode = s["flash.display.StageScaleMode"] = {
- __ename__: ["flash", "display", "StageScaleMode"],
- __constructs__: ["SHOW_ALL", "NO_SCALE", "NO_BORDER", "EXACT_FIT"]
- };
- k.display.StageScaleMode.SHOW_ALL = ["SHOW_ALL", 0];
- k.display.StageScaleMode.SHOW_ALL.toString = N;
- k.display.StageScaleMode.SHOW_ALL.__enum__ = k.display.StageScaleMode;
- k.display.StageScaleMode.NO_SCALE = ["NO_SCALE", 1];
- k.display.StageScaleMode.NO_SCALE.toString = N;
- k.display.StageScaleMode.NO_SCALE.__enum__ = k.display.StageScaleMode;
- k.display.StageScaleMode.NO_BORDER = ["NO_BORDER", 2];
- k.display.StageScaleMode.NO_BORDER.toString = N;
- k.display.StageScaleMode.NO_BORDER.__enum__ = k.display.StageScaleMode;
- k.display.StageScaleMode.EXACT_FIT = ["EXACT_FIT", 3];
- k.display.StageScaleMode.EXACT_FIT.toString = N;
- k.display.StageScaleMode.EXACT_FIT.__enum__ = k.display.StageScaleMode;
- k.errors = {};
- k.errors.Error = function (a, b) {
- null == b && (b = 0);
- null == a && (a = "");
- this.message = a;
- this.errorID = b
- };
- s["flash.errors.Error"] = k.errors.Error;
- k.errors.Error.__name__ = ["flash",
- "errors", "Error"
- ];
- k.errors.Error.prototype = {
- toString: function () {
- return null != this.message ? this.message : "Error"
- },
- getStackTrace: function () {
- return y.CallStack.toString(y.CallStack.exceptionStack())
- },
- __class__: k.errors.Error
- };
- k.errors.IOError = function (a) {
- null == a && (a = "");
- k.errors.Error.call(this, a)
- };
- s["flash.errors.IOError"] = k.errors.IOError;
- k.errors.IOError.__name__ = ["flash", "errors", "IOError"];
- k.errors.IOError.__super__ = k.errors.Error;
- k.errors.IOError.prototype = I(k.errors.Error.prototype, {
- __class__: k.errors.IOError
- });
- k.events.Event = function (a, b, d) {
- null == d && (d = !1);
- null == b && (b = !1);
- this.type = a;
- this.bubbles = b;
- this.cancelable = d
- };
- s["flash.events.Event"] = k.events.Event;
- k.events.Event.__name__ = ["flash", "events", "Event"];
- k.events.Event.prototype = {
- clone: function () {
- return new k.events.Event(this.type, this.bubbles, this.cancelable)
- },
- isDefaultPrevented: function () {
- return this.defaultPrevented
- },
- set_currentTarget: function (a) {
- return this._current = a
- },
- get_currentTarget: function () {
- return this._current || this.currentTarget
- },
- set_target: function (a) {
- return this._target =
- a
- },
- get_target: function () {
- return this._target || this.target
- },
- __class__: k.events.Event
- };
- k.events.TextEvent = function (a, b, d, c) {
- null == c && (c = "");
- null == d && (d = !1);
- null == b && (b = !1);
- k.events.Event.call(this, a, b, d);
- this.text = c
- };
- s["flash.events.TextEvent"] = k.events.TextEvent;
- k.events.TextEvent.__name__ = ["flash", "events", "TextEvent"];
- k.events.TextEvent.__super__ = k.events.Event;
- k.events.TextEvent.prototype = I(k.events.Event.prototype, {
- __class__: k.events.TextEvent
- });
- k.events.ErrorEvent = function (a, b, d, c) {
- k.events.TextEvent.call(this,
- a, b, d);
- this.text = c
- };
- s["flash.events.ErrorEvent"] = k.events.ErrorEvent;
- k.events.ErrorEvent.__name__ = ["flash", "events", "ErrorEvent"];
- k.events.ErrorEvent.__super__ = k.events.TextEvent;
- k.events.ErrorEvent.prototype = I(k.events.TextEvent.prototype, {
- __class__: k.events.ErrorEvent
- });
- k.events.FocusEvent = function (a, b, d, c, e, f) {
- null == f && (f = 0);
- null == e && (e = !1);
- null == d && (d = !1);
- null == b && (b = !1);
- k.events.Event.call(this, a, b, d);
- this.keyCode = f;
- this.shiftKey = !0 == e;
- this.set_target(c)
- };
- s["flash.events.FocusEvent"] = k.events.FocusEvent;
- k.events.FocusEvent.__name__ = ["flash", "events", "FocusEvent"];
- k.events.FocusEvent.__super__ = k.events.Event;
- k.events.FocusEvent.prototype = I(k.events.Event.prototype, {
- __class__: k.events.FocusEvent
- });
- k.events.HTTPStatusEvent = function (a, b, d, c) {
- null == c && (c = 0);
- null == d && (d = !1);
- null == b && (b = !1);
- this.status = c;
- k.events.Event.call(this, a, b, d)
- };
- s["flash.events.HTTPStatusEvent"] = k.events.HTTPStatusEvent;
- k.events.HTTPStatusEvent.__name__ = ["flash", "events", "HTTPStatusEvent"];
- k.events.HTTPStatusEvent.__super__ = k.events.Event;
- k.events.HTTPStatusEvent.prototype = I(k.events.Event.prototype, {
- __class__: k.events.HTTPStatusEvent
- });
- k.events.IOErrorEvent = function (a, b, d, c) {
- null == c && (c = "");
- null == d && (d = !1);
- null == b && (b = !1);
- k.events.Event.call(this, a, b, d);
- this.text = c
- };
- s["flash.events.IOErrorEvent"] = k.events.IOErrorEvent;
- k.events.IOErrorEvent.__name__ = ["flash", "events", "IOErrorEvent"];
- k.events.IOErrorEvent.__super__ = k.events.Event;
- k.events.IOErrorEvent.prototype = I(k.events.Event.prototype, {
- __class__: k.events.IOErrorEvent
- });
- k.events.KeyboardEvent =
- function (a, b, d, c, e) {
- null == e && (e = 0);
- null == c && (c = 0);
- null == d && (d = !1);
- null == b && (b = !0);
- k.events.Event.call(this, a, b, d);
- this.keyCode = e;
- this.charCode = c
- };
- s["flash.events.KeyboardEvent"] = k.events.KeyboardEvent;
- k.events.KeyboardEvent.__name__ = ["flash", "events", "KeyboardEvent"];
- k.events.KeyboardEvent.__super__ = k.events.Event;
- k.events.KeyboardEvent.prototype = I(k.events.Event.prototype, {
- __class__: k.events.KeyboardEvent
- });
- k.events.MouseEvent = function (a, b, d, c, e, f, l, m, h, p, C) {
- null == C && (C = 0);
- null == p && (p = !1);
- null ==
- h && (h = !1);
- null == m && (m = !1);
- null == l && (l = !1);
- null == d && (d = !1);
- null == b && (b = !0);
- k.events.Event.call(this, a, b, d);
- this.ctrlKey = l;
- this.altKey = m;
- this.shiftKey = h;
- this.relatedObject = f;
- this.button = p ? 0 : 1;
- this.wheelDelta = C
- };
- s["flash.events.MouseEvent"] = k.events.MouseEvent;
- k.events.MouseEvent.__name__ = ["flash", "events", "MouseEvent"];
- k.events.MouseEvent.__super__ = k.events.Event;
- k.events.MouseEvent.prototype = I(k.events.Event.prototype, {
- updateAfterEvent: function () {},
- get_localY: function () {
- return this.get_localPoint().y
- },
- get_localX: function () {
- return this.get_localPoint().x
- },
- get_localPoint: function () {
- var a = k.events.MouseEvent.convPoint;
- null == a && (k.events.MouseEvent.convPoint = a = new k.geom.Point);
- a.x = this.pageX;
- a.y = this.pageY;
- return null != this.relatedObject ? this.relatedObject.globalToLocal(a, a) : a
- },
- get_stageY: function () {
- return this.pageY
- },
- get_stageX: function () {
- return this.pageX
- },
- get_delta: function () {
- return this.wheelDelta
- },
- get_buttonDown: function () {
- return 0 == this.button
- },
- __class__: k.events.MouseEvent
- });
- k.events.ProgressEvent =
- function (a, b, d, c, e) {
- null == e && (e = 0);
- null == c && (c = 0);
- null == d && (d = !1);
- null == b && (b = !1);
- k.events.Event.call(this, a, b, d);
- this.bytesLoaded = c;
- this.bytesTotal = e
- };
- s["flash.events.ProgressEvent"] = k.events.ProgressEvent;
- k.events.ProgressEvent.__name__ = ["flash", "events", "ProgressEvent"];
- k.events.ProgressEvent.__super__ = k.events.Event;
- k.events.ProgressEvent.prototype = I(k.events.Event.prototype, {
- __class__: k.events.ProgressEvent
- });
- k.events.SecurityErrorEvent = function (a, b, d, c) {
- null == c && (c = "");
- null == d && (d = !1);
- null ==
- b && (b = !1);
- k.events.ErrorEvent.call(this, a, b, d);
- this.text = c
- };
- s["flash.events.SecurityErrorEvent"] = k.events.SecurityErrorEvent;
- k.events.SecurityErrorEvent.__name__ = ["flash", "events", "SecurityErrorEvent"];
- k.events.SecurityErrorEvent.__super__ = k.events.ErrorEvent;
- k.events.SecurityErrorEvent.prototype = I(k.events.ErrorEvent.prototype, {
- __class__: k.events.SecurityErrorEvent
- });
- k.events.TouchEvent = function (a, b, d, c, e, f, l, m, h, p, C, r, Q, w) {
- null == w && (w = !1);
- null == Q && (Q = !1);
- null == r && (r = !1);
- null == d && (d = !1);
- null == b &&
- (b = !0);
- k.events.Event.call(this, a, b, d);
- this.altKey = Q;
- this.shiftKey = w;
- this.ctrlKey = r
- };
- s["flash.events.TouchEvent"] = k.events.TouchEvent;
- k.events.TouchEvent.__name__ = ["flash", "events", "TouchEvent"];
- k.events.TouchEvent.__super__ = k.events.Event;
- k.events.TouchEvent.prototype = I(k.events.Event.prototype, {
- __class__: k.events.TouchEvent
- });
- k.filters = {};
- k.filters.BitmapFilter = function (a) {
- this._mType = a
- };
- s["flash.filters.BitmapFilter"] = k.filters.BitmapFilter;
- k.filters.BitmapFilter.__name__ = ["flash", "filters", "BitmapFilter"];
- k.filters.BitmapFilter.prototype = {
- nmeApplyFilter: function (a, b, d) {},
- nmePreFilter: function (a) {},
- clone: function () {
- throw "Implement in subclass. BitmapFilter::clone";
- },
- __class__: k.filters.BitmapFilter
- };
- k.geom = {};
- k.geom.ColorTransform = function (a, b, d, c, e, f, l, m) {
- null == m && (m = 0);
- null == l && (l = 0);
- null == f && (f = 0);
- null == e && (e = 0);
- null == c && (c = 1);
- null == d && (d = 1);
- null == b && (b = 1);
- null == a && (a = 1);
- this.redMultiplier = a;
- this.greenMultiplier = b;
- this.blueMultiplier = d;
- this.alphaMultiplier = c;
- this.redOffset = e;
- this.greenOffset = f;
- this.blueOffset =
- l;
- this.alphaOffset = m
- };
- s["flash.geom.ColorTransform"] = k.geom.ColorTransform;
- k.geom.ColorTransform.__name__ = ["flash", "geom", "ColorTransform"];
- k.geom.ColorTransform.prototype = {
- set_color: function (a) {
- this.redOffset = a >> 16 & 255;
- this.greenOffset = a >> 8 & 255;
- this.blueOffset = a & 255;
- this.redMultiplier = this.greenMultiplier = this.blueMultiplier = 0;
- return this.get_color()
- },
- get_color: function () {
- return (this.redOffset | 0) << 16 | (this.greenOffset | 0) << 8 | this.blueOffset | 0
- },
- isAlphaMultiplier: function () {
- return 1 == this.redMultiplier &&
- 1 == this.greenMultiplier && 1 == this.blueMultiplier && 0 == this.redOffset && 0 == this.greenOffset && 0 == this.blueOffset && 0 == this.alphaOffset
- },
- isColorSetter: function () {
- return 0 == this.redMultiplier && 0 == this.greenMultiplier && 0 == this.blueMultiplier && (0 == this.alphaMultiplier || 0 == this.alphaOffset)
- },
- concat: function (a) {
- this.redMultiplier += a.redMultiplier;
- this.greenMultiplier += a.greenMultiplier;
- this.blueMultiplier += a.blueMultiplier;
- this.alphaMultiplier += a.alphaMultiplier
- },
- __class__: k.geom.ColorTransform
- };
- k.geom.Matrix =
- function (a, b, d, c, e, f) {
- this.a = null == a ? 1 : a;
- this.b = null == b ? 0 : b;
- this.c = null == d ? 0 : d;
- this.d = null == c ? 1 : c;
- this.tx = null == e ? 0 : e;
- this.ty = null == f ? 0 : f
- };
- s["flash.geom.Matrix"] = k.geom.Matrix;
- k.geom.Matrix.__name__ = ["flash", "geom", "Matrix"];
- k.geom.Matrix.prototype = {
- to3dString: function () {
- return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)"
- },
- toString: function () {
- return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")"
- },
- transformPoint: function (a) {
- 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)
- },
- concat: function (a) {
- var b;
- b = this.a * a.a + this.b * a.c;
- this.b = this.a * a.b + this.b * a.d;
- this.a = b;
- b = this.c * a.a + this.d * a.c;
- this.d = this.c * a.b + this.d * a.d;
- this.c = b;
- b = this.tx * a.a + this.ty * a.c + a.tx;
- this.ty = this.tx * a.b + this.ty * a.d + a.ty;
- this.tx = b
- },
- scale: function (a, b) {
- this.a *= a;
- this.b *= b;
- this.c *= a;
- this.d *= b;
- this.tx *= a;
- this.ty *= b
- },
- rotate: function (a) {
- var b = Math.cos(a);
- a = Math.sin(a);
- var d;
- d = this.a * b - this.b * a;
- this.b = this.a * a + this.b * b;
- this.a = d;
- d = this.c * b - this.d * a;
- this.d = this.c * a + this.d * b;
- this.c = d;
- d = this.tx * b - this.ty * a;
- this.ty = this.tx * a + this.ty * b;
- this.tx = d
- },
- translate: function (a, b) {
- this.tx += a;
- this.ty += b
- },
- invert: function () {
- var a, b = this.a * this.d - this.b * this.c;
- 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)
- },
- copy: function (a) {
- this.a = a.a;
- this.b =
- a.b;
- this.c = a.c;
- this.d = a.d;
- this.tx = a.tx;
- this.ty = a.ty
- },
- isIdentity: function () {
- return 1 == this.a && 1 == this.d && 0 == this.tx && 0 == this.ty && 0 == this.b && 0 == this.c
- },
- identity: function () {
- this.a = this.d = 1;
- this.b = this.c = this.tx = this.ty = 0
- },
- clone: function () {
- return new k.geom.Matrix(this.a, this.b, this.c, this.d, this.tx, this.ty)
- },
- __class__: k.geom.Matrix
- };
- k.geom.Point = function (a, b) {
- this.x = null == a ? 0 : a;
- this.y = null == b ? 0 : b
- };
- s["flash.geom.Point"] = k.geom.Point;
- k.geom.Point.__name__ = ["flash", "geom", "Point"];
- k.geom.Point.interpolate =
- function (a, b, d) {
- return new k.geom.Point(a.x + d * (b.x - a.x), a.y + d * (b.y - a.y))
- };
- k.geom.Point.polar = function (a, b) {
- return new k.geom.Point(Math.cos(b) * a, Math.sin(b) * a)
- };
- k.geom.Point.prototype = {
- subtract: function (a) {
- return new k.geom.Point(this.x - a.x, this.y - a.y)
- },
- add: function (a) {
- return new k.geom.Point(this.x + a.x, this.y + a.y)
- },
- offset: function (a, b) {
- this.x += a;
- this.y += b
- },
- normalize: function (a) {
- 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 *=
- a)
- },
- toString: function () {
- return "point(" + this.x + ", " + this.y + ")"
- },
- get_length: function () {
- return Math.sqrt(this.x * this.x + this.y * this.y)
- },
- equals: function (a) {
- return this.x == a.x && this.y == a.y
- },
- clone: function () {
- return new k.geom.Point(this.x, this.y)
- },
- __class__: k.geom.Point
- };
- k.geom.Rectangle = function (a, b, d, c) {
- null == c && (c = 0);
- null == d && (d = 0);
- null == b && (b = 0);
- null == a && (a = 0);
- this.x = a;
- this.y = b;
- this.width = d;
- this.height = c
- };
- s["flash.geom.Rectangle"] = k.geom.Rectangle;
- k.geom.Rectangle.__name__ = ["flash", "geom", "Rectangle"];
- k.geom.Rectangle.prototype = {
- toString: function () {
- return "Rectangle(" + this.x + ", " + this.y + ", " + this.width + ", " + this.height + ")"
- },
- transform: function (a) {
- var b, d, c, e, f;
- e = d = a.a * this.x + a.c * this.y;
- f = c = a.b * this.x + a.d * this.y;
- b = a.a * (this.x + this.width) + a.c * this.y;
- b < d && (d = b);
- b > e && (e = b);
- b = a.b * (this.x + this.width) + a.d * this.y;
- b < c && (c = b);
- b > f && (f = b);
- b = a.a * this.x + a.c * (this.y + this.height);
- b < d && (d = b);
- b > e && (e = b);
- b = a.b * this.x + a.d * (this.y + this.height);
- b < c && (c = b);
- b > f && (f = b);
- b = a.a * (this.x + this.width) + a.c * (this.y + this.height);
- b < d && (d = b);
- b > e && (e = b);
- b = a.b * (this.x + this.width) + a.d * (this.y + this.height);
- b < c && (c = b);
- b > f && (f = b);
- this.x = d + a.tx;
- this.width = e - d;
- this.y = c + a.ty;
- this.height = f - c
- },
- offsetPoint: function (a) {
- this.x += a.x;
- this.y += a.y
- },
- offset: function (a, b) {
- this.x += a;
- this.y += b
- },
- inflatePoint: function (a) {
- this.inflate(a.x, a.y)
- },
- inflate: function (a, b) {
- this.x -= a;
- this.y -= b;
- this.width += 2 * a;
- this.height += 2 * b
- },
- union: function (a) {
- var b, d, c, e;
- 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) ?
- b : c, (d += this.height) > (e += a.height) ? d : e)
- },
- join: function (a) {
- var b;
- 0 > (b = a.x - this.x) && (this.x += b, this.width -= b);
- 0 > (b = a.y - this.y) && (this.y += b, this.height -= b);
- 0 < (b = a.x + a.width - (this.x + this.width)) && (this.width += b);
- 0 < (b = a.y + a.height - (this.y + this.height)) && (this.height += b)
- },
- intersects: function (a) {
- var b, d, c, e;
- 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)
- },
- intersection: function (a) {
- var b, d,
- c, e, f, l;
- 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
- },
- containsRect: function (a) {
- 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
- },
- containsPoint: function (a) {
- return this.contains(a.x, a.y)
- },
- contains: function (a,
- b) {
- return 0 <= (a -= this.x) && 0 <= (b -= this.y) && a < this.width && b < this.height
- },
- set_bottomRight: function (a) {
- this.width = a.x - this.x;
- this.height = a.y - this.y;
- return a.clone()
- },
- get_bottomRight: function () {
- return new k.geom.Point(this.x + this.width, this.y + this.height)
- },
- set_topLeft: function (a) {
- this.width = a.x;
- this.height = a.y;
- return a.clone()
- },
- get_topLeft: function () {
- return new k.geom.Point(this.x, this.y)
- },
- set_size: function (a) {
- this.width = a.x;
- this.height = a.y;
- return a.clone()
- },
- get_size: function () {
- return new k.geom.Point(this.width,
- this.height)
- },
- set_bottom: function (a) {
- this.height = a - this.y;
- return a
- },
- get_bottom: function () {
- return this.y + this.height
- },
- set_right: function (a) {
- this.width = a - this.x;
- return a
- },
- get_right: function () {
- return this.x + this.width
- },
- set_top: function (a) {
- this.height -= a - this.y;
- return this.y = a
- },
- get_top: function () {
- return this.y
- },
- set_left: function (a) {
- this.width -= a - this.x;
- return this.x = a
- },
- get_left: function () {
- return this.x
- },
- setVoid: function () {
- this.width -= 2147483647 - this.x;
- this.x = 2147483647;
- this.width = -2147483648 - this.x; - 2147483648;
- this.height -= 2147483647 - this.y;
- this.y = 2147483647;
- this.height = -2147483648 - this.y; - 2147483648
- },
- setTo: function (a, b, d, c) {
- this.x = a;
- this.y = b;
- this.width = d;
- this.height = c
- },
- copyFrom: function (a) {
- this.x = a.x;
- this.y = a.y;
- this.width = a.width;
- this.height = a.height
- },
- setEmpty: function () {
- this.x = this.y = this.width = this.height = 0
- },
- isEmpty: function () {
- return 0 >= this.width || 0 >= this.height
- },
- equals: function (a) {
- return this.x == a.x && this.y == a.y && this.width == a.width && this.height == a.height
- },
- clone: function () {
- return new k.geom.Rectangle(this.x,
- this.y, this.width, this.height)
- },
- __class__: k.geom.Rectangle
- };
- k.geom.Transform = function (a) {
- if (null == a) throw "Cannot create Transform with no DisplayObject.";
- this._displayObject = a;
- this._matrix = new k.geom.Matrix;
- this._fullMatrix = new k.geom.Matrix;
- this.set_colorTransform(new k.geom.ColorTransform)
- };
- s["flash.geom.Transform"] = k.geom.Transform;
- k.geom.Transform.__name__ = ["flash", "geom", "Transform"];
- k.geom.Transform.prototype = {
- get_pixelBounds: function () {
- return this._displayObject.getBounds(null)
- },
- set_matrix: function (a) {
- this._matrix.copy(a);
- this._displayObject.syncMtx();
- return this._matrix
- },
- get_matrix: function () {
- return this._matrix.clone()
- },
- get_concatenatedMatrix: function () {
- return this.nmeGetFullMatrix(this._matrix)
- },
- set_colorTransform: function (a) {
- return this.colorTransform = a
- },
- nmeSetMatrix: function (a) {
- this._matrix.copy(a)
- },
- nmeSetFullMatrix: function (a) {
- this._fullMatrix.copy(a);
- return this._fullMatrix
- },
- nmeGetFullMatrix: function (a) {
- var b;
- 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();
- return b
- },
- __class__: k.geom.Transform
- };
- k.media = {};
- k.media.Sound = function (a, b) {
- k.events.EventDispatcher.call(this);
- null != a && this.load(a, b)
- };
- s["flash.media.Sound"] = k.media.Sound;
- k.media.Sound.__name__ = ["flash", "media", "Sound"];
- k.media.Sound.canPlayType = function (a) {
- var b;
- a = a.toLowerCase();
- if (null != k.media.Sound.canPlayMap) {
- if (k.media.Sound.canPlayMap.exists(a)) return k.media.Sound.canPlayMap.get(a)
- } else k.media.Sound.canPlayMap = new y.ds.StringMap;
- b = k.media.Sound.getFormatType(a);
- b = "no" != (new Audio).canPlayType(b);
- k.media.Sound.canPlayMap.set(a, b);
- return b
- };
- k.media.Sound.getFormatType = function (a) {
- return "mp3" == a ? "audio/mpeg;" : "ogg" == a ? 'audio/ogg; codecs="vorbis"' : null
- };
- k.media.Sound.__super__ = k.events.EventDispatcher;
- k.media.Sound.prototype = I(k.events.EventDispatcher.prototype, {
- get_length: function () {
- return null != this.component ? 1E3 * this.component.duration : 0
- },
- play: function (a, b, d) {
- null == b && (b = 0);
- null == a && (a = 0);
- var c;
- if (0 == this.qCache.length)(c = new k.media.SoundChannel).init(this, this.component, b), this.component =
- this.component.cloneNode(!0);
- else {
- c = this.qCache[0];
- b = 0;
- for (var e = this.qCache; b < e.length;) {
- var f = e[b];
- ++b;
- if (f.get_position() == a) {
- c = f;
- break
- }
- }
- S.remove(this.qCache, c)
- }
- c.set_soundTransform(d);
- try {
- c.play(a)
- } catch (l) {
- var m = null,
- m = function (b) {
- c.component.removeEventListener("canplaythrough", m);
- c.play(a)
- };
- c.addEventListener("canplaythrough", m)
- }
- return c
- },
- load: function (a, b) {
- var d = a.url;
- k.media.Sound.library.exists(d) ? (this.component = k.media.Sound.library.get(d), k.media.Sound.library.set(d, this.component.cloneNode(!0))) :
- this.component = new Audio(d);
- this.qCache = []
- },
- close: function () {
- if (null != this.component) this.component = null;
- else throw new k.errors.IOError("Attempt to close unexisting stream.");
- },
- __class__: k.media.Sound
- });
- k.media.SoundChannel = function () {
- this._loops = 1;
- this._position = 0;
- this.active = !1;
- this.leftPeak = this.rightPeak = 1;
- k.events.EventDispatcher.call(this)
- };
- s["flash.media.SoundChannel"] = k.media.SoundChannel;
- k.media.SoundChannel.__name__ = ["flash", "media", "SoundChannel"];
- k.media.SoundChannel.__super__ = k.events.EventDispatcher;
- k.media.SoundChannel.prototype = I(k.events.EventDispatcher.prototype, {
- onEnded: function (a) {
- this.active && (this._loops--, 0 < this._loops ? this.component.play() : (this.stop(), this.component.currentTime = 0, this.dispatchEvent(new k.events.Event("soundComplete"))))
- },
- set_position: function (a) {
- var b = !this.component.paused;
- b && this.component.pause();
- this.component.currentTime = a / 1E3;
- b && this.component.play();
- return a
- },
- get_position: function () {
- return 1E3 * this.component.currentTime
- },
- set_soundTransform: function (a) {
- this.soundTransform =
- a;
- this.component.volume = null != a ? a.volume : 1;
- return a
- },
- stop: function () {
- this.active && (this.active = !1, this.component.pause(), this.qSound.qCache.push(this))
- },
- play: function (a) {
- this.active || (this.component.play(), this.set_position(a), this.active = !0)
- },
- init: function (a, b, d) {
- null == d && (d = 1);
- this.qSound = a;
- this.component = b;
- this._loops = d;
- this.component.addEventListener("ended", A(this, this.onEnded))
- },
- __class__: k.media.SoundChannel
- });
- k.media.SoundLoaderContext = function (a, b) {
- null == b && (b = !1);
- null == a && (a = 0);
- this.bufferTime =
- a;
- this.checkPolicyFile = b
- };
- s["flash.media.SoundLoaderContext"] = k.media.SoundLoaderContext;
- k.media.SoundLoaderContext.__name__ = ["flash", "media", "SoundLoaderContext"];
- k.media.SoundLoaderContext.prototype = {
- __class__: k.media.SoundLoaderContext
- };
- k.media.SoundTransform = function (a, b) {
- null == b && (b = 0);
- null == a && (a = 1);
- this.volume = a;
- this.pan = b
- };
- s["flash.media.SoundTransform"] = k.media.SoundTransform;
- k.media.SoundTransform.__name__ = ["flash", "media", "SoundTransform"];
- k.media.SoundTransform.prototype = {
- __class__: k.media.SoundTransform
- };
- k.net = {};
- k.net.SharedObject = function () {
- k.events.EventDispatcher.call(this)
- };
- s["flash.net.SharedObject"] = k.net.SharedObject;
- k.net.SharedObject.__name__ = ["flash", "net", "SharedObject"];
- k.net.SharedObject.getLocal = function (a, b, d) {
- null == b && (b = F.Browser.window.location.href);
- d = new k.net.SharedObject;
- d.nmeKey = b + ":" + a;
- a = null;
- try {
- a = k.net.SharedObject.nmeGetLocalStorage().getItem(d.nmeKey)
- } catch (c) {}
- d.data = {};
- null != a && "" != a && (a = new y.Unserializer(a), a.setResolver({
- resolveEnum: Y.resolveEnum,
- resolveClass: k.net.SharedObject.resolveClass
- }),
- d.data = a.unserialize());
- null == d.data && (d.data = {});
- return d
- };
- k.net.SharedObject.nmeGetLocalStorage = function () {
- var a = F.Browser.getLocalStorage();
- if (null == a) throw new k.errors.Error("SharedObject not supported");
- return a
- };
- k.net.SharedObject.resolveClass = function (a) {
- return null != a ? Y.resolveClass($.replace($.replace(a, "jeash.", "flash."), "browser.", "flash.")) : null
- };
- k.net.SharedObject.__super__ = k.events.EventDispatcher;
- k.net.SharedObject.prototype = I(k.events.EventDispatcher.prototype, {
- get_size: function () {
- return y.io.Bytes.ofString(y.Serializer.run(this.data)).length
- },
- setProperty: function (a, b) {
- null != this.data && (this.data[a] = b)
- },
- flush: function () {
- var a = y.Serializer.run(this.data);
- try {
- k.net.SharedObject.nmeGetLocalStorage().removeItem(this.nmeKey), k.net.SharedObject.nmeGetLocalStorage().setItem(this.nmeKey, a)
- } catch (b) {
- return k.net.SharedObjectFlushStatus.PENDING
- }
- return k.net.SharedObjectFlushStatus.FLUSHED
- },
- clear: function () {
- this.data = {};
- try {
- k.net.SharedObject.nmeGetLocalStorage().removeItem(this.nmeKey)
- } catch (a) {}
- this.flush()
- },
- __class__: k.net.SharedObject
- });
- k.net.SharedObjectFlushStatus =
- s["flash.net.SharedObjectFlushStatus"] = {
- __ename__: ["flash", "net", "SharedObjectFlushStatus"],
- __constructs__: ["FLUSHED", "PENDING"]
- };
- k.net.SharedObjectFlushStatus.FLUSHED = ["FLUSHED", 0];
- k.net.SharedObjectFlushStatus.FLUSHED.toString = N;
- k.net.SharedObjectFlushStatus.FLUSHED.__enum__ = k.net.SharedObjectFlushStatus;
- k.net.SharedObjectFlushStatus.PENDING = ["PENDING", 1];
- k.net.SharedObjectFlushStatus.PENDING.toString = N;
- k.net.SharedObjectFlushStatus.PENDING.__enum__ = k.net.SharedObjectFlushStatus;
- k.net.URLLoader =
- function (a) {
- k.events.EventDispatcher.call(this);
- this.bytesTotal = this.bytesLoaded = 0;
- this.set_dataFormat(k.net.URLLoaderDataFormat.TEXT);
- null != a && this.load(a)
- };
- s["flash.net.URLLoader"] = k.net.URLLoader;
- k.net.URLLoader.__name__ = ["flash", "net", "URLLoader"];
- k.net.URLLoader.__super__ = k.events.EventDispatcher;
- k.net.URLLoader.prototype = I(k.events.EventDispatcher.prototype, {
- onStatus: function (a) {
- a = new k.events.HTTPStatusEvent("httpStatus", !1, !1, a);
- a.set_currentTarget(this);
- this.dispatchEvent(a)
- },
- onSecurityError: function (a) {
- var b =
- new k.events.SecurityErrorEvent("securityError");
- b.text = a;
- b.set_currentTarget(this);
- this.dispatchEvent(b)
- },
- onProgress: function (a) {
- var b = new k.events.ProgressEvent("progress");
- b.set_currentTarget(this);
- b.bytesLoaded = a.loaded;
- b.bytesTotal = a.total;
- this.dispatchEvent(b)
- },
- onOpen: function () {
- var a = new k.events.Event("open");
- a.set_currentTarget(this);
- this.dispatchEvent(a)
- },
- onError: function (a) {
- var b = new k.events.IOErrorEvent("ioError");
- b.text = a;
- b.set_currentTarget(this);
- this.dispatchEvent(b)
- },
- onData: function (a) {
- a =
- this.getData();
- switch (this.dataFormat) {
- case k.net.URLLoaderDataFormat.BINARY:
- this.data = k.utils.ByteArray.nmeOfBuffer(a);
- break;
- default:
- this.data = K.string(a)
- }
- a = new k.events.Event("complete");
- a.set_currentTarget(this);
- this.dispatchEvent(a)
- },
- requestUrl: function (a, b, d, c) {
- var e = new XMLHttpRequest;
- this.registerEvents(e);
- var f = "";
- if (F.Boot.__instanceof(d, k.utils.ByteArray)) {
- var l = d;
- switch (this.dataFormat) {
- case k.net.URLLoaderDataFormat.BINARY:
- f = l.data.buffer;
- break;
- default:
- f = l.readUTFBytes(l.length)
- }
- } else if (F.Boot.__instanceof(d,
- k.net.URLVariables)) {
- l = d;
- d = 0;
- for (var m = W.fields(l); d < m.length;) {
- var h = m[d];
- ++d;
- 0 != f.length && (f += "&");
- f += $.urlEncode(h) + "=" + $.urlEncode(W.field(l, h))
- }
- } else null != d && (f = d.toString());
- try {
- if ("GET" == b && null != f && "" != f) {
- var p = 1 >= a.split("?").length;
- e.open(b, a + (p ? "?" : "&") + K.string(f), !0);
- f = ""
- } else e.open(b, a, !0)
- } catch (C) {
- this.onError(C.toString());
- return
- }
- switch (this.dataFormat) {
- case k.net.URLLoaderDataFormat.BINARY:
- e.responseType = "arraybuffer"
- }
- for (d = 0; d < c.length;) a = c[d], ++d, e.setRequestHeader(a.name, a.value);
- e.send(f);
- this.onOpen();
- this.getData = function () {
- return null != e.response ? e.response : e.responseText
- }
- },
- registerEvents: function (a) {
- var b = this;
- "undefined" != typeof XMLHttpRequestProgressEvent && a.addEventListener("progress", A(this, this.onProgress), !1);
- a.onreadystatechange = function () {
- if (4 == a.readyState) {
- var d;
- try {
- d = a.status
- } catch (c) {
- d = null
- }
- void 0 == d && (d = null);
- if (null != d) b.onStatus(d);
- if (null != d && 200 <= d && 400 > d) b.onData(a.response);
- else if (null == d) b.onError("Failed to connect or resolve host");
- else if (12029 ==
- d) b.onError("Failed to connect to host");
- else if (12007 == d) b.onError("Unknown host");
- 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)");
- else b.onError("Http Error #" + a.status)
- }
- }
- },
- load: function (a) {
- this.requestUrl(a.url, a.method, a.data, a.formatRequestHeaders())
- },
- getData: function () {
- return null
- },
- close: function () {},
- set_dataFormat: function (a) {
- a != k.net.URLLoaderDataFormat.BINARY ||
- W.hasField(F.Browser.window, "ArrayBuffer") ? this.dataFormat = a : this.dataFormat = k.net.URLLoaderDataFormat.TEXT;
- return this.dataFormat
- },
- __class__: k.net.URLLoader
- });
- k.net.URLLoaderDataFormat = s["flash.net.URLLoaderDataFormat"] = {
- __ename__: ["flash", "net", "URLLoaderDataFormat"],
- __constructs__: ["BINARY", "TEXT", "VARIABLES"]
- };
- k.net.URLLoaderDataFormat.BINARY = ["BINARY", 0];
- k.net.URLLoaderDataFormat.BINARY.toString = N;
- k.net.URLLoaderDataFormat.BINARY.__enum__ = k.net.URLLoaderDataFormat;
- k.net.URLLoaderDataFormat.TEXT = ["TEXT", 1];
- k.net.URLLoaderDataFormat.TEXT.toString = N;
- k.net.URLLoaderDataFormat.TEXT.__enum__ = k.net.URLLoaderDataFormat;
- k.net.URLLoaderDataFormat.VARIABLES = ["VARIABLES", 2];
- k.net.URLLoaderDataFormat.VARIABLES.toString = N;
- k.net.URLLoaderDataFormat.VARIABLES.__enum__ = k.net.URLLoaderDataFormat;
- k.net.URLRequest = function (a) {
- null != a && (this.url = a);
- this.requestHeaders = [];
- this.method = "GET";
- this.contentType = null
- };
- s["flash.net.URLRequest"] = k.net.URLRequest;
- k.net.URLRequest.__name__ = ["flash", "net", "URLRequest"];
- k.net.URLRequest.prototype = {
- formatRequestHeaders: function () {
- var a = this.requestHeaders;
- null == a && (a = []);
- if ("GET" == this.method || null == this.data) return a;
- (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"));
- return a
- },
- __class__: k.net.URLRequest
- };
- k.net.URLRequestHeader = function (a, b) {
- null == b && (b = "");
- null == a && (a = "");
- this.name = a;
- this.value =
- b
- };
- s["flash.net.URLRequestHeader"] = k.net.URLRequestHeader;
- k.net.URLRequestHeader.__name__ = ["flash", "net", "URLRequestHeader"];
- k.net.URLRequestHeader.prototype = {
- __class__: k.net.URLRequestHeader
- };
- k.net.URLRequestMethod = function () {};
- s["flash.net.URLRequestMethod"] = k.net.URLRequestMethod;
- k.net.URLRequestMethod.__name__ = ["flash", "net", "URLRequestMethod"];
- k.net.URLVariables = function (a) {
- null != a && this.decode(a)
- };
- s["flash.net.URLVariables"] = k.net.URLVariables;
- k.net.URLVariables.__name__ = ["flash", "net", "URLVariables"];
- k.net.URLVariables.prototype = {
- toString: function () {
- for (var a = "", b = W.fields(this), d = 0, c = 0; c < b.length;) {
- var e = b[c];
- ++c;
- a += (0 != d++ ? "&" : "") + $.urlEncode(e) + "=" + $.urlEncode(W.field(this, e))
- }
- return a
- },
- decode: function (a) {
- for (var b = W.fields(this), d = 0; d < b.length;) {
- var c = b[d];
- ++d;
- W.deleteField(this, c)
- }
- a = a.split(";").join("&").split("&");
- 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)] = "")
- },
- __class__: k.net.URLVariables
- };
- k.text = {};
- k.text.Font = function () {};
- s["flash.text.Font"] = k.text.Font;
- k.text.Font.__name__ = ["flash", "text", "Font"];
- k.text.Font.enumerateFonts = function (a) {
- return []
- };
- k.text.Font.registerFont = function (a) {};
- k.text.Font.prototype = {
- hasGlyphs: function (a) {
- return !1
- },
- __class__: k.text.Font
- };
- k.text.FontStyle = s["flash.text.FontStyle"] = {
- __ename__: ["flash", "text", "FontStyle"],
- __constructs__: ["REGULAR", "ITALIC", "BOLD_ITALIC", "BOLD"]
- };
- k.text.FontStyle.REGULAR = ["REGULAR", 0];
- k.text.FontStyle.REGULAR.toString = N;
- k.text.FontStyle.REGULAR.__enum__ =
- k.text.FontStyle;
- k.text.FontStyle.ITALIC = ["ITALIC", 1];
- k.text.FontStyle.ITALIC.toString = N;
- k.text.FontStyle.ITALIC.__enum__ = k.text.FontStyle;
- k.text.FontStyle.BOLD_ITALIC = ["BOLD_ITALIC", 2];
- k.text.FontStyle.BOLD_ITALIC.toString = N;
- k.text.FontStyle.BOLD_ITALIC.__enum__ = k.text.FontStyle;
- k.text.FontStyle.BOLD = ["BOLD", 3];
- k.text.FontStyle.BOLD.toString = N;
- k.text.FontStyle.BOLD.__enum__ = k.text.FontStyle;
- k.text.FontType = s["flash.text.FontType"] = {
- __ename__: ["flash", "text", "FontType"],
- __constructs__: ["EMBEDDED",
- "DEVICE"
- ]
- };
- k.text.FontType.EMBEDDED = ["EMBEDDED", 0];
- k.text.FontType.EMBEDDED.toString = N;
- k.text.FontType.EMBEDDED.__enum__ = k.text.FontType;
- k.text.FontType.DEVICE = ["DEVICE", 1];
- k.text.FontType.DEVICE.toString = N;
- k.text.FontType.DEVICE.__enum__ = k.text.FontType;
- k.utils = {};
- k.utils.ByteArray = function () {
- this.littleEndian = !1;
- this.length = this.position = this.allocated = 0;
- this._nmeResizeBuffer(this.allocated)
- };
- s["flash.utils.ByteArray"] = k.utils.ByteArray;
- k.utils.ByteArray.__name__ = ["flash", "utils", "ByteArray"];
- k.utils.ByteArray.fromBytes =
- function (a) {
- var b = new k.utils.ByteArray;
- b.byteView = new Uint8Array(a.b);
- b.set_length(b.byteView.length);
- b.allocated = b.length;
- return b
- };
- k.utils.ByteArray.nmeOfBuffer = function (a) {
- var b = new k.utils.ByteArray;
- b.set_length(b.allocated = a.byteLength);
- b.data = new DataView(a);
- b.byteView = new Uint8Array(a);
- return b
- };
- k.utils.ByteArray.prototype = {
- set_length: function (a) {
- this.allocated < a ? this._nmeResizeBuffer(this.allocated = Math.max(a, 2 * this.allocated) | 0) : this.allocated > a && this._nmeResizeBuffer(this.allocated = a);
- return this.length = a
- },
- set_endian: function (a) {
- this.littleEndian = "littleEndian" == a;
- return a
- },
- get_endian: function () {
- return this.littleEndian ? "littleEndian" : "bigEndian"
- },
- get_bytesAvailable: function () {
- return this.length - this.position
- },
- writeUTFBytes: function (a) {
- for (var b = 0, d = a.length; b < d;) {
- var c = b++,
- c = a.charCodeAt(c);
- 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 |
- c & 63))
- }
- },
- writeUTF: function (a) {
- this.writeUnsignedShort(this._getUTFBytesCount(a));
- this.writeUTFBytes(a)
- },
- writeUnsignedShort: function (a) {
- var b = this.position + 2;
- this.length < b && this.set_length(b);
- this.data.setUint16(this.position, a, this.littleEndian);
- this.position += 2
- },
- writeUnsignedInt: function (a) {
- var b = this.position + 4;
- this.length < b && this.set_length(b);
- this.data.setUint32(this.position, a, this.littleEndian);
- this.position += 4
- },
- writeShort: function (a) {
- var b = this.position + 2;
- this.length < b && this.set_length(b);
- this.data.setInt16(this.position, a, this.littleEndian);
- this.position += 2
- },
- writeInt: function (a) {
- var b = this.position + 4;
- this.length < b && this.set_length(b);
- this.data.setInt32(this.position, a, this.littleEndian);
- this.position += 4
- },
- writeFloat: function (a) {
- var b = this.position + 4;
- this.length < b && this.set_length(b);
- this.data.setFloat32(this.position, a, this.littleEndian);
- this.position += 4
- },
- writeDouble: function (a) {
- var b = this.position + 8;
- this.length < b && this.set_length(b);
- this.data.setFloat64(this.position, a, this.littleEndian);
- this.position += 8
- },
- writeBytes: function (a, b, d) {
- if (0 > b || 0 > d) throw new k.errors.IOError("Write error - Out of bounds");
- var c = this.position + d;
- this.length < c && this.set_length(c);
- this.byteView.set(a.byteView.subarray(b, b + d), this.position);
- this.position += d
- },
- writeByte: function (a) {
- var b = this.position + 1;
- this.length < b && this.set_length(b);
- this.data.setInt8(this.position, a);
- this.position += 1
- },
- writeBoolean: function (a) {
- this.writeByte(a ? 1 : 0)
- },
- toString: function () {
- var a = this.position,
- b;
- this.position = 0;
- b = this.readUTFBytes(this.length);
- this.position = a;
- return b
- },
- readUTFBytes: function (a) {
- var b = "";
- for (a = this.position + a; this.position < a;) {
- var d = this.data.getUint8(this.position++);
- if (128 > d) {
- if (0 == d) break;
- b += String.fromCharCode(d)
- } else if (224 > d) b += String.fromCharCode((d & 63) << 6 | this.data.getUint8(this.position++) & 127);
- else if (240 > d) var c = this.data.getUint8(this.position++),
- b = b + String.fromCharCode((d & 31) << 12 | (c & 127) << 6 | this.data.getUint8(this.position++) & 127);
- else var c = this.data.getUint8(this.position++),
- e = this.data.getUint8(this.position++),
- b = b + String.fromCharCode((d & 15) << 18 | (c & 127) << 12 | e << 6 & 127 | this.data.getUint8(this.position++) & 127)
- }
- return b
- },
- readUTF: function () {
- return this.readUTFBytes(this.readUnsignedShort())
- },
- readUnsignedShort: function () {
- var a = this.data.getUint16(this.position, this.littleEndian);
- this.position += 2;
- return a
- },
- readUnsignedInt: function () {
- var a = this.data.getUint32(this.position, this.littleEndian);
- this.position += 4;
- return a
- },
- readUnsignedByte: function () {
- return this.data.getUint8(this.position++)
- },
- readShort: function () {
- var a =
- this.data.getInt16(this.position, this.littleEndian);
- this.position += 2;
- return a
- },
- readInt: function () {
- var a = this.data.getInt32(this.position, this.littleEndian);
- this.position += 4;
- return a
- },
- readFullBytes: function (a, b, d) {
- this.length < d && this.set_length(d);
- var c = b;
- for (b += d; c < b;) d = c++, this.data.setInt8(this.position++, a.b[d])
- },
- readFloat: function () {
- var a = this.data.getFloat32(this.position, this.littleEndian);
- this.position += 4;
- return a
- },
- readDouble: function () {
- var a = this.data.getFloat64(this.position, this.littleEndian);
- this.position += 8;
- return a
- },
- readBytes: function (a, b, d) {
- null == b && (b = 0);
- null == d && (d = this.length);
- if (0 > b || 0 > d) throw new k.errors.IOError("Read error - Out of bounds");
- var c = b + d;
- a.length < c && a.set_length(c);
- a.byteView.set(this.byteView.subarray(this.position, this.position + d), b);
- a.position = b;
- this.position += d;
- a.position + d > a.length && a.set_length(a.position + d)
- },
- readByte: function () {
- return this.data.getUint8(this.position++)
- },
- readBoolean: function () {
- return 0 != this.data.getUint8(this.position++)
- },
- nmeSet: function (a,
- b) {
- this.data.setUint8(a, b)
- },
- nmeGetBuffer: function () {
- return this.data.buffer
- },
- nmeGet: function (a) {
- return this.data.getUint8(a)
- },
- nmeFromBytes: function (a) {
- this.byteView = new Uint8Array(a.b);
- this.set_length(this.byteView.length);
- this.allocated = this.length
- },
- clear: function () {
- this.set_length(0)
- },
- _nmeResizeBuffer: function (a) {
- var b = this.byteView,
- d = new Uint8Array(a);
- null != b && (b.length <= a ? d.set(b) : d.set(b.subarray(0, a)));
- this.byteView = d;
- this.data = new DataView(d.buffer)
- },
- _getUTFBytesCount: function (a) {
- for (var b =
- 0, d = 0, c = a.length; d < c;) var e = d++,
- e = a.charCodeAt(e),
- b = 127 >= e ? b + 1 : 2047 >= e ? b + 2 : 65535 >= e ? b + 3 : b + 4;
- return b
- },
- __set: function (a, b) {
- this.data.setUint8(a, b)
- },
- __get: function (a) {
- return this.data.getUint8(a)
- },
- __class__: k.utils.ByteArray
- };
- k.utils.Dictionary = function (a) {};
- s["flash.utils.Dictionary"] = k.utils.Dictionary;
- k.utils.Dictionary.__name__ = ["flash", "utils", "Dictionary"];
- k.utils.Dictionary.prototype = {
- __class__: k.utils.Dictionary
- };
- k.utils.Endian = function () {};
- s["flash.utils.Endian"] = k.utils.Endian;
- k.utils.Endian.__name__ = ["flash", "utils", "Endian"];
- var ea;
- ea = function () {};
- s["gameplay.OzObject"] = ea;
- ea.__name__ = ["gameplay", "OzObject"];
- ea.GetGFXXML = function (a) {
- if (null != q.Xu.fc(q.Xu.fc(a, "joint"), "graphics")) a = q.Xu.fc(q.Xu.fc(a, "joint"), "graphics");
- else if (null != q.Xu.fc(q.Xu.fc(a, "body"), "graphics")) a = q.Xu.fc(q.Xu.fc(a, "body"), "graphics");
- else throw new k.errors.Error("can't find graphics at initGFX");
- return a
- };
- ea.GetBitmapData = function (a) {
- a = q.OzUtil.FindStringId(q.OzSprite.BitmapsNames, a.get("src"));
- a = q.OzSprite.Bitmaps[a];
- return q.OzSprite.TilesheetBitmapDatas[a.tilesheetId][a.frames[0]]
- };
- ea.GetBitmap = function (a) {
- a = q.OzUtil.FindStringId(q.OzSprite.BitmapsNames, a.get("src"));
- return new q.OzSprite(q.OzSprite.Bitmaps[a])
- };
- ea.prototype = {
- drawEditor: function (a, b, d) {
- this.sprite.rotation = this.geometry.degrees;
- this.sprite.x = this.geometry.x;
- this.sprite.y = this.geometry.y
- },
- setProperty: function (a, b) {
- "x" == a ? this.geometry.x = K.parseFloat(b) : "y" == a ? this.geometry.y = K.parseFloat(b) : "degrees" == a ? this.geometry.degrees = K.parseFloat(b) :
- (null == q.Xu.fc(this.attributes, "properties") && this.attributes.addChild(O.createElement("properties")), q.Xu.fc(this.attributes, "properties").set(a, b))
- },
- isRotatable: function () {
- return !0
- },
- initGFX: function () {
- var a = ea.GetGFXXML(this.bluePrint);
- if ("sprite" == a.get("type")) this.sprite = ea.GetBitmap(a);
- 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,
- null, !0, !0), this.geometry.drawLocalOutline(this.sprite.flSprite.get_graphics()), this.sprite.flSprite.get_graphics().endFill();
- else if ("line" != a.get("type")) throw new k.errors.Error("Todo: if not sprite");
- },
- fromXML: function (a, b, d, c, e) {
- null == e && (e = -10000001);
- null == c && (c = -10000001); - 1E6 > c && (c = Math.NaN); - 1E6 > e && (e = Math.NaN);
- var f = O.parse(a.toString()).firstElement(),
- l = new q.OzGeometry;
- if (null != q.Xu.fc(q.Xu.fc(b, "body"), "geometry")) l.fromXML(q.Xu.fc(q.Xu.fc(b, "body"), "geometry"));
- else if (null != q.Xu.fc(q.Xu.fc(b,
- "joint"), "geometry")) l.fromXML(q.Xu.fc(q.Xu.fc(b, "joint"), "geometry"));
- else if (null != q.Xu.fc(a, "geometry")) l.fromXML(q.Xu.fc(a, "geometry")), f.removeChild(q.Xu.fc(f, "geometry"));
- else throw new k.errors.Error("ERROR CAN'T FIND GEOMETRY FROM Xml");
- l.x += K.parseFloat(a.get("x"));
- l.y += K.parseFloat(a.get("y"));
- l.degrees += K.parseFloat(a.get("rot"));
- Math.isNaN(c) || Math.isNaN(e) || (l.x += c, l.y += e);
- this.attributes = f;
- this.bluePrint = b;
- this.geometry = l;
- if (null != q.Xu.fc(this.bluePrint, "property"))
- for (null == q.Xu.fc(this.attributes,
- "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));
- this.initGFX();
- this.gameSpecInit()
- },
- toXML: function () {
- var a = O.parse(this.attributes.toString()).firstElement();
- a.set("x", "" + this.geometry.x);
- a.set("y", "" + this.geometry.y);
- a.set("rot",
- "" + this.geometry.degrees);
- if ("dot" != this.bluePrint.get("editor") && "none" != this.bluePrint.get("editor")) {
- var b = this.geometry.toXML();
- b.set("x", "0");
- b.set("y", "0");
- b.set("degrees", "0");
- a.addChild(b)
- }
- return a
- },
- initPhysics: function (a) {
- if (null != q.Xu.fc(this.bluePrint, "body")) {
- var b = h.phys.Body,
- d;
- "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 =
- 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);
- this.body = new b(d);
- this.geometry.makePhysics(this.body);
- b = K.parseFloat(this.attributes.get("rot"));
- y.Log.trace("rot", {
- fileName: "OzObject.hx",
- lineNumber: 54,
- className: "gameplay.OzObject",
- methodName: "initPhysics",
- customParams: [this.attributes.get("rot"), this.geometry.degrees]
- });
- 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(),
- 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);
- this.body.set_rotation(this.geometry.degrees * Math.PI / 180);
- this.body.set_space(a);
- this.body.get_userData().object = this
- }
- },
- gameSpecInit: function () {
- null != q.Xu.fc(this.attributes, "properties") && null != q.Xu.fc(this.attributes,
- "properties").get("position") && (this.position = K.parseInt(q.Xu.fc(this.attributes, "properties").get("position")));
- this.isHooda == ("hooda" == this.attributes.get("type"))
- },
- __class__: ea
- };
- var y = {};
- y.StackItem = s["haxe.StackItem"] = {
- __ename__: ["haxe", "StackItem"],
- __constructs__: ["CFunction", "Module", "FilePos", "Method", "Lambda"]
- };
- y.StackItem.CFunction = ["CFunction", 0];
- y.StackItem.CFunction.toString = N;
- y.StackItem.CFunction.__enum__ = y.StackItem;
- y.StackItem.Module = function (a) {
- a = ["Module", 1, a];
- a.__enum__ = y.StackItem;
- a.toString = N;
- return a
- };
- y.StackItem.FilePos = function (a, b, d) {
- a = ["FilePos", 2, a, b, d];
- a.__enum__ = y.StackItem;
- a.toString = N;
- return a
- };
- y.StackItem.Method = function (a, b) {
- var d = ["Method", 3, a, b];
- d.__enum__ = y.StackItem;
- d.toString = N;
- return d
- };
- y.StackItem.Lambda = function (a) {
- a = ["Lambda", 4, a];
- a.__enum__ = y.StackItem;
- a.toString = N;
- return a
- };
- y.CallStack = function () {};
- s["haxe.CallStack"] = y.CallStack;
- y.CallStack.__name__ = ["haxe", "CallStack"];
- y.CallStack.exceptionStack = function () {
- return []
- };
- y.CallStack.toString = function (a) {
- for (var b =
- new fa, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.b += "\nCalled from ";
- y.CallStack.itemToString(b, c)
- }
- return b.b
- };
- y.CallStack.itemToString = function (a, b) {
- switch (b[1]) {
- case 0:
- a.b += "a C function";
- break;
- case 1:
- var d = b[2];
- a.b += "module ";
- a.b += K.string(d);
- break;
- case 2:
- var d = b[4],
- c = b[3],
- e = b[2];
- null != e && (y.CallStack.itemToString(a, e), a.b += " (");
- a.b += K.string(c);
- a.b += " line ";
- a.b += K.string(d);
- null != e && (a.b += ")");
- break;
- case 3:
- d = b[3];
- a.b += K.string(b[2]);
- a.b += ".";
- a.b += K.string(d);
- break;
- case 4:
- d = b[2], a.b += "local function #",
- a.b += K.string(d)
- }
- };
- y.Log = function () {};
- s["haxe.Log"] = y.Log;
- y.Log.__name__ = ["haxe", "Log"];
- y.Log.trace = function (a, b) {
- F.Boot.__trace(a, b)
- };
- y.Resource = function () {};
- s["haxe.Resource"] = y.Resource;
- y.Resource.__name__ = ["haxe", "Resource"];
- y.Resource.listNames = function () {
- for (var a = [], b = 0, d = y.Resource.content; b < d.length;) {
- var c = d[b];
- ++b;
- a.push(c.name)
- }
- return a
- };
- y.Resource.getString = function (a) {
- for (var b = 0, d = y.Resource.content; b < d.length;) {
- var c = d[b];
- ++b;
- if (c.name == a) return null != c.str ? c.str : y.Unserializer.run(c.data).toString()
- }
- return null
- };
- y.Serializer = function () {
- this.buf = new fa;
- this.cache = [];
- this.useCache = y.Serializer.USE_CACHE;
- this.useEnumIndex = y.Serializer.USE_ENUM_INDEX;
- this.shash = new y.ds.StringMap;
- this.scount = 0
- };
- s["haxe.Serializer"] = y.Serializer;
- y.Serializer.__name__ = ["haxe", "Serializer"];
- y.Serializer.run = function (a) {
- var b = new y.Serializer;
- b.serialize(a);
- return b.toString()
- };
- y.Serializer.prototype = {
- serialize: function (a) {
- var b = Y["typeof"](a);
- switch (b[1]) {
- case 0:
- this.buf.b += "n";
- break;
- case 1:
- if (0 == a) {
- this.buf.b += "z";
- break
- }
- this.buf.b +=
- "i";
- this.buf.b += K.string(a);
- break;
- case 2:
- 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");
- break;
- case 3:
- this.buf.b += K.string(a ? "t" : "f");
- break;
- case 6:
- b = b[2];
- if (b == String) {
- this.serializeString(a);
- break
- }
- if (this.useCache && this.serializeRef(a)) break;
- switch (b) {
- case Array:
- var d = 0;
- this.buf.b += "a";
- 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]));
- 0 < d && (1 == d ? this.buf.b += "n" : (this.buf.b += "u", this.buf.b += K.string(d)));
- this.buf.b += "h";
- break;
- case la:
- this.buf.b += "l";
- for (a = a.iterator(); a.hasNext();) b = a.next(), this.serialize(b);
- this.buf.b += "h";
- break;
- case Date:
- this.buf.b += "v";
- this.buf.b += K.string(S.dateStr(a));
- break;
- case y.ds.StringMap:
- this.buf.b += "b";
- for (d = a.keys(); d.hasNext();) b = d.next(), this.serializeString(b), this.serialize(a.get(b));
- this.buf.b += "h";
- break;
- case y.ds.IntMap:
- this.buf.b += "q";
- for (d = a.keys(); d.hasNext();) b = d.next(), this.buf.b += ":", this.buf.b +=
- K.string(b), this.serialize(a.get(b));
- this.buf.b += "h";
- break;
- case y.ds.ObjectMap:
- this.buf.b += "M";
- 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__]);
- this.buf.b += "h";
- break;
- case y.io.Bytes:
- b = 0;
- d = a.length - 2;
- c = new fa;
- for (e = y.Serializer.BASE64; b < d;) {
- var f = a.b[b++],
- l = a.b[b++],
- m = 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 | m >> 6) & 63));
- c.b += K.string(e.charAt(m &
- 63))
- }
- 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)));
- b = c.b;
- this.buf.b += "s";
- this.buf.b += K.string(b.length);
- this.buf.b += ":";
- this.buf.b += K.string(b);
- break;
- default:
- 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)),
- this.cache.push(a), this.serializeFields(a))
- }
- break;
- case 4:
- if (this.useCache && this.serializeRef(a)) break;
- this.buf.b += "o";
- this.serializeFields(a);
- break;
- case 7:
- b = b[2];
- if (this.useCache && this.serializeRef(a)) break;
- this.cache.pop();
- this.buf.b += K.string(this.useEnumIndex ? "j" : "w");
- this.serializeString(Y.getEnumName(b));
- this.useEnumIndex ? (this.buf.b += ":", this.buf.b += K.string(a[1])) : this.serializeString(a[0]);
- this.buf.b += ":";
- c = a.length;
- this.buf.b += K.string(c - 2);
- for (e = 2; e < c;) b = e++, this.serialize(a[b]);
- this.cache.push(a);
- break;
- case 5:
- throw "Cannot serialize function";
- default:
- throw "Cannot serialize " + K.string(a);
- }
- },
- serializeFields: function (a) {
- for (var b = 0, d = W.fields(a); b < d.length;) {
- var c = d[b];
- ++b;
- this.serializeString(c);
- this.serialize(W.field(a, c))
- }
- this.buf.b += "g"
- },
- serializeRef: function (a) {
- for (var b = typeof a, d = 0, c = this.cache.length; d < c;) {
- var e = d++,
- f = this.cache[e];
- if (typeof f == b && f == a) return this.buf.b += "r", this.buf.b += K.string(e), !0
- }
- this.cache.push(a);
- return !1
- },
- serializeString: function (a) {
- var b = this.shash.get(a);
- null !=
- 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))
- },
- toString: function () {
- return this.buf.b
- },
- __class__: y.Serializer
- };
- y.Timer = function (a) {
- var b = this;
- this.id = setInterval(function () {
- b.run()
- }, a)
- };
- s["haxe.Timer"] = y.Timer;
- y.Timer.__name__ = ["haxe", "Timer"];
- y.Timer.prototype = {
- run: function () {
- y.Log.trace("run", {
- fileName: "Timer.hx",
- lineNumber: 98,
- className: "haxe.Timer",
- methodName: "run"
- })
- },
- __class__: y.Timer
- };
- y.Unserializer = function (a) {
- this.buf = a;
- this.length = a.length;
- this.pos = 0;
- this.scache = [];
- this.cache = [];
- a = y.Unserializer.DEFAULT_RESOLVER;
- null == a && (a = Y, y.Unserializer.DEFAULT_RESOLVER = a);
- this.setResolver(a)
- };
- s["haxe.Unserializer"] = y.Unserializer;
- y.Unserializer.__name__ = ["haxe", "Unserializer"];
- y.Unserializer.initCodes = function () {
- for (var a = [], b = 0, d = y.Unserializer.BASE64.length; b < d;) {
- var c = b++;
- a[y.Unserializer.BASE64.charCodeAt(c)] = c
- }
- return a
- };
- y.Unserializer.run = function (a) {
- return (new y.Unserializer(a)).unserialize()
- };
- y.Unserializer.prototype = {
- unserialize: function () {
- switch (this.buf.charCodeAt(this.pos++)) {
- case 110:
- return null;
- case 116:
- return !0;
- case 102:
- return !1;
- case 122:
- return 0;
- case 105:
- return this.readDigits();
- case 100:
- for (var a = this.pos;;) {
- var b = this.buf.charCodeAt(this.pos);
- if (43 <= b && 58 > b || 101 == b || 69 == b) this.pos++;
- else break
- }
- return K.parseFloat(S.substr(this.buf, a, this.pos - a));
- case 121:
- b = this.readDigits();
- if (58 != this.buf.charCodeAt(this.pos++) || this.length - this.pos < b) throw "Invalid string length";
- a = S.substr(this.buf,
- this.pos, b);
- this.pos += b;
- a = $.urlDecode(a);
- this.scache.push(a);
- return a;
- case 107:
- return Math.NaN;
- case 109:
- return Math.NEGATIVE_INFINITY;
- case 112:
- return Math.POSITIVE_INFINITY;
- case 97:
- var d = this.buf,
- a = [];
- for (this.cache.push(a);;) {
- b = this.buf.charCodeAt(this.pos);
- if (104 == b) {
- this.pos++;
- break
- }
- 117 == b ? (this.pos++, b = this.readDigits(), a[a.length + b - 1] = null) : a.push(this.unserialize())
- }
- return a;
- case 111:
- return b = {}, this.cache.push(b), this.unserializeObject(b), b;
- case 114:
- b = this.readDigits();
- if (0 > b || b >= this.cache.length) throw "Invalid reference";
- return this.cache[b];
- case 82:
- b = this.readDigits();
- if (0 > b || b >= this.scache.length) throw "Invalid string reference";
- return this.scache[b];
- case 120:
- throw this.unserialize();
- case 99:
- b = this.unserialize();
- a = this.resolver.resolveClass(b);
- if (null == a) throw "Class not found " + b;
- b = Y.createEmptyInstance(a);
- this.cache.push(b);
- this.unserializeObject(b);
- return b;
- case 119:
- b = this.unserialize();
- a = this.resolver.resolveEnum(b);
- if (null == a) throw "Enum not found " + b;
- b = this.unserializeEnum(a, this.unserialize());
- this.cache.push(b);
- return b;
- case 106:
- b = this.unserialize();
- a = this.resolver.resolveEnum(b);
- if (null == a) throw "Enum not found " + b;
- this.pos++;
- var d = this.readDigits(),
- c = Y.getEnumConstructs(a)[d];
- if (null == c) throw "Unknown enum index " + b + "@" + d;
- b = this.unserializeEnum(a, c);
- this.cache.push(b);
- return b;
- case 108:
- b = new la;
- for (this.cache.push(b); 104 != this.buf.charCodeAt(this.pos);) b.add(this.unserialize());
- this.pos++;
- return b;
- case 98:
- d = new y.ds.StringMap;
- for (this.cache.push(d); 104 != this.buf.charCodeAt(this.pos);) a = this.unserialize(),
- d.set(a, this.unserialize());
- this.pos++;
- return d;
- case 113:
- d = new y.ds.IntMap;
- this.cache.push(d);
- for (b = this.buf.charCodeAt(this.pos++); 58 == b;) a = this.readDigits(), d.set(a, this.unserialize()), b = this.buf.charCodeAt(this.pos++);
- if (104 != b) throw "Invalid IntMap format";
- return d;
- case 77:
- d = new y.ds.ObjectMap;
- for (this.cache.push(d); 104 != this.buf.charCodeAt(this.pos);) a = this.unserialize(), d.set(a, this.unserialize());
- this.pos++;
- return d;
- case 118:
- return b = S.strDate(S.substr(this.buf, this.pos, 19)), this.cache.push(b),
- this.pos += 19, b;
- case 115:
- b = this.readDigits();
- d = this.buf;
- if (58 != this.buf.charCodeAt(this.pos++) || this.length - this.pos < b) throw "Invalid bytes length";
- c = y.Unserializer.CODES;
- null == c && (c = y.Unserializer.initCodes(), y.Unserializer.CODES = c);
- 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;) {
- var h = c[d.charCodeAt(a++)],
- p = c[d.charCodeAt(a++)];
- l.b[m++] = (h << 2 | p >> 4) & 255;
- h = c[d.charCodeAt(a++)];
- l.b[m++] = (p << 4 | h >> 2) & 255;
- p = c[d.charCodeAt(a++)];
- l.b[m++] = (h << 6 | p) & 255
- }
- 2 <= e && (h = c[d.charCodeAt(a++)],
- 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));
- this.pos += b;
- this.cache.push(l);
- return l;
- case 67:
- b = this.unserialize();
- a = this.resolver.resolveClass(b);
- if (null == a) throw "Class not found " + b;
- b = Y.createEmptyInstance(a);
- this.cache.push(b);
- b.hxUnserialize(this);
- if (103 != this.buf.charCodeAt(this.pos++)) throw "Invalid custom data";
- return b
- }
- this.pos--;
- throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos;
- },
- unserializeEnum: function (a, b) {
- if (58 !=
- this.buf.charCodeAt(this.pos++)) throw "Invalid enum format";
- var d = this.readDigits();
- if (0 == d) return Y.createEnum(a, b);
- for (var c = []; 0 < d--;) c.push(this.unserialize());
- return Y.createEnum(a, b, c)
- },
- unserializeObject: function (a) {
- for (;;) {
- if (this.pos >= this.length) throw "Invalid object";
- if (103 == this.buf.charCodeAt(this.pos)) break;
- var b = this.unserialize();
- if (!F.Boot.__instanceof(b, String)) throw "Invalid object key";
- var d = this.unserialize();
- a[b] = d
- }
- this.pos++
- },
- readDigits: function () {
- for (var a = 0, b = !1, d = this.pos;;) {
- var c =
- this.buf.charCodeAt(this.pos);
- if (c != c) break;
- if (45 == c) {
- if (this.pos != d) break;
- b = !0
- } else {
- if (48 > c || 57 < c) break;
- a = 10 * a + (c - 48)
- }
- this.pos++
- }
- b && (a *= -1);
- return a
- },
- setResolver: function (a) {
- this.resolver = null == a ? {
- resolveClass: function (a) {
- return null
- },
- resolveEnum: function (a) {
- return null
- }
- } : a
- },
- __class__: y.Unserializer
- };
- y.ds = {};
- y.ds.IntMap = function () {
- this.h = {}
- };
- s["haxe.ds.IntMap"] = y.ds.IntMap;
- y.ds.IntMap.__name__ = ["haxe", "ds", "IntMap"];
- y.ds.IntMap.__interfaces__ = [ca];
- y.ds.IntMap.prototype = {
- keys: function () {
- var a = [],
- b;
- for (b in this.h) this.h.hasOwnProperty(b) && a.push(b | 0);
- return S.iter(a)
- },
- exists: function (a) {
- return this.h.hasOwnProperty(a)
- },
- get: function (a) {
- return this.h[a]
- },
- set: function (a, b) {
- this.h[a] = b
- },
- __class__: y.ds.IntMap
- };
- y.ds.ObjectMap = function () {
- this.h = {};
- this.h.__keys__ = {}
- };
- s["haxe.ds.ObjectMap"] = y.ds.ObjectMap;
- y.ds.ObjectMap.__name__ = ["haxe", "ds", "ObjectMap"];
- y.ds.ObjectMap.__interfaces__ = [ca];
- y.ds.ObjectMap.prototype = {
- keys: function () {
- var a = [],
- b;
- for (b in this.h.__keys__) this.h.hasOwnProperty(b) && a.push(this.h.__keys__[b]);
- return S.iter(a)
- },
- remove: function (a) {
- a = a.__id__;
- if (!this.h.hasOwnProperty(a)) return !1;
- delete this.h[a];
- delete this.h.__keys__[a];
- return !0
- },
- set: function (a, b) {
- var d = null != a.__id__ ? a.__id__ : a.__id__ = ++y.ds.ObjectMap.count;
- this.h[d] = b;
- this.h.__keys__[d] = a
- },
- __class__: y.ds.ObjectMap
- };
- y.ds.StringMap = function () {
- this.h = {}
- };
- s["haxe.ds.StringMap"] = y.ds.StringMap;
- y.ds.StringMap.__name__ = ["haxe", "ds", "StringMap"];
- y.ds.StringMap.__interfaces__ = [ca];
- y.ds.StringMap.prototype = {
- keys: function () {
- var a = [],
- b;
- for (b in this.h) this.h.hasOwnProperty(b) &&
- a.push(b.substr(1));
- return S.iter(a)
- },
- remove: function (a) {
- a = "$" + a;
- if (!this.h.hasOwnProperty(a)) return !1;
- delete this.h[a];
- return !0
- },
- exists: function (a) {
- return this.h.hasOwnProperty("$" + a)
- },
- get: function (a) {
- return this.h["$" + a]
- },
- set: function (a, b) {
- this.h["$" + a] = b
- },
- __class__: y.ds.StringMap
- };
- y.io = {};
- y.io.Bytes = function (a, b) {
- this.length = a;
- this.b = b
- };
- s["haxe.io.Bytes"] = y.io.Bytes;
- y.io.Bytes.__name__ = ["haxe", "io", "Bytes"];
- y.io.Bytes.alloc = function (a) {
- for (var b = [], d = 0; d < a;) d++, b.push(0);
- return new y.io.Bytes(a,
- b)
- };
- y.io.Bytes.ofString = function (a) {
- for (var b = [], d = 0, c = a.length; d < c;) {
- var e = d++,
- e = a.charCodeAt(e);
- 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))
- }
- return new y.io.Bytes(b.length, b)
- };
- y.io.Bytes.prototype = {
- toString: function () {
- return this.readString(0, this.length)
- },
- readString: function (a, b) {
- if (0 > a || 0 > b || a + b > this.length) throw y.io.Error.OutsideBounds;
- for (var d = "", c = this.b, e = String.fromCharCode, f = a, l = a +
- b; f < l;) {
- var m = c[f++];
- if (128 > m) {
- if (0 == m) break;
- d += e(m)
- } else if (224 > m) d += e((m & 63) << 6 | c[f++] & 127);
- else if (240 > m) var h = c[f++],
- d = d + e((m & 31) << 12 | (h & 127) << 6 | c[f++] & 127);
- else var h = c[f++],
- p = c[f++],
- d = d + e((m & 15) << 18 | (h & 127) << 12 | p << 6 & 127 | c[f++] & 127)
- }
- return d
- },
- __class__: y.io.Bytes
- };
- y.io.Eof = function () {};
- s["haxe.io.Eof"] = y.io.Eof;
- y.io.Eof.__name__ = ["haxe", "io", "Eof"];
- y.io.Eof.prototype = {
- toString: function () {
- return "Eof"
- },
- __class__: y.io.Eof
- };
- y.io.Error = s["haxe.io.Error"] = {
- __ename__: ["haxe", "io", "Error"],
- __constructs__: ["Blocked",
- "Overflow", "OutsideBounds", "Custom"
- ]
- };
- y.io.Error.Blocked = ["Blocked", 0];
- y.io.Error.Blocked.toString = N;
- y.io.Error.Blocked.__enum__ = y.io.Error;
- y.io.Error.Overflow = ["Overflow", 1];
- y.io.Error.Overflow.toString = N;
- y.io.Error.Overflow.__enum__ = y.io.Error;
- y.io.Error.OutsideBounds = ["OutsideBounds", 2];
- y.io.Error.OutsideBounds.toString = N;
- y.io.Error.OutsideBounds.__enum__ = y.io.Error;
- y.io.Error.Custom = function (a) {
- a = ["Custom", 3, a];
- a.__enum__ = y.io.Error;
- a.toString = N;
- return a
- };
- y.xml = {};
- y.xml.Parser = function () {};
- s["haxe.xml.Parser"] =
- y.xml.Parser;
- y.xml.Parser.__name__ = ["haxe", "xml", "Parser"];
- y.xml.Parser.parse = function (a) {
- var b = O.createDocument();
- y.xml.Parser.doParse(a, 0, b);
- return b
- };
- y.xml.Parser.doParse = function (a, b, d) {
- null == b && (b = 0);
- 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;) {
- switch (e) {
- case 0:
- switch (C) {
- case 10:
- case 13:
- case 9:
- case 32:
- break;
- default:
- e = f;
- continue
- }
- break;
- case 1:
- switch (C) {
- case 60:
- e = 0;
- f = 2;
- break;
- default:
- m = b;
- e = 13;
- continue
- }
- break;
- case 13:
- 60 == C ? (e = O.createPCData(r.b + S.substr(a, m, b - m)), r = new fa,
- d.addChild(e), h++, e = 0, f = 2) : 38 == C && (r.addSub(a, m, b - m), e = 18, f = 13, m = b + 1);
- break;
- case 17:
- 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);
- break;
- case 2:
- switch (C) {
- case 33:
- if (91 == a.charCodeAt(b + 1)) {
- b += 2;
- if ("CDATA[" != S.substr(a, b, 6).toUpperCase()) throw "Expected <![CDATA[";
- b += 5;
- e = 17
- } else if (68 == a.charCodeAt(b + 1) || 100 == a.charCodeAt(b + 1)) {
- if ("OCTYPE" != S.substr(a, b + 2, 6).toUpperCase()) throw "Expected <!DOCTYPE";
- b += 8;
- e = 16
- } else {
- if (45 != a.charCodeAt(b +
- 1) || 45 != a.charCodeAt(b + 2)) throw "Expected \x3c!--";
- b += 2;
- e = 15
- }
- m = b + 1;
- break;
- case 63:
- e = 14;
- m = b;
- break;
- case 47:
- if (null == d) throw "Expected node name";
- m = b + 1;
- e = 0;
- f = 10;
- break;
- default:
- e = 3;
- m = b;
- continue
- }
- break;
- case 3:
- if (!(97 <= C && 122 >= C || 65 <= C && 90 >= C || 48 <= C && 57 >= C || 58 == C || 46 == C || 95 == C || 45 == C)) {
- if (b == m) throw "Expected node name";
- c = O.createElement(S.substr(a, m, b - m));
- d.addChild(c);
- e = 0;
- f = 4;
- continue
- }
- break;
- case 4:
- switch (C) {
- case 47:
- e = 11;
- h++;
- break;
- case 62:
- e = 9;
- h++;
- break;
- default:
- e = 5;
- m = b;
- continue
- }
- break;
- case 5:
- if (!(97 <= C && 122 >=
- C || 65 <= C && 90 >= C || 48 <= C && 57 >= C || 58 == C || 46 == C || 95 == C || 45 == C)) {
- if (m == b) throw "Expected attribute name";
- l = S.substr(a, m, b - m);
- if (c.exists(l)) throw "Duplicate attribute";
- e = 0;
- f = 6;
- continue
- }
- break;
- case 6:
- switch (C) {
- case 61:
- e = 0;
- f = 7;
- break;
- default:
- throw "Expected =";
- }
- break;
- case 7:
- switch (C) {
- case 34:
- case 39:
- e = 8;
- m = b;
- break;
- default:
- throw 'Expected "';
- }
- break;
- case 8:
- C == a.charCodeAt(m) && (f = S.substr(a, m + 1, b - m - 1), c.set(l, f), e = 0, f = 4);
- break;
- case 9:
- m = b = y.xml.Parser.doParse(a, b, c);
- e = 1;
- break;
- case 11:
- switch (C) {
- case 62:
- e = 1;
- break;
- default:
- throw "Expected >";
- }
- break;
- case 12:
- switch (C) {
- case 62:
- return 0 == h && d.addChild(O.createPCData("")), b;
- default:
- throw "Expected >";
- }
- case 10:
- if (!(97 <= C && 122 >= C || 65 <= C && 90 >= C || 48 <= C && 57 >= C || 58 == C || 46 == C || 95 == C || 45 == C)) {
- if (m == b) throw "Expected node name";
- if (S.substr(a, m, b - m) != d.get_nodeName()) throw "Expected </" + d.get_nodeName() + ">";
- e = 0;
- f = 12;
- continue
- }
- break;
- case 15:
- 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);
- break;
- case 16:
- 91 == C ? p++ : 93 == C ? p-- : 62 == C && 0 == p && (d.addChild(O.createDocType(S.substr(a,
- m, b - m))), e = 1);
- break;
- case 14:
- 63 == C && 62 == a.charCodeAt(b + 1) && (b++, e = S.substr(a, m + 1, b - m - 2), d.addChild(O.createProcessingInstruction(e)), e = 1);
- break;
- case 18:
- 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)
- }
- C = a.charCodeAt(++b)
- }
- 1 == e && (m = b, e = 13);
- if (13 == e) return b ==
- m && 0 != h || d.addChild(O.createPCData(r.b + S.substr(a, m, b - m))), b;
- throw "Unexpected end";
- };
- var F = {
- Boot: function () {}
- };
- s["js.Boot"] = F.Boot;
- F.Boot.__name__ = ["js", "Boot"];
- F.Boot.__unhtml = function (a) {
- return a.split("&").join("&").split("<").join("<").split(">").join(">")
- };
- F.Boot.__trace = function (a, b) {
- var d = null != b ? b.fileName + ":" + b.lineNumber + ": " : "",
- d = d + F.Boot.__string_rec(a, "");
- if (null != b && null != b.customParams)
- for (var c = 0, e = b.customParams; c < e.length;) {
- var f = e[c];
- ++c;
- d += "," + F.Boot.__string_rec(f, "")
- }
- var l;
- "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)
- };
- F.Boot.__string_rec = function (a, b) {
- if (null == a) return "null";
- if (5 <= b.length) return "<...>";
- var d = typeof a;
- "function" == d && (a.__name__ || a.__ename__) && (d = "object");
- switch (d) {
- case "object":
- if (a instanceof Array) {
- if (a.__enum__) {
- if (2 == a.length) return a[0];
- d = a[0] + "(";
- b += "\t";
- for (var c = 2, e = a.length; c < e;) var f = c++,
- d = 2 != f ? d + ("," + F.Boot.__string_rec(a[f],
- b)) : d + F.Boot.__string_rec(a[f], b);
- return d + ")"
- }
- c = a.length;
- d = "[";
- b += "\t";
- for (e = 0; e < c;) f = e++, d += (0 < f ? "," : "") + F.Boot.__string_rec(a[f], b);
- return d + "]"
- }
- try {
- e = a.toString
- } catch (l) {
- return "???"
- }
- if (null != e && e != Object.toString && (d = a.toString(), "[object Object]" != d)) return d;
- e = null;
- d = "{\n";
- b += "\t";
- c = null != a.hasOwnProperty;
- 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],
- b));
- b = b.substring(1);
- return d += "\n" + b + "}";
- case "function":
- return "<function>";
- case "string":
- return a;
- default:
- return String(a)
- }
- };
- F.Boot.__interfLoop = function (a, b) {
- if (null == a) return !1;
- if (a == b) return !0;
- var d = a.__interfaces__;
- if (null != d)
- for (var c = 0, e = d.length; c < e;) {
- var f = c++,
- f = d[f];
- if (f == b || F.Boot.__interfLoop(f, b)) return !0
- }
- return F.Boot.__interfLoop(a.__super__, b)
- };
- F.Boot.__instanceof = function (a, b) {
- if (null == b) return !1;
- switch (b) {
- case wa:
- return (a | 0) === a;
- case sa:
- return "number" == typeof a;
- case ta:
- return "boolean" ==
- typeof a;
- case String:
- return "string" == typeof a;
- case xa:
- return !0;
- default:
- if (null != a) {
- if ("function" == typeof b) {
- if (a instanceof b) return b == Array ? null == a.__enum__ : !0;
- if (F.Boot.__interfLoop(a.__class__, b)) return !0
- }
- } else return !1;
- return b == ya && null != a.__name__ || b == za && null != a.__ename__ ? !0 : a.__enum__ == b
- }
- };
- F.Boot.__cast = function (a, b) {
- if (F.Boot.__instanceof(a, b)) return a;
- throw "Cannot cast " + K.string(a) + " to " + K.string(b);
- };
- F.Browser = function () {};
- s["js.Browser"] = F.Browser;
- F.Browser.__name__ = ["js", "Browser"];
- F.Browser.getLocalStorage = function () {
- try {
- var a = F.Browser.window.localStorage;
- a.getItem("");
- return a
- } catch (b) {
- return null
- }
- };
- var h = {
- Config: function () {}
- };
- s["nape.Config"] = h.Config;
- h.Config.__name__ = ["nape", "Config"];
- h.Config.prototype = {
- __class__: h.Config
- };
- h.callbacks = {};
- h.callbacks.Callback = function () {
- this.zpp_inner = null;
- if (!c.callbacks.ZPP_Callback.internal) throw "Error: Callback cannot be instantiated derp!";
- };
- s["nape.callbacks.Callback"] = h.callbacks.Callback;
- h.callbacks.Callback.__name__ = ["nape", "callbacks",
- "Callback"
- ];
- h.callbacks.Callback.prototype = {
- toString: function () {
- return ""
- },
- get_listener: function () {
- return this.zpp_inner.listener.outer
- },
- get_event: function () {
- return c.callbacks.ZPP_Listener.events[this.zpp_inner.event]
- },
- __class__: h.callbacks.Callback
- };
- h.callbacks.BodyCallback = function () {
- h.callbacks.Callback.call(this)
- };
- s["nape.callbacks.BodyCallback"] = h.callbacks.BodyCallback;
- h.callbacks.BodyCallback.__name__ = ["nape", "callbacks", "BodyCallback"];
- h.callbacks.BodyCallback.__super__ = h.callbacks.Callback;
- h.callbacks.BodyCallback.prototype = I(h.callbacks.Callback.prototype, {
- toString: function () {
- var a;
- a = "Cb:" + ["WAKE", "SLEEP"][this.zpp_inner.event - c.util.ZPP_Flags.id_CbEvent_WAKE];
- a += ":" + this.zpp_inner.body.outer.toString();
- return a += " : listener: " + K.string(this.zpp_inner.listener.outer)
- },
- get_body: function () {
- return this.zpp_inner.body.outer
- },
- __class__: h.callbacks.BodyCallback
- });
- h.callbacks.Listener = function () {
- this.zpp_inner = null;
- if (!c.callbacks.ZPP_Listener.internal) throw "Error: Cannot instantiate Listener derp!";
- };
- s["nape.callbacks.Listener"] = h.callbacks.Listener;
- h.callbacks.Listener.__name__ = ["nape", "callbacks", "Listener"];
- h.callbacks.Listener.prototype = {
- toString: function () {
- var a = "BEGIN END WAKE SLEEP BREAK PRE ONGOING".split(" ")[this.zpp_inner.event];
- 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) + "}";
- if (this.zpp_inner.type == c.util.ZPP_Flags.id_ListenerType_CONSTRAINT) {
- var b = this.zpp_inner.constraint;
- return "ConstraintListener{" + a + "::" + K.string(b.outer_zn.zpp_inner_zn.options.outer) + "}"
- }
- var b = this.zpp_inner.interaction,
- d;
- switch (b.itype) {
- case c.util.ZPP_Flags.id_InteractionType_COLLISION:
- d = "COLLISION";
- break;
- case c.util.ZPP_Flags.id_InteractionType_SENSOR:
- d = "SENSOR";
- break;
- case c.util.ZPP_Flags.id_InteractionType_FLUID:
- d = "FLUID";
- break;
- default:
- d = "ALL"
- }
- 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) +
- ":" + 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
- },
- set_space: function (a) {
- (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);
- return null == this.zpp_inner.space ?
- null : this.zpp_inner.space.outer
- },
- get_space: function () {
- return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
- },
- set_precedence: function (a) {
- this.zpp_inner.precedence != a && (this.zpp_inner.precedence = a, this.zpp_inner.invalidate_precedence());
- return this.zpp_inner.precedence
- },
- get_precedence: function () {
- return this.zpp_inner.precedence
- },
- set_event: function (a) {
- if (null == a) throw "Error: Cannot set listener event type to null";
- c.callbacks.ZPP_Listener.events[this.zpp_inner.event] != a && (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), 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 =
- 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 ?
- 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));
- return c.callbacks.ZPP_Listener.events[this.zpp_inner.event]
- },
- get_event: function () {
- return c.callbacks.ZPP_Listener.events[this.zpp_inner.event]
- },
- get_type: function () {
- return c.callbacks.ZPP_Listener.types[this.zpp_inner.type]
- },
- __class__: h.callbacks.Listener
- };
- h.callbacks.BodyListener = function (a, b, d, g) {
- null == g && (g = 0);
- this.zpp_inner_zn = null;
- c.callbacks.ZPP_Listener.internal = !0;
- h.callbacks.Listener.call(this);
- c.callbacks.ZPP_Listener.internal = !1;
- if (null == d) throw "Error: BodyListener::handler cannot be null";
- var e = -1;
- 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);
- if (a == c.util.ZPP_Flags.CbEvent_WAKE) e = c.util.ZPP_Flags.id_CbEvent_WAKE;
- 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;
- else throw "Error: cbEvent '" + a.toString() + "' is not a valid event type for a BodyListener";
- this.zpp_inner = this.zpp_inner_zn = new c.callbacks.ZPP_BodyListener(c.callbacks.ZPP_OptionType.argument(b), e, d);
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- this.zpp_inner.precedence =
- g
- };
- s["nape.callbacks.BodyListener"] = h.callbacks.BodyListener;
- h.callbacks.BodyListener.__name__ = ["nape", "callbacks", "BodyListener"];
- h.callbacks.BodyListener.__super__ = h.callbacks.Listener;
- h.callbacks.BodyListener.prototype = I(h.callbacks.Listener.prototype, {
- set_handler: function (a) {
- if (null == a) throw "Error: BodyListener::handler cannot be null";
- this.zpp_inner_zn.handler = a;
- return this.zpp_inner_zn.handler
- },
- get_handler: function () {
- return this.zpp_inner_zn.handler
- },
- set_options: function (a) {
- this.zpp_inner_zn.options.set(a.zpp_inner);
- return this.zpp_inner_zn.options.outer
- },
- get_options: function () {
- return this.zpp_inner_zn.options.outer
- },
- __class__: h.callbacks.BodyListener
- });
- h.callbacks.CbEvent = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate CbEvent derp!";
- };
- s["nape.callbacks.CbEvent"] = h.callbacks.CbEvent;
- h.callbacks.CbEvent.__name__ = ["nape", "callbacks", "CbEvent"];
- h.callbacks.CbEvent.get_BEGIN = function () {
- 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);
- return c.util.ZPP_Flags.CbEvent_BEGIN
- };
- h.callbacks.CbEvent.get_ONGOING = function () {
- 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);
- return c.util.ZPP_Flags.CbEvent_ONGOING
- };
- h.callbacks.CbEvent.get_END = function () {
- 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);
- return c.util.ZPP_Flags.CbEvent_END
- };
- h.callbacks.CbEvent.get_WAKE = function () {
- 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);
- return c.util.ZPP_Flags.CbEvent_WAKE
- };
- h.callbacks.CbEvent.get_SLEEP = function () {
- 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);
- return c.util.ZPP_Flags.CbEvent_SLEEP
- };
- h.callbacks.CbEvent.get_BREAK = function () {
- 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);
- return c.util.ZPP_Flags.CbEvent_BREAK
- };
- h.callbacks.CbEvent.get_PRE = function () {
- 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);
- return c.util.ZPP_Flags.CbEvent_PRE
- };
- h.callbacks.CbEvent.prototype = {
- toString: function () {
- var a;
- 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);
- 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" : ""))))));
- return a
- },
- __class__: h.callbacks.CbEvent
- };
- h.callbacks.CbType = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.callbacks.ZPP_CbType;
- this.zpp_inner.outer = this
- };
- s["nape.callbacks.CbType"] = h.callbacks.CbType;
- h.callbacks.CbType.__name__ = ["nape", "callbacks", "CbType"];
- h.callbacks.CbType.get_ANY_BODY = function () {
- return c.callbacks.ZPP_CbType.ANY_BODY
- };
- h.callbacks.CbType.get_ANY_CONSTRAINT = function () {
- return c.callbacks.ZPP_CbType.ANY_CONSTRAINT
- };
- h.callbacks.CbType.get_ANY_SHAPE = function () {
- return c.callbacks.ZPP_CbType.ANY_SHAPE
- };
- h.callbacks.CbType.get_ANY_COMPOUND = function () {
- return c.callbacks.ZPP_CbType.ANY_COMPOUND
- };
- h.callbacks.CbType.prototype = {
- toString: function () {
- return this ==
- 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
- },
- get_constraints: function () {
- null == this.zpp_inner.wrap_constraints && (this.zpp_inner.wrap_constraints = c.util.ZPP_ConstraintList.get(this.zpp_inner.constraints, !0));
- return this.zpp_inner.wrap_constraints
- },
- get_interactors: function () {
- null == this.zpp_inner.wrap_interactors &&
- (this.zpp_inner.wrap_interactors = c.util.ZPP_InteractorList.get(this.zpp_inner.interactors, !0));
- return this.zpp_inner.wrap_interactors
- },
- get_userData: function () {
- null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
- return this.zpp_inner.userData
- },
- excluding: function (a) {
- return (new h.callbacks.OptionType(this)).excluding(a)
- },
- including: function (a) {
- return (new h.callbacks.OptionType(this)).including(a)
- },
- get_id: function () {
- return this.zpp_inner.id
- },
- __class__: h.callbacks.CbType
- };
- h.callbacks.CbTypeIterator =
- function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_CbTypeList.internal) throw "Error: Cannot instantiate CbTypeIterator derp!";
- };
- s["nape.callbacks.CbTypeIterator"] = h.callbacks.CbTypeIterator;
- h.callbacks.CbTypeIterator.__name__ = ["nape", "callbacks", "CbTypeIterator"];
- h.callbacks.CbTypeIterator.get = function (a) {
- var b = null == h.callbacks.CbTypeIterator.zpp_pool ? function (a) {
- c.util.ZPP_CbTypeList.internal = !0;
- a = new h.callbacks.CbTypeIterator;
- c.util.ZPP_CbTypeList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.callbacks.CbTypeIterator.zpp_pool;
- h.callbacks.CbTypeIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.callbacks.CbTypeIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.callbacks.CbTypeIterator.zpp_pool;
- h.callbacks.CbTypeIterator.zpp_pool =
- this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.callbacks.CbTypeIterator
- };
- h.callbacks.CbTypeList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_CbTypeList;
- this.zpp_inner.outer = this
- };
- s["nape.callbacks.CbTypeList"] = h.callbacks.CbTypeList;
- h.callbacks.CbTypeList.__name__ = ["nape", "callbacks", "CbTypeList"];
- h.callbacks.CbTypeList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.callbacks.CbTypeList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.callbacks.CbTypeList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.callbacks.CbTypeIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.callbacks.CbTypeIterator.zpp_pool;
- h.callbacks.CbTypeIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.callbacks.CbTypeIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.callbacks.CbTypeIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.callbacks.CbTypeList,
- d;
- this.zpp_inner.valmod();
- for (d = h.callbacks.CbTypeIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: CbType is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.callbacks.CbTypeIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null !=
- this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ?
- this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt :
- b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: CbTypeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.callbacks.CbTypeList
- };
- h.callbacks.ConstraintCallback = function () {
- h.callbacks.Callback.call(this)
- };
- s["nape.callbacks.ConstraintCallback"] = h.callbacks.ConstraintCallback;
- h.callbacks.ConstraintCallback.__name__ = ["nape", "callbacks", "ConstraintCallback"];
- h.callbacks.ConstraintCallback.__super__ = h.callbacks.Callback;
- h.callbacks.ConstraintCallback.prototype = I(h.callbacks.Callback.prototype, {
- toString: function () {
- var a;
- a = "Cb:" + ["WAKE", "SLEEP", "BREAK"][this.zpp_inner.event -
- c.util.ZPP_Flags.id_CbEvent_WAKE
- ];
- a += ":" + this.zpp_inner.constraint.outer.toString();
- return a += " : listener: " + K.string(this.zpp_inner.listener.outer)
- },
- get_constraint: function () {
- return this.zpp_inner.constraint.outer
- },
- __class__: h.callbacks.ConstraintCallback
- });
- h.callbacks.ConstraintListener = function (a, b, d, g) {
- null == g && (g = 0);
- this.zpp_inner_zn = null;
- c.callbacks.ZPP_Listener.internal = !0;
- h.callbacks.Listener.call(this);
- c.callbacks.ZPP_Listener.internal = !1;
- if (null == d) throw "Error: ConstraintListener::handler cannot be null";
- var e = -1;
- 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);
- if (a == c.util.ZPP_Flags.CbEvent_WAKE) e = c.util.ZPP_Flags.id_CbEvent_WAKE;
- 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;
- else if (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 == c.util.ZPP_Flags.CbEvent_BREAK) e = c.util.ZPP_Flags.id_CbEvent_BREAK;
- else throw "Error: cbEvent '" + a.toString() + "' is not a valid event type for a ConstraintListener";
- this.zpp_inner = this.zpp_inner_zn = new c.callbacks.ZPP_ConstraintListener(c.callbacks.ZPP_OptionType.argument(b), e, d);
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- this.zpp_inner.precedence = g
- };
- s["nape.callbacks.ConstraintListener"] =
- h.callbacks.ConstraintListener;
- h.callbacks.ConstraintListener.__name__ = ["nape", "callbacks", "ConstraintListener"];
- h.callbacks.ConstraintListener.__super__ = h.callbacks.Listener;
- h.callbacks.ConstraintListener.prototype = I(h.callbacks.Listener.prototype, {
- set_handler: function (a) {
- if (null == a) throw "Error: ConstraintListener::handler cannot be null";
- this.zpp_inner_zn.handler = a;
- return this.zpp_inner_zn.handler
- },
- get_handler: function () {
- return this.zpp_inner_zn.handler
- },
- set_options: function (a) {
- this.zpp_inner_zn.options.set(a.zpp_inner);
- return this.zpp_inner_zn.options.outer
- },
- get_options: function () {
- return this.zpp_inner_zn.options.outer
- },
- __class__: h.callbacks.ConstraintListener
- });
- h.callbacks.InteractionCallback = function () {
- h.callbacks.Callback.call(this)
- };
- s["nape.callbacks.InteractionCallback"] = h.callbacks.InteractionCallback;
- h.callbacks.InteractionCallback.__name__ = ["nape", "callbacks", "InteractionCallback"];
- h.callbacks.InteractionCallback.__super__ = h.callbacks.Callback;
- h.callbacks.InteractionCallback.prototype = I(h.callbacks.Callback.prototype, {
- toString: function () {
- var a;
- a = "Cb:" + "BEGIN END ONGOING".split(" ")[this.zpp_inner.event];
- a += ":" + this.zpp_inner.int1.outer_i.toString() + "/" + this.zpp_inner.int2.outer_i.toString();
- a += " : " + this.zpp_inner.wrap_arbiters.toString();
- return a += " : listener: " + K.string(this.zpp_inner.listener.outer)
- },
- get_arbiters: function () {
- return this.zpp_inner.wrap_arbiters
- },
- get_int2: function () {
- return this.zpp_inner.int2.outer_i
- },
- get_int1: function () {
- return this.zpp_inner.int1.outer_i
- },
- __class__: h.callbacks.InteractionCallback
- });
- h.callbacks.InteractionListener = function (a, b, d, g, e, f) {
- null == f && (f = 0);
- this.zpp_inner_zn = null;
- c.callbacks.ZPP_Listener.internal = !0;
- h.callbacks.Listener.call(this);
- c.callbacks.ZPP_Listener.internal = !1;
- if (null == e) throw "Error: InteractionListener::handler cannot be null";
- if (null == a) throw "Error: CbEvent cannot be null for InteractionListener";
- var l = -1;
- 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);
- if (a == c.util.ZPP_Flags.CbEvent_BEGIN) l = c.util.ZPP_Flags.id_CbEvent_BEGIN;
- 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;
- 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;
- else throw "Error: CbEvent '" + a.toString() + "' is not a valid event type for InteractionListener";
- 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);
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zni = this;
- this.zpp_inner.precedence = f;
- this.zpp_inner_zn.handleri = e;
- this.set_interactionType(b)
- };
- s["nape.callbacks.InteractionListener"] = h.callbacks.InteractionListener;
- h.callbacks.InteractionListener.__name__ = ["nape", "callbacks", "InteractionListener"];
- h.callbacks.InteractionListener.__super__ = h.callbacks.Listener;
- h.callbacks.InteractionListener.prototype = I(h.callbacks.Listener.prototype, {
- set_allowSleepingCallbacks: function (a) {
- this.zpp_inner_zn.allowSleepingCallbacks = a;
- return this.zpp_inner_zn.allowSleepingCallbacks
- },
- get_allowSleepingCallbacks: function () {
- return this.zpp_inner_zn.allowSleepingCallbacks
- },
- set_handler: function (a) {
- if (null == a) throw "Error: InteractionListener::handler cannot be null";
- this.zpp_inner_zn.handleri = a;
- return this.zpp_inner_zn.handleri
- },
- get_handler: function () {
- return this.zpp_inner_zn.handleri
- },
- set_interactionType: function (a) {
- if (null == a) throw "Error: Cannot set listener interaction type to null";
- 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 :
- (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 :
- c.util.ZPP_Flags.id_InteractionType_ANY)), this.zpp_inner_zn.itype = a);
- return this.get_interactionType()
- },
- get_interactionType: function () {
- var a = this.zpp_inner_zn.itype;
- 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 &&
- (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 &&
- (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;
- return a
- },
- set_options2: function (a) {
- this.zpp_inner_zn.options2.set(a.zpp_inner);
- return this.zpp_inner_zn.options2.outer
- },
- get_options2: function () {
- return this.zpp_inner_zn.options2.outer
- },
- set_options1: function (a) {
- this.zpp_inner_zn.options1.set(a.zpp_inner);
- return this.zpp_inner_zn.options1.outer
- },
- get_options1: function () {
- return this.zpp_inner_zn.options1.outer
- },
- __class__: h.callbacks.InteractionListener
- });
- h.callbacks.InteractionType = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate InteractionType derp!";
- };
- s["nape.callbacks.InteractionType"] = h.callbacks.InteractionType;
- h.callbacks.InteractionType.__name__ = ["nape", "callbacks", "InteractionType"];
- h.callbacks.InteractionType.get_COLLISION = function () {
- 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);
- return c.util.ZPP_Flags.InteractionType_COLLISION
- };
- h.callbacks.InteractionType.get_SENSOR = function () {
- 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);
- return c.util.ZPP_Flags.InteractionType_SENSOR
- };
- h.callbacks.InteractionType.get_FLUID = function () {
- 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);
- return c.util.ZPP_Flags.InteractionType_FLUID
- };
- h.callbacks.InteractionType.get_ANY = function () {
- 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);
- return c.util.ZPP_Flags.InteractionType_ANY
- };
- h.callbacks.InteractionType.prototype = {
- toString: function () {
- var 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);
- 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 =
- 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" : "")));
- return a
- },
- __class__: h.callbacks.InteractionType
- };
- h.callbacks.ListenerIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner =
- null;
- if (!c.util.ZPP_ListenerList.internal) throw "Error: Cannot instantiate ListenerIterator derp!";
- };
- s["nape.callbacks.ListenerIterator"] = h.callbacks.ListenerIterator;
- h.callbacks.ListenerIterator.__name__ = ["nape", "callbacks", "ListenerIterator"];
- h.callbacks.ListenerIterator.get = function (a) {
- var b = null == h.callbacks.ListenerIterator.zpp_pool ? function (a) {
- c.util.ZPP_ListenerList.internal = !0;
- a = new h.callbacks.ListenerIterator;
- c.util.ZPP_ListenerList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.callbacks.ListenerIterator.zpp_pool;
- h.callbacks.ListenerIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.callbacks.ListenerIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.callbacks.ListenerIterator.zpp_pool;
- h.callbacks.ListenerIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.callbacks.ListenerIterator
- };
- h.callbacks.ListenerList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_ListenerList;
- this.zpp_inner.outer = this
- };
- s["nape.callbacks.ListenerList"] = h.callbacks.ListenerList;
- h.callbacks.ListenerList.__name__ = ["nape", "callbacks", "ListenerList"];
- h.callbacks.ListenerList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.callbacks.ListenerList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.callbacks.ListenerList.prototype = {
- filter: function (a) {
- if (null ==
- a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.callbacks.ListenerIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.callbacks.ListenerIterator.zpp_pool;
- h.callbacks.ListenerIterator.zpp_pool = b;
- b.zpp_inner =
- null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.callbacks.ListenerIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.callbacks.ListenerIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.callbacks.ListenerList,
- d;
- this.zpp_inner.valmod();
- for (d = h.callbacks.ListenerIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Listener is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.callbacks.ListenerIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ?
- this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt :
- b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ListenerList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.callbacks.ListenerList
- };
- h.callbacks.ListenerType = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ListenerType derp!";
- };
- s["nape.callbacks.ListenerType"] = h.callbacks.ListenerType;
- h.callbacks.ListenerType.__name__ = ["nape", "callbacks", "ListenerType"];
- h.callbacks.ListenerType.get_BODY = function () {
- 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);
- return c.util.ZPP_Flags.ListenerType_BODY
- };
- h.callbacks.ListenerType.get_CONSTRAINT = function () {
- 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);
- return c.util.ZPP_Flags.ListenerType_CONSTRAINT
- };
- h.callbacks.ListenerType.get_INTERACTION = function () {
- 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);
- return c.util.ZPP_Flags.ListenerType_INTERACTION
- };
- h.callbacks.ListenerType.get_PRE = function () {
- 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);
- return c.util.ZPP_Flags.ListenerType_PRE
- };
- h.callbacks.ListenerType.prototype = {
- toString: function () {
- 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);
- var a;
- 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" : "")));
- return a
- },
- __class__: h.callbacks.ListenerType
- };
- h.callbacks.OptionType = function (a, b) {
- this.zpp_inner = null;
- this.zpp_inner = new c.callbacks.ZPP_OptionType;
- this.zpp_inner.outer = this;
- null != a && this.including(a);
- null != b && this.excluding(b)
- };
- s["nape.callbacks.OptionType"] = h.callbacks.OptionType;
- h.callbacks.OptionType.__name__ = ["nape", "callbacks", "OptionType"];
- h.callbacks.OptionType.prototype = {
- toString: function () {
- null == this.zpp_inner.wrap_includes && this.zpp_inner.setup_includes();
- var a = this.zpp_inner.wrap_includes.toString();
- null == this.zpp_inner.wrap_excludes && this.zpp_inner.setup_excludes();
- return "@{" + a + " excluding " + this.zpp_inner.wrap_excludes.toString() + "}"
- },
- excluding: function (a) {
- this.zpp_inner.append(this.zpp_inner.excludes, a);
- return this
- },
- including: function (a) {
- this.zpp_inner.append(this.zpp_inner.includes, a);
- return this
- },
- get_excludes: function () {
- null == this.zpp_inner.wrap_excludes && this.zpp_inner.setup_excludes();
- return this.zpp_inner.wrap_excludes
- },
- get_includes: function () {
- null == this.zpp_inner.wrap_includes && this.zpp_inner.setup_includes();
- return this.zpp_inner.wrap_includes
- },
- __class__: h.callbacks.OptionType
- };
- h.callbacks.PreCallback = function () {
- h.callbacks.Callback.call(this)
- };
- s["nape.callbacks.PreCallback"] = h.callbacks.PreCallback;
- h.callbacks.PreCallback.__name__ = ["nape", "callbacks", "PreCallback"];
- h.callbacks.PreCallback.__super__ = h.callbacks.Callback;
- h.callbacks.PreCallback.prototype = I(h.callbacks.Callback.prototype, {
- toString: function () {
- var a;
- a = "Cb:PRE:" + (":" + this.zpp_inner.int1.outer_i.toString() + "/" + this.zpp_inner.int2.outer_i.toString());
- a += " : " + this.zpp_inner.pre_arbiter.wrapper().toString();
- return a += " : listnener: " + K.string(this.zpp_inner.listener.outer)
- },
- get_swapped: function () {
- return this.zpp_inner.pre_swapped
- },
- get_int2: function () {
- return this.zpp_inner.int2.outer_i
- },
- get_int1: function () {
- return this.zpp_inner.int1.outer_i
- },
- get_arbiter: function () {
- return this.zpp_inner.pre_arbiter.wrapper()
- },
- __class__: h.callbacks.PreCallback
- });
- h.callbacks.PreFlag = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate PreFlag derp!";
- };
- s["nape.callbacks.PreFlag"] = h.callbacks.PreFlag;
- h.callbacks.PreFlag.__name__ = ["nape", "callbacks", "PreFlag"];
- h.callbacks.PreFlag.get_ACCEPT = function () {
- 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);
- return c.util.ZPP_Flags.PreFlag_ACCEPT
- };
- h.callbacks.PreFlag.get_IGNORE = function () {
- 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);
- return c.util.ZPP_Flags.PreFlag_IGNORE
- };
- h.callbacks.PreFlag.get_ACCEPT_ONCE = function () {
- 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);
- return c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE
- };
- h.callbacks.PreFlag.get_IGNORE_ONCE = function () {
- 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);
- return c.util.ZPP_Flags.PreFlag_IGNORE_ONCE
- };
- h.callbacks.PreFlag.prototype = {
- toString: function () {
- var a;
- 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);
- 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" :
- (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" : "")));
- return a
- },
- __class__: h.callbacks.PreFlag
- };
- h.callbacks.PreListener = function (a, b, d, g, e, f) {
- null == f && (f = !1);
- null == e && (e = 0);
- this.zpp_inner_zn = null;
- c.callbacks.ZPP_Listener.internal = !0;
- h.callbacks.Listener.call(this);
- c.callbacks.ZPP_Listener.internal = !1;
- if (null == g) throw "Error: PreListener must take a handler!";
- 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);
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_znp = this;
- this.zpp_inner.precedence = e;
- this.zpp_inner_zn.pure = f;
- this.zpp_inner_zn.handlerp = g;
- this.set_interactionType(a)
- };
- s["nape.callbacks.PreListener"] = h.callbacks.PreListener;
- h.callbacks.PreListener.__name__ = ["nape", "callbacks", "PreListener"];
- h.callbacks.PreListener.__super__ = h.callbacks.Listener;
- h.callbacks.PreListener.prototype = I(h.callbacks.Listener.prototype, {
- set_interactionType: function (a) {
- if (null == a) throw "Error: Cannot set listener interaction type to null";
- 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 :
- (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 :
- c.util.ZPP_Flags.id_InteractionType_ANY)), this.zpp_inner_zn.itype = a);
- return this.get_interactionType()
- },
- get_interactionType: function () {
- var a = this.zpp_inner_zn.itype;
- 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 &&
- (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 &&
- (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;
- return a
- },
- set_pure: function (a) {
- a || this.zpp_inner_zn.wake();
- this.zpp_inner_zn.pure = a;
- return this.zpp_inner_zn.pure
- },
- get_pure: function () {
- return this.zpp_inner_zn.pure
- },
- set_handler: function (a) {
- if (null == a) throw "Error: PreListener must take a non-null handler!";
- this.zpp_inner_zn.handlerp = a;
- this.zpp_inner_zn.wake();
- return this.zpp_inner_zn.handlerp
- },
- get_handler: function () {
- return this.zpp_inner_zn.handlerp
- },
- set_options2: function (a) {
- this.zpp_inner_zn.options2.set(a.zpp_inner);
- return this.zpp_inner_zn.options2.outer
- },
- get_options2: function () {
- return this.zpp_inner_zn.options2.outer
- },
- set_options1: function (a) {
- this.zpp_inner_zn.options1.set(a.zpp_inner);
- return this.zpp_inner_zn.options1.outer
- },
- get_options1: function () {
- return this.zpp_inner_zn.options1.outer
- },
- __class__: h.callbacks.PreListener
- });
- h.constraint = {};
- h.constraint.Constraint = function () {
- this.debugDraw = !0;
- this.zpp_inner.insert_cbtype(c.callbacks.ZPP_CbType.ANY_CONSTRAINT.zpp_inner);
- throw "Error: Constraint cannot be instantiated derp!";
- };
- s["nape.constraint.Constraint"] = h.constraint.Constraint;
- h.constraint.Constraint.__name__ = ["nape", "constraint", "Constraint"];
- h.constraint.Constraint.prototype = {
- copy: function () {
- return this.zpp_inner.copy()
- },
- toString: function () {
- return "{Constraint}"
- },
- get_cbTypes: function () {
- null == this.zpp_inner.wrap_cbTypes && this.zpp_inner.setupcbTypes();
- return this.zpp_inner.wrap_cbTypes
- },
- visitBodies: function (a) {},
- bodyImpulse: function (a) {
- return null
- },
- impulse: function () {
- return null
- },
- set_removeOnBreak: function (a) {
- this.zpp_inner.removeOnBreak = a;
- return this.zpp_inner.removeOnBreak
- },
- get_removeOnBreak: function () {
- return this.zpp_inner.removeOnBreak
- },
- set_breakUnderError: function (a) {
- this.zpp_inner.breakUnderError != a && (this.zpp_inner.breakUnderError = a, this.zpp_inner.wake());
- return this.zpp_inner.breakUnderError
- },
- get_breakUnderError: function () {
- return this.zpp_inner.breakUnderError
- },
- set_breakUnderForce: function (a) {
- this.zpp_inner.breakUnderForce !=
- a && (this.zpp_inner.breakUnderForce = a, this.zpp_inner.wake());
- return this.zpp_inner.breakUnderForce
- },
- get_breakUnderForce: function () {
- return this.zpp_inner.breakUnderForce
- },
- set_maxError: function (a) {
- if (a != a) throw "Error: Constraint::maxError cannot be NaN";
- if (0 > a) throw "Error: Constraint::maxError must be >=0";
- this.zpp_inner.maxError != a && (this.zpp_inner.maxError = a, this.zpp_inner.wake());
- return this.zpp_inner.maxError
- },
- get_maxError: function () {
- return this.zpp_inner.maxError
- },
- set_maxForce: function (a) {
- if (a !=
- a) throw "Error: Constraint::maxForce cannot be NaN";
- if (0 > a) throw "Error: Constraint::maxForce must be >=0";
- this.zpp_inner.maxForce != a && (this.zpp_inner.maxForce = a, this.zpp_inner.wake());
- return this.zpp_inner.maxForce
- },
- get_maxForce: function () {
- return this.zpp_inner.maxForce
- },
- set_damping: function (a) {
- if (a != a) throw "Error: Constraint::Damping cannot be Nan";
- if (0 > a) throw "Error: Constraint::Damping must be >=0";
- this.zpp_inner.damping != a && (this.zpp_inner.damping = a, this.zpp_inner.stiff || this.zpp_inner.wake());
- return this.zpp_inner.damping
- },
- get_damping: function () {
- return this.zpp_inner.damping
- },
- set_frequency: function (a) {
- if (a != a) throw "Error: Constraint::Frequency cannot be NaN";
- if (0 >= a) throw "Error: Constraint::Frequency must be >0";
- this.zpp_inner.frequency != a && (this.zpp_inner.frequency = a, this.zpp_inner.stiff || this.zpp_inner.wake());
- return this.zpp_inner.frequency
- },
- get_frequency: function () {
- return this.zpp_inner.frequency
- },
- set_stiff: function (a) {
- this.zpp_inner.stiff != a && (this.zpp_inner.stiff = a, this.zpp_inner.wake());
- return this.zpp_inner.stiff
- },
- get_stiff: function () {
- return this.zpp_inner.stiff
- },
- set_ignore: function (a) {
- this.zpp_inner.ignore != a && (this.zpp_inner.ignore = a, this.zpp_inner.wake());
- return this.zpp_inner.ignore
- },
- get_ignore: function () {
- return this.zpp_inner.ignore
- },
- set_active: function (a) {
- 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 &&
- (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()));
- return this.zpp_inner.active
- },
- get_active: function () {
- return this.zpp_inner.active
- },
- get_isSleeping: function () {
- if (null == this.zpp_inner.space || !this.zpp_inner.active) throw "Error: isSleeping only makes sense if constraint is active and inside a space";
- return this.zpp_inner.component.sleeping
- },
- set_space: function (a) {
- 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";
- (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) :
- this.zpp_inner.space = null);
- return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
- },
- get_space: function () {
- return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
- },
- set_compound: function (a) {
- (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));
- return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
- },
- get_compound: function () {
- return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
- },
- get_userData: function () {
- null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
- return this.zpp_inner.userData
- },
- __class__: h.constraint.Constraint
- };
- h.constraint.AngleJoint = function (a, b, d, g, e) {
- null == e && (e = 1);
- this.zpp_inner_zn = null;
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_AngleJoint;
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn =
- this;
- try {
- h.constraint.Constraint.call(this)
- } catch (f) {}
- this.set_body1(a);
- this.set_body2(b);
- this.zpp_inner.immutable_midstep("AngleJoint::jointMin");
- if (d != d) throw "Error: AngleJoint::jointMin cannot be NaN";
- this.zpp_inner_zn.jointMin != d && (this.zpp_inner_zn.jointMin = d, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMin;
- this.zpp_inner.immutable_midstep("AngleJoint::jointMax");
- if (g != g) throw "Error: AngleJoint::jointMax cannot be NaN";
- this.zpp_inner_zn.jointMax != g && (this.zpp_inner_zn.jointMax = g, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMax;
- this.zpp_inner.immutable_midstep("AngleJoint::ratio");
- if (e != e) throw "Error: AngleJoint::ratio cannot be NaN";
- this.zpp_inner_zn.ratio != e && (this.zpp_inner_zn.ratio = e, this.zpp_inner.wake());
- this.zpp_inner_zn.ratio
- };
- s["nape.constraint.AngleJoint"] = h.constraint.AngleJoint;
- h.constraint.AngleJoint.__name__ = ["nape", "constraint", "AngleJoint"];
- h.constraint.AngleJoint.__super__ = h.constraint.Constraint;
- h.constraint.AngleJoint.prototype = I(h.constraint.Constraint.prototype, {
- visitBodies: function (a) {
- if (null ==
- a) throw "Error: Cannot apply null lambda to bodies";
- 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);
- 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)
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- 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";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get(0, 0, 0)
- },
- impulse: function () {
- var a = new h.geom.MatMN(1, 1);
- if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
- return a
- },
- isSlack: function () {
- 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 AngleJoint if either body is null.";
- return this.zpp_inner_zn.is_slack()
- },
- set_ratio: function (a) {
- this.zpp_inner.immutable_midstep("AngleJoint::ratio");
- if (a != a) throw "Error: AngleJoint::ratio cannot be NaN";
- this.zpp_inner_zn.ratio != a && (this.zpp_inner_zn.ratio = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.ratio
- },
- get_ratio: function () {
- return this.zpp_inner_zn.ratio
- },
- set_jointMax: function (a) {
- this.zpp_inner.immutable_midstep("AngleJoint::jointMax");
- if (a != a) throw "Error: AngleJoint::jointMax cannot be NaN";
- this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMax
- },
- get_jointMax: function () {
- return this.zpp_inner_zn.jointMax
- },
- set_jointMin: function (a) {
- this.zpp_inner.immutable_midstep("AngleJoint::jointMin");
- if (a != a) throw "Error: AngleJoint::jointMin cannot be NaN";
- this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin =
- a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMin
- },
- get_jointMin: function () {
- return this.zpp_inner_zn.jointMin
- },
- set_body2: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body2");
- a = null == a ? null : a.zpp_inner;
- 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 !=
- (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()));
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- get_body2: function () {
- return null == this.zpp_inner_zn.b2 ?
- null : this.zpp_inner_zn.b2.outer
- },
- set_body1: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body1");
- a = null == a ? null : a.zpp_inner;
- 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()),
- 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()));
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- get_body1: function () {
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- __class__: h.constraint.AngleJoint
- });
- h.constraint.ConstraintIterator =
- function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_ConstraintList.internal) throw "Error: Cannot instantiate ConstraintIterator derp!";
- };
- s["nape.constraint.ConstraintIterator"] = h.constraint.ConstraintIterator;
- h.constraint.ConstraintIterator.__name__ = ["nape", "constraint", "ConstraintIterator"];
- h.constraint.ConstraintIterator.get = function (a) {
- var b = null == h.constraint.ConstraintIterator.zpp_pool ? function (a) {
- c.util.ZPP_ConstraintList.internal = !0;
- a = new h.constraint.ConstraintIterator;
- c.util.ZPP_ConstraintList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.constraint.ConstraintIterator.zpp_pool;
- h.constraint.ConstraintIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.constraint.ConstraintIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.constraint.ConstraintIterator.zpp_pool;
- h.constraint.ConstraintIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.constraint.ConstraintIterator
- };
- h.constraint.ConstraintList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_ConstraintList;
- this.zpp_inner.outer = this
- };
- s["nape.constraint.ConstraintList"] = h.constraint.ConstraintList;
- h.constraint.ConstraintList.__name__ = ["nape", "constraint", "ConstraintList"];
- h.constraint.ConstraintList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.constraint.ConstraintList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.constraint.ConstraintList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.constraint.ConstraintIterator.get(this); b.hasNext();) try {
- var d =
- a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.constraint.ConstraintIterator.zpp_pool;
- h.constraint.ConstraintIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.constraint.ConstraintIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.constraint.ConstraintIterator.get(a); a.hasNext();) {
- var b =
- a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.constraint.ConstraintList,
- d;
- this.zpp_inner.valmod();
- for (d = h.constraint.ConstraintIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Constraint is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.constraint.ConstraintIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ?
- null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
- 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ConstraintList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
- !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length &&
- (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.constraint.ConstraintList
- };
- h.constraint.DistanceJoint = function (a, b, d, g, e, f) {
- this.zpp_inner_zn = null;
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_DistanceJoint;
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- try {
- h.constraint.Constraint.call(this)
- } catch (l) {}
- this.set_body1(a);
- this.set_body2(b);
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == d) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(d);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1;
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == g) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(g);
- null == this.zpp_inner_zn.wrap_a2 &&
- this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2;
- this.zpp_inner.immutable_midstep("DistanceJoint::jointMin");
- if (e != e) throw "Error: DistanceJoint::jointMin cannot be NaN";
- if (0 > e) throw "Error: DistanceJoint::jointMin must be >= 0";
- this.zpp_inner_zn.jointMin != e && (this.zpp_inner_zn.jointMin = e, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMin;
- this.zpp_inner.immutable_midstep("DistanceJoint::jointMax");
- if (f != f) throw "Error: DistanceJoint::jointMax cannot be NaN";
- if (0 > f) throw "Error: DistanceJoint::jointMax must be >= 0";
- this.zpp_inner_zn.jointMax != f && (this.zpp_inner_zn.jointMax = f, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMax
- };
- s["nape.constraint.DistanceJoint"] = h.constraint.DistanceJoint;
- h.constraint.DistanceJoint.__name__ = ["nape", "constraint", "DistanceJoint"];
- h.constraint.DistanceJoint.__super__ = h.constraint.Constraint;
- h.constraint.DistanceJoint.prototype = I(h.constraint.Constraint.prototype, {
- visitBodies: function (a) {
- 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);
- 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)
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- 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";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
- },
- impulse: function () {
- var a = new h.geom.MatMN(1, 1);
- if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
- return a
- },
- isSlack: function () {
- 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.";
- return this.zpp_inner_zn.slack
- },
- set_jointMax: function (a) {
- this.zpp_inner.immutable_midstep("DistanceJoint::jointMax");
- if (a != a) throw "Error: DistanceJoint::jointMax cannot be NaN";
- if (0 > a) throw "Error: DistanceJoint::jointMax must be >= 0";
- this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMax
- },
- get_jointMax: function () {
- return this.zpp_inner_zn.jointMax
- },
- set_jointMin: function (a) {
- this.zpp_inner.immutable_midstep("DistanceJoint::jointMin");
- if (a !=
- a) throw "Error: DistanceJoint::jointMin cannot be NaN";
- if (0 > a) throw "Error: DistanceJoint::jointMin must be >= 0";
- this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMin
- },
- get_jointMin: function () {
- return this.zpp_inner_zn.jointMin
- },
- set_anchor2: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(a);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- get_anchor2: function () {
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- set_anchor1: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(a);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- get_anchor1: function () {
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- set_body2: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body2");
- a = null == a ? null : a.zpp_inner;
- 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 != (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()));
- return null == this.zpp_inner_zn.b2 ?
- null : this.zpp_inner_zn.b2.outer
- },
- get_body2: function () {
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- set_body1: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body1");
- a = null == a ? null : a.zpp_inner;
- 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()), 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()));
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- get_body1: function () {
- return null == this.zpp_inner_zn.b1 ?
- null : this.zpp_inner_zn.b1.outer
- },
- __class__: h.constraint.DistanceJoint
- });
- h.constraint.LineJoint = function (a, b, d, g, e, f, l) {
- this.zpp_inner_zn = null;
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_LineJoint;
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- try {
- h.constraint.Constraint.call(this)
- } catch (m) {}
- this.set_body1(a);
- this.set_body2(b);
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == d) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 &&
- this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(d);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1;
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == g) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(g);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2;
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == e) throw "Error: Constraint::direction cannot be null";
- null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
- this.zpp_inner_zn.wrap_n.set(e);
- null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
- this.zpp_inner_zn.wrap_n;
- this.zpp_inner.immutable_midstep("LineJoint::jointMin");
- if (f != f) throw "Error: AngleJoint::jointMin cannot be NaN";
- this.zpp_inner_zn.jointMin != f && (this.zpp_inner_zn.jointMin = f, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMin;
- this.zpp_inner.immutable_midstep("LineJoint::jointMax");
- if (l != l) throw "Error: AngleJoint::jointMax cannot be NaN";
- this.zpp_inner_zn.jointMax != l && (this.zpp_inner_zn.jointMax = l, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMax
- };
- s["nape.constraint.LineJoint"] = h.constraint.LineJoint;
- h.constraint.LineJoint.__name__ = ["nape", "constraint", "LineJoint"];
- h.constraint.LineJoint.__super__ = h.constraint.Constraint;
- h.constraint.LineJoint.prototype = I(h.constraint.Constraint.prototype, {
- visitBodies: function (a) {
- 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);
- 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)
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- 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";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
- },
- impulse: function () {
- var a = new h.geom.MatMN(2, 1);
- if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAccx;
- if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccy;
- return a
- },
- set_jointMax: function (a) {
- this.zpp_inner.immutable_midstep("LineJoint::jointMax");
- if (a != a) throw "Error: AngleJoint::jointMax cannot be NaN";
- this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMax
- },
- get_jointMax: function () {
- return this.zpp_inner_zn.jointMax
- },
- set_jointMin: function (a) {
- this.zpp_inner.immutable_midstep("LineJoint::jointMin");
- if (a != a) throw "Error: AngleJoint::jointMin cannot be NaN";
- this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMin
- },
- get_jointMin: function () {
- return this.zpp_inner_zn.jointMin
- },
- set_direction: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::direction cannot be null";
- null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
- this.zpp_inner_zn.wrap_n.set(a);
- null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
- return this.zpp_inner_zn.wrap_n
- },
- get_direction: function () {
- null == this.zpp_inner_zn.wrap_n && this.zpp_inner_zn.setup_n();
- return this.zpp_inner_zn.wrap_n
- },
- set_anchor2: function (a) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(a);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- get_anchor2: function () {
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- set_anchor1: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(a);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- get_anchor1: function () {
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- set_body2: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body2");
- a = null == a ? null : a.zpp_inner;
- 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 != (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()));
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- get_body2: function () {
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- set_body1: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body1");
- a = null == a ? null : a.zpp_inner;
- 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()), 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()));
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- get_body1: function () {
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- __class__: h.constraint.LineJoint
- });
- h.constraint.MotorJoint = function (a, b, d, g) {
- null == g && (g = 1);
- null == d && (d = 0);
- this.zpp_inner_zn = null;
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_MotorJoint;
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- try {
- h.constraint.Constraint.call(this)
- } catch (e) {}
- this.set_body1(a);
- this.set_body2(b);
- this.zpp_inner.immutable_midstep("MotorJoint::rate");
- if (d != d) throw "Error: MotorJoint::rate cannot be NaN";
- this.zpp_inner_zn.rate != d && (this.zpp_inner_zn.rate = d, this.zpp_inner.wake());
- this.zpp_inner_zn.rate;
- this.zpp_inner.immutable_midstep("MotorJoint::ratio");
- if (g != g) throw "Error: MotorJoint::ratio cannot be NaN";
- this.zpp_inner_zn.ratio != g && (this.zpp_inner_zn.ratio = g, this.zpp_inner.wake());
- this.zpp_inner_zn.ratio
- };
- s["nape.constraint.MotorJoint"] = h.constraint.MotorJoint;
- h.constraint.MotorJoint.__name__ = ["nape", "constraint", "MotorJoint"];
- h.constraint.MotorJoint.__super__ = h.constraint.Constraint;
- h.constraint.MotorJoint.prototype = I(h.constraint.Constraint.prototype, {
- visitBodies: function (a) {
- 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);
- 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)
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- 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";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
- },
- impulse: function () {
- var a = new h.geom.MatMN(1, 1);
- if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
- return a
- },
- set_rate: function (a) {
- this.zpp_inner.immutable_midstep("MotorJoint::rate");
- if (a != a) throw "Error: MotorJoint::rate cannot be NaN";
- this.zpp_inner_zn.rate != a && (this.zpp_inner_zn.rate = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.rate
- },
- get_rate: function () {
- return this.zpp_inner_zn.rate
- },
- set_ratio: function (a) {
- this.zpp_inner.immutable_midstep("MotorJoint::ratio");
- if (a != a) throw "Error: MotorJoint::ratio cannot be NaN";
- this.zpp_inner_zn.ratio !=
- a && (this.zpp_inner_zn.ratio = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.ratio
- },
- get_ratio: function () {
- return this.zpp_inner_zn.ratio
- },
- set_body2: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body2");
- a = null == a ? null : a.zpp_inner;
- 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 != (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()));
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- get_body2: function () {
- return null == this.zpp_inner_zn.b2 ?
- null : this.zpp_inner_zn.b2.outer
- },
- set_body1: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body1");
- a = null == a ? null : a.zpp_inner;
- 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()),
- 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()));
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- get_body1: function () {
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- __class__: h.constraint.MotorJoint
- });
- h.constraint.PivotJoint =
- function (a, b, d, g) {
- this.zpp_inner_zn = null;
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_PivotJoint;
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- try {
- h.constraint.Constraint.call(this)
- } catch (e) {}
- this.set_body1(a);
- this.set_body2(b);
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == d) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(d);
- null == this.zpp_inner_zn.wrap_a1 &&
- this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1;
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == g) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(g);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2
- };
- s["nape.constraint.PivotJoint"] = h.constraint.PivotJoint;
- h.constraint.PivotJoint.__name__ = ["nape", "constraint", "PivotJoint"];
- h.constraint.PivotJoint.__super__ = h.constraint.Constraint;
- h.constraint.PivotJoint.prototype = I(h.constraint.Constraint.prototype, {
- visitBodies: function (a) {
- 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);
- 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)
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- 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";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
- },
- impulse: function () {
- var a = new h.geom.MatMN(2, 1);
- if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAccx;
- if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccy;
- return a
- },
- set_anchor2: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(a);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- get_anchor2: function () {
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- set_anchor1: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(a);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- get_anchor1: function () {
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- set_body2: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body2");
- a = null == a ? null : a.zpp_inner;
- 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 !=
- (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()));
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- get_body2: function () {
- return null == this.zpp_inner_zn.b2 ?
- null : this.zpp_inner_zn.b2.outer
- },
- set_body1: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body1");
- a = null == a ? null : a.zpp_inner;
- 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()),
- 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()));
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- get_body1: function () {
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- __class__: h.constraint.PivotJoint
- });
- h.constraint.PulleyJoint =
- function (a, b, d, g, e, f, l, m, u, p, C) {
- null == C && (C = 1);
- this.zpp_inner_zn = null;
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_PulleyJoint;
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- try {
- h.constraint.Constraint.call(this)
- } catch (r) {}
- this.set_body1(a);
- this.set_body2(b);
- this.set_body3(d);
- this.set_body4(g);
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == e) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(e);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == f) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(f);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2;
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == l) throw "Error: Constraint::anchor3 cannot be null";
- null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
- this.zpp_inner_zn.wrap_a3.set(l);
- null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
- this.zpp_inner_zn.wrap_a3;
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == m) throw "Error: Constraint::anchor4 cannot be null";
- null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
- this.zpp_inner_zn.wrap_a4.set(m);
- null == this.zpp_inner_zn.wrap_a4 &&
- this.zpp_inner_zn.setup_a4();
- this.zpp_inner_zn.wrap_a4;
- this.zpp_inner.immutable_midstep("PulleyJoint::ratio");
- if (C != C) throw "Error: PulleyJoint::ratio cannot be NaN";
- this.zpp_inner_zn.ratio != C && (this.zpp_inner_zn.ratio = C, this.zpp_inner.wake());
- this.zpp_inner_zn.ratio;
- this.zpp_inner.immutable_midstep("PulleyJoint::jointMin");
- if (u != u) throw "Error: PulleyJoint::jointMin cannot be NaN";
- if (0 > u) throw "Error: PulleyJoint::jointMin must be >= 0";
- this.zpp_inner_zn.jointMin != u && (this.zpp_inner_zn.jointMin = u, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMin;
- this.zpp_inner.immutable_midstep("PulleyJoint::jointMax");
- if (p != p) throw "Error: PulleyJoint::jointMax cannot be NaN";
- if (0 > p) throw "Error: PulleyJoint::jointMax must be >= 0";
- this.zpp_inner_zn.jointMax != p && (this.zpp_inner_zn.jointMax = p, this.zpp_inner.wake());
- this.zpp_inner_zn.jointMax
- };
- s["nape.constraint.PulleyJoint"] = h.constraint.PulleyJoint;
- h.constraint.PulleyJoint.__name__ = ["nape", "constraint", "PulleyJoint"];
- h.constraint.PulleyJoint.__super__ = h.constraint.Constraint;
- h.constraint.PulleyJoint.prototype =
- I(h.constraint.Constraint.prototype, {
- visitBodies: function (a) {
- 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);
- 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);
- null != (null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer) &&
- (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);
- 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) &&
- (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)
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- 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) && 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";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
- },
- impulse: function () {
- var a = new h.geom.MatMN(1, 1);
- if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAcc;
- return a
- },
- isSlack: function () {
- 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) || 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.";
- return this.zpp_inner_zn.slack
- },
- set_ratio: function (a) {
- this.zpp_inner.immutable_midstep("PulleyJoint::ratio");
- if (a != a) throw "Error: PulleyJoint::ratio cannot be NaN";
- this.zpp_inner_zn.ratio != a && (this.zpp_inner_zn.ratio = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.ratio
- },
- get_ratio: function () {
- return this.zpp_inner_zn.ratio
- },
- set_jointMax: function (a) {
- this.zpp_inner.immutable_midstep("PulleyJoint::jointMax");
- if (a != a) throw "Error: PulleyJoint::jointMax cannot be NaN";
- if (0 > a) throw "Error: PulleyJoint::jointMax must be >= 0";
- this.zpp_inner_zn.jointMax != a && (this.zpp_inner_zn.jointMax = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMax
- },
- get_jointMax: function () {
- return this.zpp_inner_zn.jointMax
- },
- set_jointMin: function (a) {
- this.zpp_inner.immutable_midstep("PulleyJoint::jointMin");
- if (a != a) throw "Error: PulleyJoint::jointMin cannot be NaN";
- if (0 > a) throw "Error: PulleyJoint::jointMin must be >= 0";
- this.zpp_inner_zn.jointMin != a && (this.zpp_inner_zn.jointMin = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.jointMin
- },
- get_jointMin: function () {
- return this.zpp_inner_zn.jointMin
- },
- set_anchor4: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor4 cannot be null";
- null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
- this.zpp_inner_zn.wrap_a4.set(a);
- null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
- return this.zpp_inner_zn.wrap_a4
- },
- get_anchor4: function () {
- null == this.zpp_inner_zn.wrap_a4 && this.zpp_inner_zn.setup_a4();
- return this.zpp_inner_zn.wrap_a4
- },
- set_anchor3: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor3 cannot be null";
- null == this.zpp_inner_zn.wrap_a3 &&
- this.zpp_inner_zn.setup_a3();
- this.zpp_inner_zn.wrap_a3.set(a);
- null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
- return this.zpp_inner_zn.wrap_a3
- },
- get_anchor3: function () {
- null == this.zpp_inner_zn.wrap_a3 && this.zpp_inner_zn.setup_a3();
- return this.zpp_inner_zn.wrap_a3
- },
- set_anchor2: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(a);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- get_anchor2: function () {
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- set_anchor1: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(a);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- get_anchor1: function () {
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- set_body4: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body4");
- a = null == a ? null : a.zpp_inner;
- 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 !=
- 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 &&
- null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
- return null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer
- },
- get_body4: function () {
- return null == this.zpp_inner_zn.b4 ? null : this.zpp_inner_zn.b4.outer
- },
- set_body3: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body3");
- a = null == a ? null : a.zpp_inner;
- 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 !=
- 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),
- this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && (this.zpp_inner.wake(), null != a && a.wake()));
- return null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer
- },
- get_body3: function () {
- return null == this.zpp_inner_zn.b3 ? null : this.zpp_inner_zn.b3.outer
- },
- set_body2: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body2");
- a = null == a ? null : a.zpp_inner;
- 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 && 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 !=
- 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()));
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- get_body2: function () {
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- set_body1: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body1");
- a = null == a ? null : a.zpp_inner;
- 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 && 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 !=
- 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()));
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- get_body1: function () {
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- __class__: h.constraint.PulleyJoint
- });
- h.constraint.UserConstraint = function (a, b) {
- null == b && (b = !1);
- this.zpp_inner_zn = null;
- if (1 > a) throw "Error: Constraint dimension must be at least 1";
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_UserConstraint(a, b);
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- try {
- h.constraint.Constraint.call(this)
- } catch (d) {}
- };
- s["nape.constraint.UserConstraint"] = h.constraint.UserConstraint;
- h.constraint.UserConstraint.__name__ = ["nape", "constraint", "UserConstraint"];
- h.constraint.UserConstraint.__super__ = h.constraint.Constraint;
- h.constraint.UserConstraint.prototype = I(h.constraint.Constraint.prototype, {
- __registerBody: function (a, b) {
- this.zpp_inner.immutable_midstep("UserConstraint::registerBody(..)");
- if (a != b) {
- if (null != a) {
- if (!this.zpp_inner_zn.remBody(a.zpp_inner)) throw "Error: oldBody is not registered to the cosntraint";
- this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && a.zpp_inner.wake()
- }
- null != b && this.zpp_inner_zn.addBody(b.zpp_inner);
- this.zpp_inner.wake();
- null != b && b.zpp_inner.wake()
- }
- return b
- },
- __invalidate: function () {
- this.zpp_inner.immutable_midstep("UserConstraint::invalidate()");
- this.zpp_inner.active && null != (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer) && this.zpp_inner.wake()
- },
- visitBodies: function (a) {
- for (var b = 0, d = this.zpp_inner_zn.bodies.length; b < d;) {
- var c = this.zpp_inner_zn.bodies[b];
- if (null != c.body) {
- for (var e = !1, f = b + 1; f < d;) {
- var l = f++;
- if (this.zpp_inner_zn.bodies[l].body == c.body) {
- e = !0;
- break
- }
- }
- e || a(c.body.outer)
- }
- b++
- }
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- for (var b = !1, d = 0, c = this.zpp_inner_zn.bodies; d < c.length;) {
- var e =
- c[d];
- ++d;
- if (e.body == a.zpp_inner) {
- b = !0;
- break
- }
- }
- if (!b) throw "Error: Body is not linked to this constraint";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
- },
- impulse: function () {
- for (var a = new h.geom.MatMN(this.zpp_inner_zn.dim, 1), b = 0, d = this.zpp_inner_zn.dim; b < d;) {
- var c = b++;
- if (0 > c || c >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[c * a.zpp_inner.n] = this.zpp_inner_zn.jAcc[c]
- }
- return a
- },
- __impulse: function (a, b, d) {
- throw "Error: UserConstraint::__impulse must be overriden";
- },
- __clamp: function (a) {},
- __eff_mass: function (a) {
- throw "Error: UserConstraint::__eff_mass must be overriden";
- },
- __velocity: function (a) {
- throw "Error: Userconstraint::__velocity must be overriden";
- },
- __position: function (a) {
- throw "Error: UserConstraint::__position must be overriden";
- },
- __prepare: function () {},
- __draw: function (a) {},
- __validate: function () {},
- __broken: function () {},
- __copy: function () {
- throw "Error: UserConstraint::__copy must be overriden";
- },
- __bindVec2: function () {
- var a = new h.geom.Vec2;
- a.zpp_inner._inuse = !0;
- a.zpp_inner._invalidate = (da = this.zpp_inner_zn, A(da, da.bindVec2_invalidate));
- return a
- },
- __class__: h.constraint.UserConstraint
- });
- h.constraint.WeldJoint = function (a, b, d, g, e) {
- null == e && (e = 0);
- this.zpp_inner_zn = null;
- this.zpp_inner = this.zpp_inner_zn = new c.constraint.ZPP_WeldJoint;
- this.zpp_inner.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- try {
- h.constraint.Constraint.call(this)
- } catch (f) {}
- this.set_body1(a);
- this.set_body2(b);
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null ==
- d) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(d);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1;
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == g) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(g);
- null == this.zpp_inner_zn.wrap_a2 &&
- this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2;
- this.zpp_inner.immutable_midstep("WeldJoint::phase");
- if (e != e) throw "Error: WeldJoint::phase cannot be NaN";
- this.zpp_inner_zn.phase != e && (this.zpp_inner_zn.phase = e, this.zpp_inner.wake());
- this.zpp_inner_zn.phase
- };
- s["nape.constraint.WeldJoint"] = h.constraint.WeldJoint;
- h.constraint.WeldJoint.__name__ = ["nape", "constraint", "WeldJoint"];
- h.constraint.WeldJoint.__super__ = h.constraint.Constraint;
- h.constraint.WeldJoint.prototype = I(h.constraint.Constraint.prototype, {
- visitBodies: function (a) {
- 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);
- 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)
- },
- bodyImpulse: function (a) {
- if (null == a) throw "Error: Cannot evaluate impulse on null body";
- 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";
- return this.zpp_inner.active ? this.zpp_inner_zn.bodyImpulse(a.zpp_inner) : h.geom.Vec3.get()
- },
- impulse: function () {
- var a = new h.geom.MatMN(3, 1);
- if (0 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[0 * a.zpp_inner.n] = this.zpp_inner_zn.jAccx;
- if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccy;
- if (1 >= a.zpp_inner.m || 0 >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- a.zpp_inner.x[a.zpp_inner.n] = this.zpp_inner_zn.jAccz;
- return a
- },
- set_phase: function (a) {
- this.zpp_inner.immutable_midstep("WeldJoint::phase");
- if (a != a) throw "Error: WeldJoint::phase cannot be NaN";
- this.zpp_inner_zn.phase != a && (this.zpp_inner_zn.phase = a, this.zpp_inner.wake());
- return this.zpp_inner_zn.phase
- },
- get_phase: function () {
- return this.zpp_inner_zn.phase
- },
- set_anchor2: function (a) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor2 cannot be null";
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- this.zpp_inner_zn.wrap_a2.set(a);
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- get_anchor2: function () {
- null == this.zpp_inner_zn.wrap_a2 && this.zpp_inner_zn.setup_a2();
- return this.zpp_inner_zn.wrap_a2
- },
- set_anchor1: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Constraint::anchor1 cannot be null";
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- this.zpp_inner_zn.wrap_a1.set(a);
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- get_anchor1: function () {
- null == this.zpp_inner_zn.wrap_a1 && this.zpp_inner_zn.setup_a1();
- return this.zpp_inner_zn.wrap_a1
- },
- set_body2: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body2");
- a = null == a ? null : a.zpp_inner;
- 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 != (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()));
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- get_body2: function () {
- return null == this.zpp_inner_zn.b2 ? null : this.zpp_inner_zn.b2.outer
- },
- set_body1: function (a) {
- this.zpp_inner.immutable_midstep("Constraint::body1");
- a = null == a ? null : a.zpp_inner;
- 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()), 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()));
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- get_body1: function () {
- return null == this.zpp_inner_zn.b1 ? null : this.zpp_inner_zn.b1.outer
- },
- __class__: h.constraint.WeldJoint
- });
- h.dynamics = {};
- h.dynamics.Arbiter = function () {
- this.zpp_inner = null;
- if (!c.dynamics.ZPP_Arbiter.internal) throw "Error: Cannot instantiate Arbiter derp!";
- };
- s["nape.dynamics.Arbiter"] = h.dynamics.Arbiter;
- h.dynamics.Arbiter.__name__ = ["nape", "dynamics", "Arbiter"];
- h.dynamics.Arbiter.prototype = {
- toString: function () {
- var a = this.zpp_inner.type == c.dynamics.ZPP_Arbiter.COL ? "CollisionArbiter" : this.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID ? "FluidArbiter" : "SensorArbiter";
- if (this.zpp_inner.cleared) a += "(object-pooled)";
- else {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- a = a + "(" + (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws2.outer : this.zpp_inner.ws1.outer).toString() + "|";
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- a = a + (this.zpp_inner.ws1.id >
- 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()
- }
- return a
- },
- totalImpulse: function (a, b) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var d;
- if (d = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (d) throw "Error: Arbiter does not relate to body";
- return h.geom.Vec3.get(0, 0, 0)
- },
- get_state: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var a;
- switch (this.zpp_inner.immState) {
- case c.util.ZPP_Flags.id_ImmState_ACCEPT:
- case c.util.ZPP_Flags.id_ImmState_ALWAYS:
- 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);
- a = c.util.ZPP_Flags.PreFlag_ACCEPT;
- break;
- case c.util.ZPP_Flags.id_ImmState_ACCEPT:
- 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);
- a = c.util.ZPP_Flags.PreFlag_ACCEPT_ONCE;
- break;
- case c.util.ZPP_Flags.id_ImmState_IGNORE:
- case c.util.ZPP_Flags.id_ImmState_ALWAYS:
- 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);
- a = c.util.ZPP_Flags.PreFlag_IGNORE;
- break;
- default:
- 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
- }
- return a
- },
- get_body2: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer
- },
- get_body1: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer
- },
- get_shape2: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.ws1.outer : this.zpp_inner.ws2.outer
- },
- get_shape1: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.ws1.id >
- this.zpp_inner.ws2.id ? this.zpp_inner.ws2.outer : this.zpp_inner.ws1.outer
- },
- get_fluidArbiter: function () {
- return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID ? this.zpp_inner.fluidarb.outer_zn : null
- },
- get_collisionArbiter: function () {
- return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.COL ? this.zpp_inner.colarb.outer_zn : null
- },
- isSensorArbiter: function () {
- return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.SENSOR
- },
- isFluidArbiter: function () {
- return this.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID
- },
- isCollisionArbiter: function () {
- return this.zpp_inner.type ==
- c.dynamics.ZPP_Arbiter.COL
- },
- get_type: function () {
- return c.dynamics.ZPP_Arbiter.types[this.zpp_inner.type]
- },
- get_isSleeping: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.sleeping
- },
- __class__: h.dynamics.Arbiter
- };
- h.dynamics.ArbiterIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_ArbiterList.internal) throw "Error: Cannot instantiate ArbiterIterator derp!";
- };
- s["nape.dynamics.ArbiterIterator"] =
- h.dynamics.ArbiterIterator;
- h.dynamics.ArbiterIterator.__name__ = ["nape", "dynamics", "ArbiterIterator"];
- h.dynamics.ArbiterIterator.get = function (a) {
- var b = null == h.dynamics.ArbiterIterator.zpp_pool ? function (a) {
- c.util.ZPP_ArbiterList.internal = !0;
- a = new h.dynamics.ArbiterIterator;
- c.util.ZPP_ArbiterList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.dynamics.ArbiterIterator.zpp_pool;
- h.dynamics.ArbiterIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.dynamics.ArbiterIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.zpp_gl();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.dynamics.ArbiterIterator.zpp_pool;
- h.dynamics.ArbiterIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.dynamics.ArbiterIterator
- };
- h.dynamics.ArbiterList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_ArbiterList;
- this.zpp_inner.outer = this
- };
- s["nape.dynamics.ArbiterList"] =
- h.dynamics.ArbiterList;
- h.dynamics.ArbiterList.__name__ = ["nape", "dynamics", "ArbiterList"];
- h.dynamics.ArbiterList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.dynamics.ArbiterList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.dynamics.ArbiterList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.zpp_gl();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- for (var b = this.iterator(); b.hasNext();) try {
- var d = a,
- c = void 0;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.dynamics.ArbiterIterator.zpp_pool;
- h.dynamics.ArbiterIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- for (var a = "[", b = !0, d = this.iterator(); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- for (a = a.iterator(); a.hasNext();) {
- var b = a.next();
- this.has(b) || this.add(b)
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- for (var b = new h.dynamics.ArbiterList, d = this.iterator(); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Arbiter is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_vm();
- return h.dynamics.ArbiterIterator.get(this)
- },
- empty: function () {
- return 0 == this.zpp_gl()
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; !this.empty();) this.pop();
- else
- for (; !this.empty();) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
- this.zpp_inner.modify_test();
- if (this.empty()) throw "Error: Cannot remove from empty list";
- this.zpp_vm();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.wrapper()
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
- this.zpp_inner.modify_test();
- if (this.empty()) throw "Error: Cannot remove from empty list";
- this.zpp_vm();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.wrapper()
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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(),
- null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ArbiterList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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,
- a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
- return b
- },
- at: function (a) {
- this.zpp_vm();
- if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.zpp_gl() - 1 - a);
- if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite)
- for (this.zpp_inner.at_index = 0, this.zpp_inner.at_ite = this.zpp_inner.inner.head;;) {
- var b = this.zpp_inner.at_ite.elt;
- if (b.active) break;
- this.zpp_inner.at_ite = this.zpp_inner.at_ite.next
- }
- for (; this.zpp_inner.at_index !=
- a;)
- for (this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;;) {
- b = this.zpp_inner.at_ite.elt;
- if (b.active) break;
- this.zpp_inner.at_ite = this.zpp_inner.at_ite.next
- }
- return this.zpp_inner.at_ite.elt.wrapper()
- },
- has: function (a) {
- this.zpp_vm();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- zpp_vm: function () {
- this.zpp_inner.valmod()
- },
- zpp_gl: function () {
- this.zpp_inner.valmod();
- if (this.zpp_inner.zip_length) {
- this.zpp_inner.zip_length = !1;
- this.zpp_inner.user_length = 0;
- for (var a = this.zpp_inner.inner.head; null !=
- a;) a.elt.active && this.zpp_inner.user_length++, a = a.next
- }
- return this.zpp_inner.user_length
- },
- get_length: function () {
- return this.zpp_gl()
- },
- __class__: h.dynamics.ArbiterList
- };
- h.dynamics.ArbiterType = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ArbiterType derp!";
- };
- s["nape.dynamics.ArbiterType"] = h.dynamics.ArbiterType;
- h.dynamics.ArbiterType.__name__ = ["nape", "dynamics", "ArbiterType"];
- h.dynamics.ArbiterType.get_COLLISION = function () {
- 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);
- return c.util.ZPP_Flags.ArbiterType_COLLISION
- };
- h.dynamics.ArbiterType.get_SENSOR = function () {
- 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);
- return c.util.ZPP_Flags.ArbiterType_SENSOR
- };
- h.dynamics.ArbiterType.get_FLUID = function () {
- 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);
- return c.util.ZPP_Flags.ArbiterType_FLUID
- };
- h.dynamics.ArbiterType.prototype = {
- toString: function () {
- 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);
- var a;
- this == c.util.ZPP_Flags.ArbiterType_COLLISION ? a = "COLLISION" : (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), 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" : ""));
- return a
- },
- __class__: h.dynamics.ArbiterType
- };
- h.dynamics.CollisionArbiter = function () {
- if (!c.dynamics.ZPP_Arbiter.internal) throw "Error: Cannot instantiate CollisionArbiter derp!";
- h.dynamics.Arbiter.call(this)
- };
- s["nape.dynamics.CollisionArbiter"] = h.dynamics.CollisionArbiter;
- h.dynamics.CollisionArbiter.__name__ = ["nape", "dynamics", "CollisionArbiter"];
- h.dynamics.CollisionArbiter.__super__ = h.dynamics.Arbiter;
- h.dynamics.CollisionArbiter.prototype = I(h.dynamics.Arbiter.prototype, {
- set_rollingFriction: function (a) {
- if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::rollingFriction is only mutable during a pre-handler";
- if (a != a) throw "Error: CollisionArbiter::rollingFriction cannot be NaN";
- if (0 > a) throw "Error: CollisionArbiter::rollingFriction cannot be negative";
- var b = this.zpp_inner.colarb;
- b.rfric = a;
- b.userdef_rfric = !0;
- return this.get_rollingFriction()
- },
- get_rollingFriction: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var a = this.zpp_inner.colarb;
- 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)), 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)));
- return a.rfric
- },
- set_staticFriction: function (a) {
- if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::staticFriction is only mutable during a pre-handler";
- if (a != a) throw "Error: CollisionArbiter::staticFriction cannot be NaN";
- if (0 > a) throw "Error: CollisionArbiter::staticFriction cannot be negative";
- var b = this.zpp_inner.colarb;
- b.stat_fric = a;
- b.userdef_stat_fric = !0;
- return this.get_staticFriction()
- },
- get_staticFriction: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var a = this.zpp_inner.colarb;
- 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)), 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)));
- return a.stat_fric
- },
- set_dynamicFriction: function (a) {
- if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::dynamicFriction is only mutable during a pre-handler";
- if (a != a) throw "Error: CollisionArbiter::dynamicFriction cannot be NaN";
- if (0 > a) throw "Error: CollisionArbiter::dynamicFriction cannot be negative";
- var b = this.zpp_inner.colarb;
- b.dyn_fric = a;
- b.userdef_dyn_fric = !0;
- return this.get_dynamicFriction()
- },
- get_dynamicFriction: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var a = this.zpp_inner.colarb;
- 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)),
- 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)));
- return a.dyn_fric
- },
- set_elasticity: function (a) {
- if (!this.zpp_inner.colarb.mutable) throw "Error: CollisionArbiter::elasticity is only mutable during a pre-handler";
- if (a != a) throw "Error: CollisionArbiter::elasticity cannot be NaN";
- if (0 > a) throw "Error: CollisionArbiter::elasticity cannot be negative";
- var b =
- this.zpp_inner.colarb;
- b.restitution = a;
- b.userdef_restitution = !0;
- return this.get_elasticity()
- },
- get_elasticity: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var a = this.zpp_inner.colarb;
- 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)), 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)));
- return a.restitution
- },
- rollingImpulse: function (a, b) {
- null == b && (b = !1);
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var d;
- if (d = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (d) throw "Error: Arbiter does not relate to body";
- d = this.zpp_inner.colarb;
- return !b || d.oc1.fresh ? d.oc1.wrapper().rollingImpulse(a) : 0
- },
- totalImpulse: function (a,
- b) {
- null == b && (b = !1);
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var d;
- if (d = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (d) throw "Error: Arbiter does not relate to body";
- var c =
- 0,
- e = 0,
- f = 0,
- l = this.zpp_inner.colarb;
- if (!b || l.oc1.fresh) {
- d = l.oc1.wrapper().totalImpulse(a);
- var m = 1,
- u = m;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c += d.zpp_inner.x * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e += d.zpp_inner.y * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f += d.zpp_inner.z * m;
- d.dispose()
- }
- if (l.hc2 && (!b || l.oc2.fresh)) {
- d =
- l.oc2.wrapper().totalImpulse(a);
- u = m = 1;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c += d.zpp_inner.x * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e += d.zpp_inner.y * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f += d.zpp_inner.z * m;
- d.dispose()
- }
- return h.geom.Vec3.get(c, e, f)
- },
- tangentImpulse: function (a, b) {
- null == b && (b = !1);
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var d;
- if (d = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (d) throw "Error: Arbiter does not relate to body";
- var c = 0,
- e = 0,
- f = 0,
- l = this.zpp_inner.colarb;
- if (!b || l.oc1.fresh) {
- d = l.oc1.wrapper().tangentImpulse(a);
- var m = 1,
- u = m;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c += d.zpp_inner.x * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e += d.zpp_inner.y * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f += d.zpp_inner.z * m;
- d.dispose()
- }
- if (l.hc2 && (!b || l.oc2.fresh)) {
- d = l.oc2.wrapper().tangentImpulse(a);
- u = m = 1;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c += d.zpp_inner.x * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e += d.zpp_inner.y * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f += d.zpp_inner.z * m;
- d.dispose()
- }
- return h.geom.Vec3.get(c, e, f)
- },
- normalImpulse: function (a, b) {
- null == b && (b = !1);
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var d;
- if (d = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (d) throw "Error: Arbiter does not relate to body";
- var c = 0,
- e = 0,
- f = 0,
- l = this.zpp_inner.colarb;
- if (!b || l.oc1.fresh) {
- d = l.oc1.wrapper().normalImpulse(a);
- var m = 1,
- u = m;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c += d.zpp_inner.x * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e += d.zpp_inner.y * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f += d.zpp_inner.z * m;
- d.dispose()
- }
- if (l.hc2 && (!b || l.oc2.fresh)) {
- d = l.oc2.wrapper().normalImpulse(a);
- u = m = 1;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c += d.zpp_inner.x * u;
- if (null != d &&
- d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e += d.zpp_inner.y * u;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f += d.zpp_inner.z * m;
- d.dispose()
- }
- return h.geom.Vec3.get(c, e, f)
- },
- secondVertex: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return null != this.zpp_inner.colarb.__ref_edge1 != (null != this.zpp_inner.colarb.__ref_edge2) ? 1 == this.zpp_inner.colarb.__ref_vertex : !1
- },
- firstVertex: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return null != this.zpp_inner.colarb.__ref_edge1 != (null != this.zpp_inner.colarb.__ref_edge2) ? -1 == this.zpp_inner.colarb.__ref_vertex : !1
- },
- get_referenceEdge2: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var a = this.zpp_inner.colarb.__ref_edge1,
- b;
- if (b = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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
- }
- }
- b && (a = this.zpp_inner.colarb.__ref_edge2);
- return null == a ? null : a.wrapper()
- },
- get_referenceEdge1: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var a = this.zpp_inner.colarb.__ref_edge1,
- b;
- if (b = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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 !=
- c.util.ZPP_Flags.id_ShapeType_POLYGON)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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
- }
- }
- b && (a = this.zpp_inner.colarb.__ref_edge2);
- return null == a ? null : a.wrapper()
- },
- get_radius: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.colarb.radius
- },
- get_normal: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == this.zpp_inner.colarb.wrap_normal && this.zpp_inner.colarb.getnormal();
- return this.zpp_inner.colarb.wrap_normal
- },
- get_contacts: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == this.zpp_inner.colarb.wrap_contacts && this.zpp_inner.colarb.setupcontacts();
- return this.zpp_inner.colarb.wrap_contacts
- },
- __class__: h.dynamics.CollisionArbiter
- });
- h.dynamics.Contact = function () {
- this.zpp_inner = null;
- if (!c.dynamics.ZPP_Contact.internal) throw "Error: Cannot instantiate Contact derp!";
- };
- s["nape.dynamics.Contact"] = h.dynamics.Contact;
- h.dynamics.Contact.__name__ = ["nape", "dynamics", "Contact"];
- h.dynamics.Contact.prototype = {
- toString: function () {
- return null == this.zpp_inner.arbiter || this.zpp_inner.arbiter.cleared ? "{object-pooled}" : "{Contact}"
- },
- get_friction: function () {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- return this.zpp_inner.inner.friction
- },
- totalImpulse: function (a) {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- var b = this.zpp_inner.arbiter.colarb,
- d = this.zpp_inner.inner,
- c = d.jnAcc,
- e = d.jtAcc,
- f = b.jrAcc;
- if (null == a) return h.geom.Vec3.get(b.nx * c - b.ny * e, b.ny * c + b.nx * e, f);
- if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
- var l = b.nx * c - b.ny * e,
- c = b.ny * c + b.nx * e;
- 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)
- },
- rollingImpulse: function (a) {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- var b = this.zpp_inner.arbiter.colarb,
- d = this.zpp_inner.arbiter.colarb.jrAcc;
- if (null == a) return d;
- if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
- return a == b.b1.outer ? -d : d
- },
- tangentImpulse: function (a) {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- var b = this.zpp_inner.arbiter.colarb,
- d = this.zpp_inner.inner,
- c = d.jtAcc;
- if (null == a) return h.geom.Vec3.get(-b.ny * c, b.nx * c);
- if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
- return a == b.b1.outer ? h.geom.Vec3.get(b.ny * c, -b.nx * c, -(d.r1x *
- 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)
- },
- normalImpulse: function (a) {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- var b = this.zpp_inner.arbiter.colarb,
- d = this.zpp_inner.inner,
- c = d.jnAcc;
- if (null == a) return h.geom.Vec3.get(b.nx * c, b.ny * c);
- if (a != b.b1.outer && a != b.b2.outer) throw "Error: Contact does not relate to the given body";
- 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 *
- d.r2x - b.nx * d.r2y) * c)
- },
- get_fresh: function () {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- return this.zpp_inner.fresh
- },
- get_position: function () {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- null == this.zpp_inner.wrap_position && this.zpp_inner.getposition();
- return this.zpp_inner.wrap_position
- },
- get_penetration: function () {
- if (this.zpp_inner.inactiveme()) throw "Error: Contact not currently in use";
- return -this.zpp_inner.dist
- },
- get_arbiter: function () {
- return null ==
- this.zpp_inner.arbiter ? null : this.zpp_inner.arbiter.outer.get_collisionArbiter()
- },
- __class__: h.dynamics.Contact
- };
- h.dynamics.ContactIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_ContactList.internal) throw "Error: Cannot instantiate ContactIterator derp!";
- };
- s["nape.dynamics.ContactIterator"] = h.dynamics.ContactIterator;
- h.dynamics.ContactIterator.__name__ = ["nape", "dynamics", "ContactIterator"];
- h.dynamics.ContactIterator.get = function (a) {
- var b = null ==
- h.dynamics.ContactIterator.zpp_pool ? function (a) {
- c.util.ZPP_ContactList.internal = !0;
- a = new h.dynamics.ContactIterator;
- c.util.ZPP_ContactList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.dynamics.ContactIterator.zpp_pool;
- h.dynamics.ContactIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.dynamics.ContactIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a =
- this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.dynamics.ContactIterator.zpp_pool;
- h.dynamics.ContactIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.dynamics.ContactIterator
- };
- h.dynamics.ContactList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_ContactList;
- this.zpp_inner.outer = this
- };
- s["nape.dynamics.ContactList"] = h.dynamics.ContactList;
- h.dynamics.ContactList.__name__ = ["nape", "dynamics", "ContactList"];
- h.dynamics.ContactList.fromArray =
- function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.dynamics.ContactList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.dynamics.ContactList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.dynamics.ContactIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.dynamics.ContactIterator.zpp_pool;
- h.dynamics.ContactIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.dynamics.ContactIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.dynamics.ContactIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.dynamics.ContactList,
- d;
- this.zpp_inner.valmod();
- for (d = h.dynamics.ContactIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Contact is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.dynamics.ContactIterator.get(this)
- },
- empty: function () {
- return 0 == this.get_length()
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; 0 != this.get_length();) this.pop();
- else
- for (; 0 != this.get_length();) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.next; null != d;) {
- if (d == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
- this.zpp_inner.modify_test();
- if (0 == this.get_length()) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next &&
- (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.next : b.next,
- d = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.wrapper()
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
- this.zpp_inner.modify_test();
- if (0 == this.get_length()) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.next,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.next : d.next,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.wrapper()
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- b && (this.zpp_inner.reverse_flag ? (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.inner.add(a.zpp_inner), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ContactList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
- !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- if (a < this.zpp_inner.at_index || null == this.zpp_inner.at_ite)
- for (this.zpp_inner.at_index = 0, this.zpp_inner.at_ite = this.zpp_inner.inner.next;;) {
- var b = this.zpp_inner.at_ite;
- if (b.active && b.arbiter.active) break;
- this.zpp_inner.at_ite = this.zpp_inner.at_ite.next
- }
- for (; this.zpp_inner.at_index != a;)
- for (this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;;) {
- b = this.zpp_inner.at_ite;
- if (b.active && b.arbiter.active) break;
- this.zpp_inner.at_ite =
- this.zpp_inner.at_ite.next
- }
- return this.zpp_inner.at_ite.wrapper()
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- if (this.zpp_inner.zip_length) {
- this.zpp_inner.zip_length = !1;
- this.zpp_inner.user_length = 0;
- for (var a = this.zpp_inner.inner.next; null != a;) {
- var b = a;
- b.active && b.arbiter.active && this.zpp_inner.user_length++;
- a = a.next
- }
- }
- return this.zpp_inner.user_length
- },
- __class__: h.dynamics.ContactList
- };
- h.dynamics.FluidArbiter =
- function () {
- if (!c.dynamics.ZPP_Arbiter.internal) throw "Error: Cannot instantiate FluidArbiter derp!";
- h.dynamics.Arbiter.call(this)
- };
- s["nape.dynamics.FluidArbiter"] = h.dynamics.FluidArbiter;
- h.dynamics.FluidArbiter.__name__ = ["nape", "dynamics", "FluidArbiter"];
- h.dynamics.FluidArbiter.__super__ = h.dynamics.Arbiter;
- h.dynamics.FluidArbiter.prototype = I(h.dynamics.Arbiter.prototype, {
- totalImpulse: function (a, b) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var d;
- if (d = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- d = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (d) throw "Error: Arbiter does not relate to body";
- d = this.buoyancyImpulse(a);
- var c = this.dragImpulse(a),
- e = c;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (e.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- var f = e.zpp_inner,
- l;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- l = e.zpp_inner.x;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f.x = l + d.zpp_inner.x;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- e.zpp_inner.x;
- e = c;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (e.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- f = e.zpp_inner;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- l = e.zpp_inner.y;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f.y = l + d.zpp_inner.y;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- e.zpp_inner.y;
- e = c;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (e.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- f = e.zpp_inner;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- l = e.zpp_inner.z;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f.z = l + d.zpp_inner.z;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- e.zpp_inner.z;
- d.dispose();
- return c
- },
- dragImpulse: function (a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var b;
- if (b = null !=
- a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (b) throw "Error: Arbiter does not relate to body";
- b = this.zpp_inner.fluidarb;
- a = null == a || a.zpp_inner == this.zpp_inner.b2 ? 1 : -1;
- return h.geom.Vec3.get(b.dampx * a,
- b.dampy * a, b.adamp * a)
- },
- buoyancyImpulse: function (a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- var b;
- if (b = null != a) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- if (b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b2.outer : this.zpp_inner.b1.outer)) {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- b = a != (this.zpp_inner.ws1.id > this.zpp_inner.ws2.id ? this.zpp_inner.b1.outer : this.zpp_inner.b2.outer)
- }
- }
- if (b) throw "Error: Arbiter does not relate to body";
- b = this.zpp_inner.fluidarb;
- 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))
- },
- set_overlap: function (a) {
- if (!this.zpp_inner.fluidarb.mutable) throw "Error: Arbiter is mutable only within a pre-handler";
- if (a != a) throw "Error: FluidArbiter::overlap cannot be NaN";
- if (0 >= a || a == Math.POSITIVE_INFINITY) throw "Error: FluidArbiter::overlap must be strictly positive and non infinite";
- this.zpp_inner.fluidarb.overlap = a;
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.fluidarb.overlap
- },
- get_overlap: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- return this.zpp_inner.fluidarb.overlap
- },
- set_position: function (a) {
- if (!this.zpp_inner.fluidarb.mutable) throw "Error: Arbiter is mutable only within a pre-handler";
- if (null == a) throw "Error: FluidArbiter::position cannot be null";
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == this.zpp_inner.fluidarb.wrap_position && this.zpp_inner.fluidarb.getposition();
- this.zpp_inner.fluidarb.wrap_position.set(a);
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == this.zpp_inner.fluidarb.wrap_position && this.zpp_inner.fluidarb.getposition();
- return this.zpp_inner.fluidarb.wrap_position
- },
- get_position: function () {
- if (!this.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == this.zpp_inner.fluidarb.wrap_position && this.zpp_inner.fluidarb.getposition();
- return this.zpp_inner.fluidarb.wrap_position
- },
- __class__: h.dynamics.FluidArbiter
- });
- h.dynamics.InteractionFilter = function (a, b, d, g, e, f) {
- null == f && (f = -1);
- null == e && (e = 1);
- null == g && (g = -1);
- null == d && (d = 1);
- null == b && (b = -1);
- null == a && (a = 1);
- this.zpp_inner = null;
- 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);
- null;
- this.zpp_inner.outer =
- this;
- this.zpp_inner.collisionGroup != a && (this.zpp_inner.collisionGroup = a, this.zpp_inner.invalidate());
- this.zpp_inner.collisionGroup;
- this.zpp_inner.collisionMask != b && (this.zpp_inner.collisionMask = b, this.zpp_inner.invalidate());
- this.zpp_inner.collisionMask;
- this.zpp_inner.sensorGroup != d && (this.zpp_inner.sensorGroup = d, this.zpp_inner.invalidate());
- this.zpp_inner.sensorGroup;
- this.zpp_inner.sensorMask != g && (this.zpp_inner.sensorMask = g, this.zpp_inner.invalidate());
- this.zpp_inner.sensorMask;
- this.zpp_inner.fluidGroup !=
- e && (this.zpp_inner.fluidGroup = e, this.zpp_inner.invalidate());
- this.zpp_inner.fluidGroup;
- this.zpp_inner.fluidMask != f && (this.zpp_inner.fluidMask = f, this.zpp_inner.invalidate());
- this.zpp_inner.fluidMask
- };
- s["nape.dynamics.InteractionFilter"] = h.dynamics.InteractionFilter;
- h.dynamics.InteractionFilter.__name__ = ["nape", "dynamics", "InteractionFilter"];
- h.dynamics.InteractionFilter.prototype = {
- toString: function () {
- return "{ collision: " + $.hex(this.zpp_inner.collisionGroup, 8) + "~" + $.hex(this.zpp_inner.collisionMask,
- 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) + " }"
- },
- copy: function () {
- 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)
- },
- shouldFlow: function (a) {
- if (null == a) throw "Error: filter argument cannot be null for shouldFlow";
- return this.zpp_inner.shouldFlow(a.zpp_inner)
- },
- shouldSense: function (a) {
- if (null == a) throw "Error: filter argument cannot be null for shouldSense";
- return this.zpp_inner.shouldSense(a.zpp_inner)
- },
- shouldCollide: function (a) {
- if (null == a) throw "Error: filter argument cannot be null for shouldCollide";
- return this.zpp_inner.shouldCollide(a.zpp_inner)
- },
- set_fluidMask: function (a) {
- this.zpp_inner.fluidMask != a && (this.zpp_inner.fluidMask = a, this.zpp_inner.invalidate());
- return this.zpp_inner.fluidMask
- },
- get_fluidMask: function () {
- return this.zpp_inner.fluidMask
- },
- set_fluidGroup: function (a) {
- this.zpp_inner.fluidGroup !=
- a && (this.zpp_inner.fluidGroup = a, this.zpp_inner.invalidate());
- return this.zpp_inner.fluidGroup
- },
- get_fluidGroup: function () {
- return this.zpp_inner.fluidGroup
- },
- set_sensorMask: function (a) {
- this.zpp_inner.sensorMask != a && (this.zpp_inner.sensorMask = a, this.zpp_inner.invalidate());
- return this.zpp_inner.sensorMask
- },
- get_sensorMask: function () {
- return this.zpp_inner.sensorMask
- },
- set_sensorGroup: function (a) {
- this.zpp_inner.sensorGroup != a && (this.zpp_inner.sensorGroup = a, this.zpp_inner.invalidate());
- return this.zpp_inner.sensorGroup
- },
- get_sensorGroup: function () {
- return this.zpp_inner.sensorGroup
- },
- set_collisionMask: function (a) {
- this.zpp_inner.collisionMask != a && (this.zpp_inner.collisionMask = a, this.zpp_inner.invalidate());
- return this.zpp_inner.collisionMask
- },
- get_collisionMask: function () {
- return this.zpp_inner.collisionMask
- },
- set_collisionGroup: function (a) {
- this.zpp_inner.collisionGroup != a && (this.zpp_inner.collisionGroup = a, this.zpp_inner.invalidate());
- return this.zpp_inner.collisionGroup
- },
- get_collisionGroup: function () {
- return this.zpp_inner.collisionGroup
- },
- get_shapes: function () {
- null == this.zpp_inner.wrap_shapes && (this.zpp_inner.wrap_shapes = c.util.ZPP_ShapeList.get(this.zpp_inner.shapes, !0));
- return this.zpp_inner.wrap_shapes
- },
- get_userData: function () {
- null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
- return this.zpp_inner.userData
- },
- __class__: h.dynamics.InteractionFilter
- };
- h.dynamics.InteractionGroup = function (a) {
- null == a && (a = !1);
- this.zpp_inner = null;
- this.zpp_inner = new c.dynamics.ZPP_InteractionGroup;
- this.zpp_inner.outer = this;
- this.zpp_inner.ignore !=
- a && (this.zpp_inner.invalidate(!0), this.zpp_inner.ignore = a);
- this.zpp_inner.ignore
- };
- s["nape.dynamics.InteractionGroup"] = h.dynamics.InteractionGroup;
- h.dynamics.InteractionGroup.__name__ = ["nape", "dynamics", "InteractionGroup"];
- h.dynamics.InteractionGroup.prototype = {
- toString: function () {
- var a = "InteractionGroup";
- this.zpp_inner.ignore && (a += ":ignore");
- return a
- },
- get_groups: function () {
- null == this.zpp_inner.wrap_groups && (this.zpp_inner.wrap_groups = c.util.ZPP_InteractionGroupList.get(this.zpp_inner.groups, !0));
- return this.zpp_inner.wrap_groups
- },
- get_interactors: function () {
- null == this.zpp_inner.wrap_interactors && (this.zpp_inner.wrap_interactors = c.util.ZPP_InteractorList.get(this.zpp_inner.interactors, !0));
- return this.zpp_inner.wrap_interactors
- },
- set_ignore: function (a) {
- this.zpp_inner.ignore != a && (this.zpp_inner.invalidate(!0), this.zpp_inner.ignore = a);
- return this.zpp_inner.ignore
- },
- get_ignore: function () {
- return this.zpp_inner.ignore
- },
- set_group: function (a) {
- if (a == this) throw "Error: Cannot assign InteractionGroup to itself";
- this.zpp_inner.setGroup(null == a ? null : a.zpp_inner);
- return null == this.zpp_inner.group ? null : this.zpp_inner.group.outer
- },
- get_group: function () {
- return null == this.zpp_inner.group ? null : this.zpp_inner.group.outer
- },
- __class__: h.dynamics.InteractionGroup
- };
- h.dynamics.InteractionGroupIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_InteractionGroupList.internal) throw "Error: Cannot instantiate InteractionGroupIterator derp!";
- };
- s["nape.dynamics.InteractionGroupIterator"] =
- h.dynamics.InteractionGroupIterator;
- h.dynamics.InteractionGroupIterator.__name__ = ["nape", "dynamics", "InteractionGroupIterator"];
- h.dynamics.InteractionGroupIterator.get = function (a) {
- var b = null == h.dynamics.InteractionGroupIterator.zpp_pool ? function (a) {
- c.util.ZPP_InteractionGroupList.internal = !0;
- a = new h.dynamics.InteractionGroupIterator;
- c.util.ZPP_InteractionGroupList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.dynamics.InteractionGroupIterator.zpp_pool;
- h.dynamics.InteractionGroupIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.dynamics.InteractionGroupIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.dynamics.InteractionGroupIterator.zpp_pool;
- h.dynamics.InteractionGroupIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.dynamics.InteractionGroupIterator
- };
- h.dynamics.InteractionGroupList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_InteractionGroupList;
- this.zpp_inner.outer = this
- };
- s["nape.dynamics.InteractionGroupList"] = h.dynamics.InteractionGroupList;
- h.dynamics.InteractionGroupList.__name__ = ["nape", "dynamics", "InteractionGroupList"];
- h.dynamics.InteractionGroupList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.dynamics.InteractionGroupList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.dynamics.InteractionGroupList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.dynamics.InteractionGroupIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.dynamics.InteractionGroupIterator.zpp_pool;
- h.dynamics.InteractionGroupIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.dynamics.InteractionGroupIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.dynamics.InteractionGroupIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) :
- this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.dynamics.InteractionGroupList,
- d;
- this.zpp_inner.valmod();
- for (d = h.dynamics.InteractionGroupIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: InteractionGroup is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.dynamics.InteractionGroupIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ?
- null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
- 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: InteractionGroupList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
- !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length &&
- (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.dynamics.InteractionGroupList
- };
- h.geom = {};
- h.geom.AABB = function (a, b, d, g) {
- null == g && (g = 0);
- null == d && (d = 0);
- null == b && (b = 0);
- null == a && (a = 0);
- this.zpp_inner = null;
- if (a != a || b != b) throw "Error: AABB position cannot be NaN";
- if (d != d || g != g) throw "Error: AABB dimensions cannot be NaN";
- this.zpp_inner = c.geom.ZPP_AABB.get(a, b, a + d, b + g);
- this.zpp_inner.outer = this
- };
- s["nape.geom.AABB"] = h.geom.AABB;
- h.geom.AABB.__name__ = ["nape", "geom", "AABB"];
- h.geom.AABB.fromRect = function (a) {
- if (null == a) throw "Error: Cannot create AABB from null Rectangle";
- return new h.geom.AABB(a.x, a.y, a.width, a.height)
- };
- h.geom.AABB.prototype = {
- toString: function () {
- this.zpp_inner.validate();
- return this.zpp_inner.toString()
- },
- set_height: function (a) {
- if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
- this.zpp_inner.validate();
- if (this.zpp_inner.height() != a) {
- if (a != a) throw "Error: AABB::height cannot be NaN";
- if (0 > a) throw "Error: AABB::height (" +
- a + ") must be >= 0";
- var b = this.zpp_inner;
- this.zpp_inner.validate();
- b.maxy = this.zpp_inner.miny + a;
- this.zpp_inner.invalidate()
- }
- this.zpp_inner.validate();
- return this.zpp_inner.height()
- },
- get_height: function () {
- this.zpp_inner.validate();
- return this.zpp_inner.height()
- },
- set_width: function (a) {
- if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
- this.zpp_inner.validate();
- if (this.zpp_inner.width() != a) {
- if (a != a) throw "Error: AABB::width cannot be NaN";
- if (0 > a) throw "Error: AABB::width (" + a + ") must be >= 0";
- var b = this.zpp_inner;
- this.zpp_inner.validate();
- b.maxx = this.zpp_inner.minx + a;
- this.zpp_inner.invalidate()
- }
- this.zpp_inner.validate();
- return this.zpp_inner.width()
- },
- get_width: function () {
- this.zpp_inner.validate();
- return this.zpp_inner.width()
- },
- set_y: function (a) {
- if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
- this.zpp_inner.validate();
- if (this.zpp_inner.miny != a) {
- if (a != a) throw "Error: AABB::y cannot be NaN";
- this.zpp_inner.maxy += a - this.zpp_inner.miny;
- this.zpp_inner.miny = a;
- this.zpp_inner.invalidate()
- }
- this.zpp_inner.validate();
- return this.zpp_inner.miny
- },
- get_y: function () {
- this.zpp_inner.validate();
- return this.zpp_inner.miny
- },
- set_x: function (a) {
- if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
- this.zpp_inner.validate();
- if (this.zpp_inner.minx != a) {
- if (a != a) throw "Error: AABB::x cannot be NaN";
- this.zpp_inner.maxx += a - this.zpp_inner.minx;
- this.zpp_inner.minx = a;
- this.zpp_inner.invalidate()
- }
- this.zpp_inner.validate();
- return this.zpp_inner.minx
- },
- get_x: function () {
- this.zpp_inner.validate();
- return this.zpp_inner.minx
- },
- set_max: function (a) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
- if (null == a) throw "Error: Cannot assign null to AABB::max";
- this.zpp_inner.validate();
- var b;
- b = this.zpp_inner.minx;
- this.zpp_inner.validate();
- (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);
- if (b) throw "Error: AABB::max components cannot be NaN";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- if (a.zpp_inner.x < this.zpp_inner.getmin().get_x()) throw "Error: Assignment would cause negative width";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- if (a.zpp_inner.y < this.zpp_inner.getmin().get_y()) throw "Error: Assignment would cause negative height";
- this.zpp_inner.getmax().set(a);
- return this.zpp_inner.getmax()
- },
- get_max: function () {
- return this.zpp_inner.getmax()
- },
- set_min: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (this.zpp_inner._immutable) throw "Error: AABB is immutable";
- if (null == a) throw "Error: Cannot assign null to AABB::min";
- var b;
- this.zpp_inner.validate();
- b = this.zpp_inner.minx;
- this.zpp_inner.validate();
- (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);
- if (b) throw "Error: AABB::min components cannot be NaN";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- if (a.zpp_inner.x >
- this.zpp_inner.getmax().get_x()) throw "Error: Assignment would cause negative width";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- if (a.zpp_inner.y > this.zpp_inner.getmax().get_y()) throw "Error: Assignment would cause negative height";
- this.zpp_inner.getmin().set(a);
- return this.zpp_inner.getmin()
- },
- get_min: function () {
- return this.zpp_inner.getmin()
- },
- toRect: function () {
- var a = k.geom.Rectangle;
- this.zpp_inner.validate();
- var b = this.zpp_inner.minx;
- this.zpp_inner.validate();
- var d = this.zpp_inner.miny;
- this.zpp_inner.validate();
- var c = this.zpp_inner.width(),
- e;
- this.zpp_inner.validate();
- e = this.zpp_inner.height();
- return new a(b, d, c, e)
- },
- copy: function () {
- this.zpp_inner.validate();
- return this.zpp_inner.copy().wrapper()
- },
- __class__: h.geom.AABB
- };
- h.geom.ConvexResult = function () {
- this.zpp_inner = null;
- if (!c.geom.ZPP_ConvexRayResult.internal) throw "Error: ConvexResult cannot be instantiated derp!";
- };
- s["nape.geom.ConvexResult"] = h.geom.ConvexResult;
- h.geom.ConvexResult.__name__ = ["nape", "geom",
- "ConvexResult"
- ];
- h.geom.ConvexResult.prototype = {
- toString: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- var a = "{ shape: " + K.string(function (a) {
- if (null != a.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return a.zpp_inner.shape
- }(this)) + " toi: ";
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return a + this.zpp_inner.toiDistance + " }"
- },
- dispose: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- this.zpp_inner.free()
- },
- get_shape: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.shape
- },
- get_toi: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.toiDistance
- },
- get_position: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.position
- },
- get_normal: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.normal
- },
- __class__: h.geom.ConvexResult
- };
- h.geom.ConvexResultIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_ConvexResultList.internal) throw "Error: Cannot instantiate ConvexResultIterator derp!";
- };
- s["nape.geom.ConvexResultIterator"] = h.geom.ConvexResultIterator;
- h.geom.ConvexResultIterator.__name__ = ["nape", "geom", "ConvexResultIterator"];
- h.geom.ConvexResultIterator.get = function (a) {
- var b = null == h.geom.ConvexResultIterator.zpp_pool ?
- function (a) {
- c.util.ZPP_ConvexResultList.internal = !0;
- a = new h.geom.ConvexResultIterator;
- c.util.ZPP_ConvexResultList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.geom.ConvexResultIterator.zpp_pool;
- h.geom.ConvexResultIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.geom.ConvexResultIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.geom.ConvexResultIterator.zpp_pool;
- h.geom.ConvexResultIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.geom.ConvexResultIterator
- };
- h.geom.ConvexResultList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_ConvexResultList;
- this.zpp_inner.outer = this
- };
- s["nape.geom.ConvexResultList"] = h.geom.ConvexResultList;
- h.geom.ConvexResultList.__name__ = ["nape", "geom", "ConvexResultList"];
- h.geom.ConvexResultList.fromArray = function (a) {
- if (null ==
- a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.geom.ConvexResultList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.geom.ConvexResultList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.geom.ConvexResultIterator.get(this); b.hasNext();) try {
- var d =
- a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.geom.ConvexResultIterator.zpp_pool;
- h.geom.ConvexResultIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.geom.ConvexResultIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.geom.ConvexResultIterator.get(a); a.hasNext();) {
- var b =
- a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.geom.ConvexResultList,
- d;
- this.zpp_inner.valmod();
- for (d = h.geom.ConvexResultIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: ConvexResult is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.geom.ConvexResultIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
- 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt;
- null != this.zpp_inner.subber && this.zpp_inner.subber(a);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return a
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- 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();
- else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt;
- null != this.zpp_inner.subber && this.zpp_inner.subber(a);
- this.zpp_inner.dontremove ||
- this.zpp_inner.inner.erase(b)
- }
- this.zpp_inner.invalidate();
- return a
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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)) : this.zpp_inner.inner.add(a), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ConvexResultList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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() -
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index !=
- a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.geom.ConvexResultList
- };
- h.geom.Geom = function () {};
- s["nape.geom.Geom"] = h.geom.Geom;
- h.geom.Geom.__name__ = ["nape",
- "geom", "Geom"
- ];
- h.geom.Geom.distanceBody = function (a, b, d, g) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.immutable();
- g.zpp_inner.immutable();
- if (a.zpp_inner.wrap_shapes.empty() || b.zpp_inner.wrap_shapes.empty()) throw "Error: Bodies cannot be empty in calculating distances";
- for (var e = a.zpp_inner.shapes.head; null != e;) {
- var f = e.elt;
- c.geom.ZPP_Geom.validateShape(f);
- e = e.next
- }
- for (e = b.zpp_inner.shapes.head; null !=
- e;) f = e.elt, c.geom.ZPP_Geom.validateShape(f), e = e.next;
- return c.geom.ZPP_SweepDistance.distanceBody(a.zpp_inner, b.zpp_inner, d.zpp_inner, g.zpp_inner)
- };
- h.geom.Geom.distance = function (a, b, d, g) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.immutable();
- g.zpp_inner.immutable();
- 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 distances";
- c.geom.ZPP_Geom.validateShape(a.zpp_inner);
- c.geom.ZPP_Geom.validateShape(b.zpp_inner);
- var e;
- 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);
- e.weak = !1;
- a = c.geom.ZPP_SweepDistance.distance(a.zpp_inner, b.zpp_inner, d.zpp_inner, g.zpp_inner, e, 1E100);
- null != e.outer && (e.outer.zpp_inner = null, e.outer = null);
- e._isimmutable = null;
- e._validate = null;
- e._invalidate = null;
- e.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = e;
- return a
- };
- h.geom.Geom.intersectsBody = function (a, b) {
- if (a.zpp_inner.wrap_shapes.empty() || b.zpp_inner.wrap_shapes.empty()) throw "Error: Bodies must have shapes to test for intersection.";
- for (var d = a.zpp_inner.shapes.head; null != d;) {
- var g = d.elt;
- c.geom.ZPP_Geom.validateShape(g);
- d = d.next
- }
- for (d = b.zpp_inner.shapes.head; null != d;) g = d.elt, c.geom.ZPP_Geom.validateShape(g), d = d.next;
- if (a.zpp_inner.aabb.intersect(b.zpp_inner.aabb))
- for (d = a.zpp_inner.shapes.head; null !=
- d;) {
- for (var g = d.elt, e = b.zpp_inner.shapes.head; null != e;) {
- if (c.geom.ZPP_Collide.testCollide_safe(g, e.elt)) return !0;
- e = e.next
- }
- d = d.next
- }
- return !1
- };
- h.geom.Geom.intersects = function (a, b) {
- 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";
- c.geom.ZPP_Geom.validateShape(a.zpp_inner);
- c.geom.ZPP_Geom.validateShape(b.zpp_inner);
- return a.zpp_inner.aabb.intersect(b.zpp_inner.aabb) &&
- c.geom.ZPP_Collide.testCollide_safe(a.zpp_inner, b.zpp_inner)
- };
- h.geom.Geom.contains = function (a, b) {
- 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";
- c.geom.ZPP_Geom.validateShape(a.zpp_inner);
- c.geom.ZPP_Geom.validateShape(b.zpp_inner);
- return c.geom.ZPP_Collide.containTest(a.zpp_inner, b.zpp_inner)
- };
- h.geom.GeomPoly = function (a) {
- this.zpp_pool = this.zpp_inner = null;
- this.zpp_inner =
- new c.geom.ZPP_GeomPoly(this);
- if (null != a) {
- if (F.Boot.__instanceof(a, Array))
- for (var b = a, d = 0; d < b.length;) {
- var g = b[d];
- ++d;
- if (null == g) throw "Error: Array<Vec2> contains null objects";
- if (!F.Boot.__instanceof(g, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
- var e = g;
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.vertices = function (a) {
- var b = c.geom.ZPP_GeomVert.get(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a), function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a));
- 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);
- return b
- }(this)
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (b = a.iterator(); b.hasNext();) {
- e = b.next();
- if (null == e) throw "Error: Vec2List contains null objects";
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.vertices = function (a) {
- var b = c.geom.ZPP_GeomVert.get(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a), function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a));
- 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);
- return b
- }(this)
- } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
- b = a;
- if (null != b && b.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- b = b.zpp_inner.vertices;
- if (null != b) {
- g = b;
- do e = h.geom.Vec2.get(g.x, g.y, null), g = g.next, this.zpp_inner.vertices = function (a) {
- var b = c.geom.ZPP_GeomVert.get(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a), function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a));
- 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);
- return b
- }(this), e.dispose(); while (g != b)
- }
- } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
- this.skipForward(1);
- if (F.Boot.__instanceof(a, Array))
- for (b = a, g = 0; g < b.length;) {
- a = b[g];
- if (d = a.zpp_inner.weak) a.dispose(), d = !0;
- d ? b.splice(g, 1) : g++
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- 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)
- }
- };
- s["nape.geom.GeomPoly"] = h.geom.GeomPoly;
- h.geom.GeomPoly.__name__ = ["nape", "geom", "GeomPoly"];
- h.geom.GeomPoly.get =
- function (a) {
- var b;
- 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));
- if (null != a) {
- if (F.Boot.__instanceof(a, Array))
- for (var d = a, g = 0; g < d.length;) {
- var e = d[g];
- ++g;
- if (null == e) throw "Error: Array<Vec2> contains null objects";
- if (!F.Boot.__instanceof(e, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
- var f =
- e;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.vertices = function (a) {
- a = c.geom.ZPP_GeomVert.get(function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(a), function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(a));
- 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);
- return a
- }(this)
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (d = a.iterator(); d.hasNext();) {
- f = d.next();
- if (null == f) throw "Error: Vec2List contains null objects";
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.vertices = function (a) {
- a = c.geom.ZPP_GeomVert.get(function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(a), function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(a));
- 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);
- return a
- }(this)
- } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
- d = a;
- if (null != d && d.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- d = d.zpp_inner.vertices;
- if (null != d) {
- e = d;
- do f = h.geom.Vec2.get(e.x, e.y, null), e = e.next, b.zpp_inner.vertices = function (a) {
- a = c.geom.ZPP_GeomVert.get(function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(a), function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(a));
- 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);
- return a
- }(this), f.dispose(); while (e != d)
- }
- } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
- b.skipForward(1);
- if (F.Boot.__instanceof(a, Array))
- for (d = a, e = 0; e < d.length;) {
- a = d[e];
- if (g = a.zpp_inner.weak) a.dispose(), g = !0;
- g ? d.splice(e, 1) : e++
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (d = a, null != d.zpp_inner._validate && d.zpp_inner._validate(),
- 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)
- }
- return b
- };
- h.geom.GeomPoly.prototype = {
- right: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable rightmmost vertex";
- var a = this.zpp_inner.vertices,
- b = this.zpp_inner.vertices.next,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var c = b;
- c.x > a.x && (a = c);
- b = b.next
- } while (b != d)
- }
- 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));
- return a.wrap
- },
- left: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable leftmost vertex";
- var a = this.zpp_inner.vertices,
- b = this.zpp_inner.vertices.next,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var c = b;
- c.x < a.x && (a = c);
- b = b.next
- } while (b != d)
- }
- 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));
- return a.wrap
- },
- bottom: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable bottommost vertex";
- var a = this.zpp_inner.vertices,
- b = this.zpp_inner.vertices.next,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var c = b;
- c.y > a.y && (a = c);
- b = b.next
- } while (b != d)
- }
- 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));
- return a.wrap
- },
- top: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable topmost vertex";
- var a = this.zpp_inner.vertices,
- b = this.zpp_inner.vertices.next,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var c = b;
- c.y < a.y && (a = c);
- b = b.next
- } while (b != d)
- }
- 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));
- return a.wrap
- },
- bounds: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: empty GeomPoly has no defineable bounds";
- var a = 1E100,
- b = 1E100,
- d = -1E100,
- c = -1E100,
- e = this.zpp_inner.vertices,
- f = this.zpp_inner.vertices;
- if (null != e) {
- do {
- var l = e;
- l.x < a && (a = l.x);
- l.y < b && (b = l.y);
- l.x > d && (d = l.x);
- l.y > c && (c = l.y);
- e = e.next
- } while (e != f)
- }
- return new h.geom.AABB(a, b, d - a, c - b)
- },
- transform: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null ==
- a) throw "Error: Cannot transform by null matrix";
- var b = this.zpp_inner.vertices,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var c = b,
- e = a.zpp_inner.a * c.x + a.zpp_inner.b * c.y + a.zpp_inner.tx;
- c.y = a.zpp_inner.c * c.x + a.zpp_inner.d * c.y + a.zpp_inner.ty;
- c.x = e;
- b = b.next
- } while (b != d)
- }
- return this
- },
- cut: function (a, b, d, g, e) {
- null == g && (g = !1);
- null == d && (d = !1);
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null != this.zpp_inner.vertices &&
- 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";
- if (null == a || null == b) throw "Error: Cannot cut with null start/end's";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d = c.geom.ZPP_Cutter.run(this.zpp_inner.vertices, a, b, d, g, e);
- a.zpp_inner.weak ?
- (a.dispose(), !0) : !1;
- b.zpp_inner.weak ? (b.dispose(), !0) : !1;
- return d
- },
- inflate: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- var b = h.geom.GeomPoly.get(),
- d = this.winding();
- 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);
- d == c.util.ZPP_Flags.Winding_CLOCKWISE && (a = -a);
- var g = this.zpp_inner.vertices,
- d = this.zpp_inner.vertices;
- if (null != g) {
- do {
- var e = g,
- f = e.prev,
- l =
- e.next,
- m = 0,
- u = 0,
- p = 0,
- C = 0,
- m = e.x - f.x,
- u = e.y - f.y,
- p = l.x - e.x,
- C = l.y - e.y,
- r = l = f = 0,
- k = 0,
- f = m,
- l = u,
- w = f * f + l * l,
- w = 1 / Math.sqrt(w),
- f = f * w,
- l = l * w,
- w = f,
- f = -l,
- l = w,
- w = a,
- f = f * w,
- l = l * w,
- r = p,
- k = C,
- w = r * r + k * k,
- w = 1 / Math.sqrt(w),
- r = r * w,
- k = k * w,
- w = r,
- r = -k,
- k = w,
- w = a,
- r = r * w,
- k = k * w,
- t = w = 0,
- w = r - f,
- t = k - l,
- r = C * w - p * t,
- w = 0 == r ? 0 : r / (C * m - p * u),
- C = p = 0,
- p = e.x + f,
- C = e.y + l,
- e = w,
- p = p + m * e,
- C = C + u * e;
- b.push(h.geom.Vec2.get(p, C, null));
- g = g.next
- } while (g != d)
- }
- return b.skipForward(1)
- },
- triangularDecomposition: function (a, b) {
- null == a && (a = !1);
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- 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";
- for (var d = c.geom.ZPP_Monotone.decompose(this.zpp_inner.vertices, function (a) {
- null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly = new c.geom.ZPP_PartitionedPoly);
- return c.geom.ZPP_Monotone.sharedPPoly
- }(this)).extract_partitions(function (a) {
- null == c.geom.ZPP_PartitionedPoly.sharedPPList && (c.geom.ZPP_PartitionedPoly.sharedPPList =
- new c.util.ZNPList_ZPP_PartitionedPoly);
- return c.geom.ZPP_PartitionedPoly.sharedPPList
- }(this)), g = null == b ? new h.geom.GeomPolyList : b; null != d.head;) {
- var e = d.pop_unsafe();
- c.geom.ZPP_Triangular.triangulate(e);
- a && c.geom.ZPP_Triangular.optimise(e);
- var f = e.extract(function (a) {
- null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList = new c.util.ZNPList_ZPP_GeomVert);
- return c.geom.ZPP_PartitionedPoly.sharedGVList
- }(this));
- e.next = c.geom.ZPP_PartitionedPoly.zpp_pool;
- for (c.geom.ZPP_PartitionedPoly.zpp_pool =
- e; null != f.head;) {
- var e = f.pop_unsafe(),
- l = h.geom.GeomPoly.get();
- l.zpp_inner.vertices = e;
- g.zpp_inner.reverse_flag ? g.push(l) : g.unshift(l)
- }
- }
- return g
- },
- convexDecomposition: function (a, b) {
- null == a && (a = !1);
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- 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";
- for (var d = c.geom.ZPP_Monotone.decompose(this.zpp_inner.vertices,
- function (a) {
- null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly = new c.geom.ZPP_PartitionedPoly);
- return c.geom.ZPP_Monotone.sharedPPoly
- }(this)).extract_partitions(function (a) {
- null == c.geom.ZPP_PartitionedPoly.sharedPPList && (c.geom.ZPP_PartitionedPoly.sharedPPList = new c.util.ZNPList_ZPP_PartitionedPoly);
- return c.geom.ZPP_PartitionedPoly.sharedPPList
- }(this)), g = null == b ? new h.geom.GeomPolyList : b; null != d.head;) {
- var e = d.pop_unsafe();
- c.geom.ZPP_Triangular.triangulate(e);
- a && c.geom.ZPP_Triangular.optimise(e);
- c.geom.ZPP_Convex.optimise(e);
- var f = e.extract(function (a) {
- null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList = new c.util.ZNPList_ZPP_GeomVert);
- return c.geom.ZPP_PartitionedPoly.sharedGVList
- }(this));
- e.next = c.geom.ZPP_PartitionedPoly.zpp_pool;
- for (c.geom.ZPP_PartitionedPoly.zpp_pool = e; null != f.head;) {
- var e = f.pop_unsafe(),
- l = h.geom.GeomPoly.get();
- l.zpp_inner.vertices = e;
- g.zpp_inner.reverse_flag ? g.push(l) : g.unshift(l)
- }
- }
- return g
- },
- monotoneDecomposition: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- 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";
- var b = c.geom.ZPP_Monotone.decompose(this.zpp_inner.vertices, function (a) {
- null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly = new c.geom.ZPP_PartitionedPoly);
- return c.geom.ZPP_Monotone.sharedPPoly
- }(this)).extract(function (a) {
- null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList =
- new c.util.ZNPList_ZPP_GeomVert);
- return c.geom.ZPP_PartitionedPoly.sharedGVList
- }(this));
- for (a = null == a ? new h.geom.GeomPolyList : a; null != b.head;) {
- var d = b.pop_unsafe(),
- g = h.geom.GeomPoly.get();
- g.zpp_inner.vertices = d;
- a.zpp_inner.reverse_flag ? a.push(g) : a.unshift(g)
- }
- return a
- },
- simpleDecomposition: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- 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";
- var b = c.geom.ZPP_Simple.decompose(this.zpp_inner.vertices, function (a) {
- null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList = new c.util.ZNPList_ZPP_GeomVert);
- return c.geom.ZPP_PartitionedPoly.sharedGVList
- }(this));
- for (a = null == a ? new h.geom.GeomPolyList : a; null != b.head;) {
- var d = b.pop_unsafe(),
- g = h.geom.GeomPoly.get();
- g.zpp_inner.vertices = d;
- a.zpp_inner.reverse_flag ? a.push(g) : a.unshift(g)
- }
- return a
- },
- simplify: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (0 >= a) throw "Error: Epsilon should be > 0 for simplifying a GeomPoly";
- 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();
- a = c.geom.ZPP_Simplify.simplify(this.zpp_inner.vertices, a);
- var b = h.geom.GeomPoly.get();
- b.zpp_inner.vertices = a;
- return b
- },
- isDegenerate: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- return null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next ||
- this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next ? !0 : this.area() < h.Config.epsilon
- },
- isMonotone: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- 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)
- },
- isSimple: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- 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_Simple.isSimple(this.zpp_inner.vertices)
- },
- isConvex: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- var a;
- if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) a = !0;
- else {
- var b = a = !1,
- d = !0,
- c = this.zpp_inner.vertices,
- e = this.zpp_inner.vertices;
- if (null != c) {
- do {
- var f = c,
- l = f.prev,
- m = f.next,
- h = 0,
- p = 0,
- h = m.x - f.x,
- p = m.y - f.y,
- C = m = 0,
- m = f.x - l.x,
- C = f.y - l.y,
- f = C * h - m * p;
- 0 < f ? b = !0 : 0 > f && (a = !0);
- if (b && a) {
- d = !1;
- break
- }
- c = c.next
- } while (c != e)
- }
- a = d
- }
- return a
- },
- isClockwise: function () {
- var a = this.winding();
- 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);
- return a == c.util.ZPP_Flags.Winding_CLOCKWISE
- },
- contains: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: GeomPoly::contains point cannot be null";
- var b;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- b = a.zpp_inner.x;
- var d;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- d = a.zpp_inner.y;
- var c = !1,
- e = this.zpp_inner.vertices,
- f = this.zpp_inner.vertices;
- if (null != e) {
- do {
- var l = e,
- m = l.prev;
- (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);
- e =
- e.next
- } while (e != f)
- }
- b = c;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- winding: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- 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;
- var a;
- a =
- 0;
- var b = this.zpp_inner.vertices,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var g = b;
- a += g.x * (g.next.y - g.prev.y);
- b = b.next
- } while (b != d)
- }
- a *= 0.5;
- 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) :
- (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);
- return a
- },
- area: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- var a;
- if (null == this.zpp_inner.vertices || null == this.zpp_inner.vertices.next || this.zpp_inner.vertices.prev == this.zpp_inner.vertices.next) a = 0;
- else {
- a = 0;
- var b = this.zpp_inner.vertices,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var c = b;
- a += c.x * (c.next.y - c.prev.y);
- b = b.next
- } while (b != d)
- }
- a *= 0.5;
- a = 0 > a ? -a : a
- }
- return a
- },
- toString: function () {
- var a = "GeomPoly[",
- b = this.zpp_inner.vertices,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var c = b;
- c != this.zpp_inner.vertices && (a += ",");
- a += "{" + c.x + "," + c.y + "}";
- b = b.next
- } while (b != d)
- }
- return a + "]"
- },
- dispose: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- this.clear();
- this.zpp_pool = null;
- null != c.util.ZPP_PubPool.nextGeomPoly ? c.util.ZPP_PubPool.nextGeomPoly.zpp_pool =
- this : c.util.ZPP_PubPool.poolGeomPoly = this;
- c.util.ZPP_PubPool.nextGeomPoly = this;
- this.zpp_disp = !0
- },
- copy: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- var a = h.geom.GeomPoly.get(),
- b = this.zpp_inner.vertices,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do {
- var g = b,
- e = a.zpp_inner,
- f = void 0,
- g = c.geom.ZPP_GeomVert.get(g.x, g.y);
- 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 =
- g, a.zpp_inner.vertices.next = g);
- f = g;
- e.vertices = f;
- b = b.next
- } while (b != d)
- }
- return a.skipForward(1)
- },
- clear: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- for (; null != this.zpp_inner.vertices;) {
- var a = this.zpp_inner.vertices,
- b = this.zpp_inner,
- d;
- 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 =
- 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);
- b.vertices = d;
- null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
- a.prev = a.next = null;
- a.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = a
- }
- return this
- },
- erase: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- for (; 0 != a && null != this.zpp_inner.vertices;) {
- var b =
- this.zpp_inner.vertices;
- if (0 < a) {
- var 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, g = this.zpp_inner.vertices = null) : g = function (a) {
- var b = a.zpp_inner.vertices.next;
- a.zpp_inner.vertices.prev.next = a.zpp_inner.vertices.next;
- a.zpp_inner.vertices.next.prev = a.zpp_inner.vertices.prev;
- a.zpp_inner.vertices.next = a.zpp_inner.vertices.prev = null;
- a.zpp_inner.vertices = null;
- return b
- }(this);
- d.vertices =
- g;
- a--
- } 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) {
- var b = a.zpp_inner.vertices.prev;
- a.zpp_inner.vertices.prev.next = a.zpp_inner.vertices.next;
- a.zpp_inner.vertices.next.prev = a.zpp_inner.vertices.prev;
- a.zpp_inner.vertices.next = a.zpp_inner.vertices.prev = null;
- a.zpp_inner.vertices = null;
- return b
- }(this), d.vertices = g, a++);
- null != b.wrap && (b.wrap.zpp_inner._inuse = !1,
- b.wrap.dispose(), b.wrap = null);
- b.prev = b.next = null;
- b.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = b
- }
- return this
- },
- skipBackwards: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- return this.skipForward(-a)
- },
- skipForward: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null != this.zpp_inner.vertices)
- if (0 < a)
- for (; 0 < a--;) this.zpp_inner.vertices = this.zpp_inner.vertices.next;
- else if (0 > a)
- for (; 0 > a++;) this.zpp_inner.vertices =
- this.zpp_inner.vertices.prev;
- return this
- },
- shift: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: Cannot shift from empty polygon";
- var a = this.zpp_inner.vertices,
- b = this.zpp_inner,
- d;
- 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 =
- 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);
- b.vertices = d;
- null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
- a.prev = a.next = null;
- a.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = a;
- return this
- },
- unshift: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot unshift null vertex";
- this.zpp_inner.vertices = function (b) {
- var d = c.geom.ZPP_GeomVert.get(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(b), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(b));
- 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 =
- d, b.zpp_inner.vertices.prev = d);
- return d
- }(this);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- pop: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: Cannot pop from empty polygon";
- var a = this.zpp_inner.vertices,
- b = this.zpp_inner,
- d;
- 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 =
- 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);
- b.vertices = d;
- null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
- a.prev = a.next = null;
- a.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = a;
- return this
- },
- push: function (a) {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot push null vertex";
- this.zpp_inner.vertices = function (b) {
- var d = c.geom.ZPP_GeomVert.get(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(b), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(b));
- 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,
- b.zpp_inner.vertices.next.prev = d, b.zpp_inner.vertices.next = d);
- return d
- }(this);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- current: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- if (null == this.zpp_inner.vertices) throw "Error: GeomPoly is empty";
- return this.zpp_inner.vertices.wrapper()
- },
- backwardsIterator: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- return c.geom.ZPP_GeomVertexIterator.get(this.zpp_inner.vertices, !1)
- },
- forwardIterator: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- return c.geom.ZPP_GeomVertexIterator.get(this.zpp_inner.vertices, !0)
- },
- iterator: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- return c.geom.ZPP_GeomVertexIterator.get(this.zpp_inner.vertices, !0)
- },
- size: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- var a = 0,
- b = this.zpp_inner.vertices,
- d = this.zpp_inner.vertices;
- if (null != b) {
- do a++, b = b.next; while (b != d)
- }
- return a
- },
- empty: function () {
- if (this.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- return null == this.zpp_inner.vertices
- },
- __class__: h.geom.GeomPoly
- };
- h.geom.GeomPolyIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_GeomPolyList.internal) throw "Error: Cannot instantiate GeomPolyIterator derp!";
- };
- s["nape.geom.GeomPolyIterator"] =
- h.geom.GeomPolyIterator;
- h.geom.GeomPolyIterator.__name__ = ["nape", "geom", "GeomPolyIterator"];
- h.geom.GeomPolyIterator.get = function (a) {
- var b = null == h.geom.GeomPolyIterator.zpp_pool ? function (a) {
- c.util.ZPP_GeomPolyList.internal = !0;
- a = new h.geom.GeomPolyIterator;
- c.util.ZPP_GeomPolyList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.geom.GeomPolyIterator.zpp_pool;
- h.geom.GeomPolyIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.geom.GeomPolyIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.geom.GeomPolyIterator.zpp_pool;
- h.geom.GeomPolyIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.geom.GeomPolyIterator
- };
- h.geom.GeomPolyList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_GeomPolyList;
- this.zpp_inner.outer = this
- };
- s["nape.geom.GeomPolyList"] = h.geom.GeomPolyList;
- h.geom.GeomPolyList.__name__ = ["nape", "geom", "GeomPolyList"];
- h.geom.GeomPolyList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.geom.GeomPolyList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.geom.GeomPolyList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.geom.GeomPolyIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.geom.GeomPolyIterator.zpp_pool;
- h.geom.GeomPolyIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.geom.GeomPolyIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.geom.GeomPolyIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.geom.GeomPolyList,
- d;
- this.zpp_inner.valmod();
- for (d = h.geom.GeomPolyIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: GeomPoly is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.geom.GeomPolyIterator.get(this)
- },
- empty: function () {
- return null ==
- this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite &&
- null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite =
- null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
- !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: GeomPolyList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.geom.GeomPolyList
- };
- h.geom.GeomVertexIterator = function () {
- if (!c.geom.ZPP_GeomVertexIterator.internal) throw "Error: Cannot instantiate GeomVertexIterator";
- };
- s["nape.geom.GeomVertexIterator"] = h.geom.GeomVertexIterator;
- h.geom.GeomVertexIterator.__name__ = ["nape", "geom", "GeomVertexIterator"];
- h.geom.GeomVertexIterator.prototype = {
- next: function () {
- if (null ==
- this.zpp_inner) throw "Error: Iterator has been disposed";
- var a = this.zpp_inner.ptr.wrapper();
- this.zpp_inner.ptr = this.zpp_inner.forward ? this.zpp_inner.ptr.next : this.zpp_inner.ptr.prev;
- return a
- },
- hasNext: function () {
- if (null == this.zpp_inner) throw "Error: Iterator has been disposed";
- var a = this.zpp_inner.ptr != this.zpp_inner.start || this.zpp_inner.first;
- this.zpp_inner.first = !1;
- if (!a) {
- var b = this.zpp_inner;
- b.outer.zpp_inner = null;
- b.ptr = b.start = null;
- b.next = c.geom.ZPP_GeomVertexIterator.zpp_pool;
- c.geom.ZPP_GeomVertexIterator.zpp_pool =
- b
- }
- return a
- },
- __class__: h.geom.GeomVertexIterator
- };
- h.geom.MarchingSquares = function () {};
- s["nape.geom.MarchingSquares"] = h.geom.MarchingSquares;
- h.geom.MarchingSquares.__name__ = ["nape", "geom", "MarchingSquares"];
- h.geom.MarchingSquares.run = function (a, b, d, g, e, f, l) {
- null == f && (f = !0);
- null == g && (g = 2);
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: MarchingSquares requires an iso function to operate";
- if (null == b) throw "Error: MarchingSquares requires an AABB to define bounds of surface extraction";
- if (null == d) throw "Error: MarchingSquares requires a Vec2 to define cell size for surface extraction";
- var m;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- if (!(m = 0 >= d.zpp_inner.x)) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- m = 0 >= d.zpp_inner.y
- }
- if (m) throw "Error: MarchingSquares cannot operate with non-positive cell dimensions";
- if (0 > g) throw "Error: MarchingSquares cannot use a negative quality value for interpolation";
- if (m = null != e) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- if (!(m = 0 >= e.zpp_inner.x)) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- m = 0 >= e.zpp_inner.y
- }
- }
- if (m) throw "Error: MarchingSquares cannot with non-positive sub-grid dimensions";
- l = null != l ? l : new h.geom.GeomPolyList;
- if (null == e) c.geom.ZPP_MarchingSquares.run(a,
- function (a) {
- b.zpp_inner.validate();
- return b.zpp_inner.minx
- }(this), function (a) {
- b.zpp_inner.validate();
- return b.zpp_inner.miny
- }(this), b.zpp_inner.getmax().get_x(), b.zpp_inner.getmax().get_y(), d, g, f, l);
- else {
- b.zpp_inner.validate();
- m = b.zpp_inner.width();
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- var u = m / e.zpp_inner.x;
- b.zpp_inner.validate();
- m = b.zpp_inner.height();
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- var p = m / e.zpp_inner.y;
- m = u | 0;
- var C = p | 0;
- m != u && m++;
- C != p && C++;
- for (u = 0; u < m;) {
- var r = u++;
- b.zpp_inner.validate();
- p = b.zpp_inner.minx;
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- p += e.zpp_inner.x * r;
- if (r == m - 1) r = b.zpp_inner.getmax().get_x();
- else {
- r = p;
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- r += e.zpp_inner.x
- }
- for (var k = 0; k < C;) {
- var w = k++;
- b.zpp_inner.validate();
- var t = b.zpp_inner.miny;
- if (null != e &&
- e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- t += e.zpp_inner.y * w;
- if (w == C - 1) w = b.zpp_inner.getmax().get_y();
- else {
- w = t;
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- w += e.zpp_inner.y
- }
- c.geom.ZPP_MarchingSquares.run(a, p, t, r, w, d, g, f, l)
- }
- }
- }
- d.zpp_inner.weak ? (d.dispose(), !0) : !1;
- null != e && (e.zpp_inner.weak ? (e.dispose(), !0) : !1);
- return l
- };
- h.geom.Mat23 = function (a, b, d, g, e, f) {
- null == f && (f = 0);
- null == e && (e = 0);
- null == g &&
- (g = 1);
- null == d && (d = 0);
- null == b && (b = 0);
- null == a && (a = 1);
- this.zpp_inner = null;
- this.zpp_inner = c.geom.ZPP_Mat23.get();
- this.zpp_inner.outer = this;
- if (a != a) throw "Error: Mat23::a cannot be NaN";
- this.zpp_inner.a = a;
- this.zpp_inner.invalidate();
- this.zpp_inner.a;
- if (b != b) throw "Error: Mat23::b cannot be NaN";
- this.zpp_inner.b = b;
- this.zpp_inner.invalidate();
- this.zpp_inner.b;
- if (e != e) throw "Error: Mat23::tx cannot be NaN";
- this.zpp_inner.tx = e;
- this.zpp_inner.invalidate();
- this.zpp_inner.tx;
- if (d != d) throw "Error: Mat23::c cannot be NaN";
- this.zpp_inner.c = d;
- this.zpp_inner.invalidate();
- this.zpp_inner.c;
- if (g != g) throw "Error: Mat23::d cannot be NaN";
- this.zpp_inner.d = g;
- this.zpp_inner.invalidate();
- this.zpp_inner.d;
- if (f != f) throw "Error: Mat23::ty cannot be NaN";
- this.zpp_inner.ty = f;
- this.zpp_inner.invalidate();
- this.zpp_inner.ty
- };
- s["nape.geom.Mat23"] = h.geom.Mat23;
- h.geom.Mat23.__name__ = ["nape", "geom", "Mat23"];
- h.geom.Mat23.fromMatrix = function (a) {
- return new h.geom.Mat23(a.a, a.c, a.b, a.d, a.tx, a.ty)
- };
- h.geom.Mat23.rotation = function (a) {
- if (a != a) throw "Error: Cannot create rotation matrix with NaN angle";
- var b = Math.cos(a);
- a = Math.sin(a);
- return new h.geom.Mat23(b, -a, a, b, 0, 0)
- };
- h.geom.Mat23.translation = function (a, b) {
- return new h.geom.Mat23(1, 0, 0, 1, a, b)
- };
- h.geom.Mat23.scale = function (a, b) {
- return new h.geom.Mat23(a, 0, 0, b, 0, 0)
- };
- h.geom.Mat23.prototype = {
- orthogonalise: function () {
- if (!this.orthogonal()) {
- var a = Math.sqrt(this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.c * this.zpp_inner.c),
- b = Math.sqrt(this.zpp_inner.b * this.zpp_inner.b + this.zpp_inner.d * this.zpp_inner.d);
- if (a * a < h.Config.epsilon || b * b < h.Config.epsilon) throw "Error: Matrix is singular and cannot be orthogonalised";
- var a = 1 / a,
- b = 1 / b,
- d = this;
- d.set_a(d.zpp_inner.a * a);
- d = this;
- d.set_c(d.zpp_inner.c * a);
- d = this;
- d.set_b(d.zpp_inner.b * b);
- d = this;
- d.set_d(d.zpp_inner.d * b);
- 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);
- 0 < this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c && (b = -b);
- var a = Math.sin(b),
- b = Math.cos(b),
- d = this.zpp_inner.a * b - this.zpp_inner.c * a,
- c = this.zpp_inner.b * b + this.zpp_inner.d * a;
- this.set_c(this.zpp_inner.c * b + this.zpp_inner.a * a);
- if (d != d) throw "Error: Mat23::a cannot be NaN";
- this.zpp_inner.a = d;
- this.zpp_inner.invalidate();
- this.zpp_inner.a;
- this.set_d(this.zpp_inner.d * b - this.zpp_inner.b * a);
- if (c != c) throw "Error: Mat23::b cannot be NaN";
- this.zpp_inner.b = c;
- this.zpp_inner.invalidate();
- this.zpp_inner.b;
- this.zpp_inner.invalidate()
- }
- return this
- },
- equiorthogonalise: function () {
- if (!this.equiorthogonal()) {
- var a = Math.sqrt(this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.c * this.zpp_inner.c),
- b = Math.sqrt(this.zpp_inner.b * this.zpp_inner.b + this.zpp_inner.d * this.zpp_inner.d);
- if (a * a < h.Config.epsilon ||
- b * b < h.Config.epsilon) throw "Error: Matrix is singular and cannot be equiorthogonalised";
- var d = (a + b) / 2,
- a = d / a,
- b = d / b,
- c = this;
- c.set_a(c.zpp_inner.a * a);
- c = this;
- c.set_c(c.zpp_inner.c * a);
- c = this;
- c.set_b(c.zpp_inner.b * b);
- c = this;
- c.set_d(c.zpp_inner.d * b);
- 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));
- 0 < this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c && (b = -b);
- a = Math.sin(b);
- b = Math.cos(b);
- d = this.zpp_inner.a * b - this.zpp_inner.c * a;
- c = this.zpp_inner.b *
- b + this.zpp_inner.d * a;
- this.set_c(this.zpp_inner.c * b + this.zpp_inner.a * a);
- if (d != d) throw "Error: Mat23::a cannot be NaN";
- this.zpp_inner.a = d;
- this.zpp_inner.invalidate();
- this.zpp_inner.a;
- this.set_d(this.zpp_inner.d * b - this.zpp_inner.b * a);
- if (c != c) throw "Error: Mat23::b cannot be NaN";
- this.zpp_inner.b = c;
- this.zpp_inner.invalidate();
- this.zpp_inner.b;
- this.zpp_inner.invalidate()
- }
- return this
- },
- orthogonal: function () {
- var a = this.zpp_inner.a * this.zpp_inner.b + this.zpp_inner.c * this.zpp_inner.d;
- if (a * a < h.Config.epsilon) {
- var a =
- this.zpp_inner.a * this.zpp_inner.a + this.zpp_inner.b * this.zpp_inner.b - 1,
- b = this.zpp_inner.c * this.zpp_inner.c + this.zpp_inner.d * this.zpp_inner.d - 1;
- return a * a < h.Config.epsilon && b * b < h.Config.epsilon
- }
- return !1
- },
- equiorthogonal: function () {
- if (this.singular()) return !1;
- var a = this.zpp_inner.a * this.zpp_inner.b + this.zpp_inner.c * this.zpp_inner.d;
- 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 <
- h.Config.epsilon) : !1
- },
- toString: function () {
- 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 + " }"
- },
- inverseTransform: function (a, b, d) {
- null == d && (d = !1);
- null == b && (b = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot transform null Vec2";
- if (this.singular()) throw "Error: Matrix is singular and inverse transformation cannot be performed";
- var c =
- 1 / (this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c);
- if (b) d = h.geom.Vec2.get((function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * this.zpp_inner.d - function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * this.zpp_inner.b) * c, (function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * this.zpp_inner.a - function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * this.zpp_inner.c) * c, d);
- else {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- b = a.zpp_inner.x - this.zpp_inner.tx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- var e = a.zpp_inner.y - this.zpp_inner.ty;
- 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)
- }
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return d
- },
- transform: function (a, b, d) {
- null == d && (d = !1);
- null == b && (b = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot transform null Vec2";
- b = b ? h.geom.Vec2.get(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) *
- this.zpp_inner.a + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * this.zpp_inner.b, function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * this.zpp_inner.c + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * this.zpp_inner.d, d) : h.geom.Vec2.get(function (b) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * this.zpp_inner.a + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * this.zpp_inner.b + this.zpp_inner.tx, function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * this.zpp_inner.c + function (b) {
- if (null != a &&
- a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * this.zpp_inner.d + this.zpp_inner.ty, d);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- concat: function (a) {
- if (null == a) throw "Error: Cannot concatenate with null Mat23";
- 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 *
- 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)
- },
- transpose: function () {
- 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)
- },
- inverse: function () {
- if (this.singular()) throw "Error: Matrix is singular and cannot be inverted";
- var a = 1 / (this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c);
- 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)
- },
- singular: function () {
- 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,
- b = this.zpp_inner.a *
- this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c;
- 0 > b && (b = -b);
- return a > h.Config.illConditionedThreshold * b
- },
- get_determinant: function () {
- return this.zpp_inner.a * this.zpp_inner.d - this.zpp_inner.b * this.zpp_inner.c
- },
- toMatrix: function (a) {
- null == a && (a = new k.geom.Matrix);
- a.a = this.zpp_inner.a;
- a.b = this.zpp_inner.c;
- a.c = this.zpp_inner.b;
- a.d = this.zpp_inner.d;
- a.tx = this.zpp_inner.tx;
- a.ty = this.zpp_inner.ty;
- return a
- },
- reset: function () {
- return this.setAs()
- },
- setAs: function (a, b, d, c, e, f) {
- null == f && (f = 0);
- null == e && (e = 0);
- null ==
- c && (c = 1);
- null == d && (d = 0);
- null == b && (b = 0);
- null == a && (a = 1);
- this.zpp_inner.setas(a, b, d, c, e, f);
- this.zpp_inner.invalidate();
- return this
- },
- set: function (a) {
- if (null == a) throw "Error: Cannot set form null matrix";
- this.zpp_inner.set(a.zpp_inner);
- this.zpp_inner.invalidate();
- return this
- },
- copy: function () {
- 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)
- },
- set_ty: function (a) {
- if (a != a) throw "Error: Mat23::ty cannot be NaN";
- this.zpp_inner.ty = a;
- this.zpp_inner.invalidate();
- return this.zpp_inner.ty
- },
- get_ty: function () {
- return this.zpp_inner.ty
- },
- set_tx: function (a) {
- if (a != a) throw "Error: Mat23::tx cannot be NaN";
- this.zpp_inner.tx = a;
- this.zpp_inner.invalidate();
- return this.zpp_inner.tx
- },
- get_tx: function () {
- return this.zpp_inner.tx
- },
- set_d: function (a) {
- if (a != a) throw "Error: Mat23::d cannot be NaN";
- this.zpp_inner.d = a;
- this.zpp_inner.invalidate();
- return this.zpp_inner.d
- },
- get_d: function () {
- return this.zpp_inner.d
- },
- set_c: function (a) {
- if (a != a) throw "Error: Mat23::c cannot be NaN";
- this.zpp_inner.c = a;
- this.zpp_inner.invalidate();
- return this.zpp_inner.c
- },
- get_c: function () {
- return this.zpp_inner.c
- },
- set_b: function (a) {
- if (a != a) throw "Error: Mat23::b cannot be NaN";
- this.zpp_inner.b = a;
- this.zpp_inner.invalidate();
- return this.zpp_inner.b
- },
- get_b: function () {
- return this.zpp_inner.b
- },
- set_a: function (a) {
- if (a != a) throw "Error: Mat23::a cannot be NaN";
- this.zpp_inner.a = a;
- this.zpp_inner.invalidate();
- return this.zpp_inner.a
- },
- get_a: function () {
- return this.zpp_inner.a
- },
- __class__: h.geom.Mat23
- };
- h.geom.MatMN =
- function (a, b) {
- this.zpp_inner = null;
- if (0 >= a || 0 >= b) throw "Error: MatMN::dimensions cannot be < 1";
- this.zpp_inner = new c.geom.ZPP_MatMN(a, b);
- this.zpp_inner.outer = this
- };
- s["nape.geom.MatMN"] = h.geom.MatMN;
- h.geom.MatMN.__name__ = ["nape", "geom", "MatMN"];
- h.geom.MatMN.prototype = {
- mul: function (a) {
- if (this.zpp_inner.n != a.zpp_inner.m) throw "Error: Matrix dimensions aren't compatible";
- for (var b = new h.geom.MatMN(this.zpp_inner.m, a.zpp_inner.n), d = 0, c = this.zpp_inner.m; d < c;)
- for (var e = d++, f = 0, l = a.zpp_inner.n; f < l;) {
- for (var m =
- f++, u = 0, p = 0, C = this.zpp_inner.n; p < C;) {
- var r = p++,
- k;
- if (0 > e || 0 > r || e >= this.zpp_inner.m || r >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
- k = this.zpp_inner.x[e * this.zpp_inner.n + r];
- if (0 > r || 0 > m || r >= a.zpp_inner.m || m >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- u += k * a.zpp_inner.x[r * a.zpp_inner.n + m]
- }
- if (0 > e || 0 > m || e >= b.zpp_inner.m || m >= b.zpp_inner.n) throw "Error: MatMN indices out of range";
- b.zpp_inner.x[e * b.zpp_inner.n + m] = u
- }
- return b
- },
- transpose: function () {
- for (var a = new h.geom.MatMN(this.zpp_inner.n,
- this.zpp_inner.m), b = 0, d = this.zpp_inner.m; b < d;)
- for (var c = b++, e = 0, f = this.zpp_inner.n; e < f;) {
- var l = e++;
- if (0 > l || 0 > c || l >= a.zpp_inner.m || c >= a.zpp_inner.n) throw "Error: MatMN indices out of range";
- var m = a.zpp_inner.x,
- u = l * a.zpp_inner.n + c,
- p = void 0;
- if (0 > c || 0 > l || c >= this.zpp_inner.m || l >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
- p = this.zpp_inner.x[c * this.zpp_inner.n + l];
- m[u] = p
- }
- return a
- },
- toString: function () {
- for (var a = "{ ", b = !0, d = 0, c = this.zpp_inner.m; d < c;) {
- var e = d++;
- b || (a += "; ");
- for (var b = !1, f = 0, l =
- this.zpp_inner.n; f < l;) {
- var m = f++,
- h = void 0;
- if (0 > e || 0 > m || e >= this.zpp_inner.m || m >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
- h = this.zpp_inner.x[e * this.zpp_inner.n + m];
- a += h + " "
- }
- }
- return a + "}"
- },
- setx: function (a, b, d) {
- if (0 > a || 0 > b || a >= this.zpp_inner.m || b >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
- return this.zpp_inner.x[a * this.zpp_inner.n + b] = d
- },
- x: function (a, b) {
- if (0 > a || 0 > b || a >= this.zpp_inner.m || b >= this.zpp_inner.n) throw "Error: MatMN indices out of range";
- return this.zpp_inner.x[a *
- this.zpp_inner.n + b]
- },
- get_cols: function () {
- return this.zpp_inner.n
- },
- get_rows: function () {
- return this.zpp_inner.m
- },
- __class__: h.geom.MatMN
- };
- h.geom.Ray = function (a, b) {
- this.zpp_inner = null;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner = new c.geom.ZPP_Ray;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Ray::origin cannot be null";
- this.zpp_inner.origin.set(a);
- this.zpp_inner.origin;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == b) throw "Error: Ray::direction cannot be null";
- this.zpp_inner.direction.set(b);
- this.zpp_inner.zip_dir = !0;
- this.zpp_inner.direction;
- this.zpp_inner.maxdist = Math.POSITIVE_INFINITY
- };
- s["nape.geom.Ray"] = h.geom.Ray;
- h.geom.Ray.__name__ = ["nape", "geom", "Ray"];
- h.geom.Ray.fromSegment = function (a, b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Ray::fromSegment::start is null";
- if (null == b) throw "Error: Ray::fromSegment::end is null";
- var d = b.sub(a, !0),
- d = new h.geom.Ray(a, d);
- d.set_maxDistance(Math.sqrt(c.geom.ZPP_VecMath.vec_dsq(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this))));
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- b.zpp_inner.weak ? (b.dispose(), !0) : !1;
- return d
- };
- h.geom.Ray.prototype = {
- copy: function () {
- var a = new h.geom.Ray(this.zpp_inner.origin,
- this.zpp_inner.direction);
- a.set_maxDistance(this.zpp_inner.maxdist);
- return a
- },
- at: function (a, b) {
- null == b && (b = !1);
- this.zpp_inner.validate_dir();
- 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)
- },
- aabb: function () {
- return this.zpp_inner.rayAABB().wrapper()
- },
- set_maxDistance: function (a) {
- if (a != a) throw "Error: maxDistance cannot be NaN";
- this.zpp_inner.maxdist = a;
- return this.zpp_inner.maxdist
- },
- get_maxDistance: function () {
- return this.zpp_inner.maxdist
- },
- set_direction: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Ray::direction cannot be null";
- this.zpp_inner.direction.set(a);
- this.zpp_inner.zip_dir = !0;
- return this.zpp_inner.direction
- },
- get_direction: function () {
- return this.zpp_inner.direction
- },
- set_origin: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Ray::origin cannot be null";
- this.zpp_inner.origin.set(a);
- return this.zpp_inner.origin
- },
- get_origin: function () {
- return this.zpp_inner.origin
- },
- get_userData: function () {
- null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
- return this.zpp_inner.userData
- },
- __class__: h.geom.Ray
- };
- h.geom.RayResult = function () {
- this.zpp_inner = null;
- if (!c.geom.ZPP_ConvexRayResult.internal) throw "Error: RayResult cannot be instantiated derp!";
- };
- s["nape.geom.RayResult"] = h.geom.RayResult;
- h.geom.RayResult.__name__ = ["nape", "geom", "RayResult"];
- h.geom.RayResult.prototype = {
- toString: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- var a = "{ shape: " + K.string(function (a) {
- if (null != a.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return a.zpp_inner.shape
- }(this)) + " distance: ";
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return a + this.zpp_inner.toiDistance + " ?inner: " + K.string(function (a) {
- if (null != a.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return a.zpp_inner.inner
- }(this)) + " }"
- },
- dispose: function () {
- if (null !=
- this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- this.zpp_inner.free()
- },
- get_shape: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.shape
- },
- get_inner: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.inner
- },
- get_distance: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.toiDistance
- },
- get_normal: function () {
- if (null != this.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- return this.zpp_inner.normal
- },
- __class__: h.geom.RayResult
- };
- h.geom.RayResultIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_RayResultList.internal) throw "Error: Cannot instantiate RayResultIterator derp!";
- };
- s["nape.geom.RayResultIterator"] = h.geom.RayResultIterator;
- h.geom.RayResultIterator.__name__ = ["nape", "geom", "RayResultIterator"];
- h.geom.RayResultIterator.get = function (a) {
- var b = null == h.geom.RayResultIterator.zpp_pool ? function (a) {
- c.util.ZPP_RayResultList.internal = !0;
- a = new h.geom.RayResultIterator;
- c.util.ZPP_RayResultList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.geom.RayResultIterator.zpp_pool;
- h.geom.RayResultIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.geom.RayResultIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.geom.RayResultIterator.zpp_pool;
- h.geom.RayResultIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.geom.RayResultIterator
- };
- h.geom.RayResultList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_RayResultList;
- this.zpp_inner.outer = this
- };
- s["nape.geom.RayResultList"] = h.geom.RayResultList;
- h.geom.RayResultList.__name__ = ["nape", "geom",
- "RayResultList"
- ];
- h.geom.RayResultList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.geom.RayResultList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.geom.RayResultList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.geom.RayResultIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.geom.RayResultIterator.zpp_pool;
- h.geom.RayResultIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.geom.RayResultIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.geom.RayResultIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.geom.RayResultList,
- d;
- this.zpp_inner.valmod();
- for (d = h.geom.RayResultIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: RayResult is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.geom.RayResultIterator.get(this)
- },
- empty: function () {
- return null ==
- this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next &&
- (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt;
- null != this.zpp_inner.subber && this.zpp_inner.subber(a);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return a
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- 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();
- else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null ==
- b ? this.zpp_inner.inner.head.elt : b.next.elt;
- null != this.zpp_inner.subber && this.zpp_inner.subber(a);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- }
- this.zpp_inner.invalidate();
- return a
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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)) : this.zpp_inner.inner.add(a), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: RayResultList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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() - 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.geom.RayResultList
- };
- h.geom.Vec2 = function (a, b) {
- null == b && (b = 0);
- null == a && (a = 0);
- this.zpp_inner = this.zpp_pool = null;
- if (a != a || b != b) throw "Error: Vec2 components cannot be NaN";
- this.zpp_inner = c.geom.ZPP_Vec2.get(a, b, null);
- this.zpp_inner.outer = this
- };
- s["nape.geom.Vec2"] = h.geom.Vec2;
- h.geom.Vec2.__name__ = ["nape", "geom", "Vec2"];
- h.geom.Vec2.weak = function (a, b) {
- null == b && (b = 0);
- null == a && (a = 0);
- return h.geom.Vec2.get(a, b, !0)
- };
- h.geom.Vec2.get = function (a, b, d) {
- null == d && (d = !1);
- null == b && (b = 0);
- null == a && (a = 0);
- if (a !=
- a || b != b) throw "Error: Vec2 components cannot be NaN";
- var g;
- 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));
- if (null == g.zpp_inner) g.zpp_inner = c.geom.ZPP_Vec2.get(a, b, null), g.zpp_inner.outer = g;
- else {
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- g.zpp_inner.immutable();
- if (a != a || b != b) throw "Error: Vec2 components cannot be NaN";
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- g.zpp_inner.validate();
- var e;
- if (!(e = g.zpp_inner.x != a)) {
- if (null != g && g.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- g.zpp_inner.validate();
- e = g.zpp_inner.y != b
- }
- e && (g.zpp_inner.x = a, g.zpp_inner.y = b, g.zpp_inner.invalidate());
- g
- }
- g.zpp_inner.weak = d;
- return g
- };
- h.geom.Vec2.fromPoint = function (a, b) {
- null == b && (b = !1);
- if (null == a) throw "Error: Cannot create Vec2 from null Point object";
- if (a.x != a.x || a.y != a.y) throw "Error: Error: Vec2 components cannot be NaN";
- return h.geom.Vec2.get(a.x, a.y, b)
- };
- h.geom.Vec2.fromPolar = function (a, b, d) {
- null == d && (d = !1);
- if (a != a) throw "Error: Vec2::length cannot be NaN";
- if (b != b) throw "Error: Vec2::angle cannot be NaN";
- return h.geom.Vec2.get(a * Math.cos(b), a * Math.sin(b), d)
- };
- h.geom.Vec2.dsq = function (a, b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a || null == b) throw "Error: Cannot compute squared distance between null Vec2";
- var d = c.geom.ZPP_VecMath.vec_dsq(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this));
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- b.zpp_inner.weak ? (b.dispose(), !0) : !1;
- return d
- };
- h.geom.Vec2.distance = function (a, b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a || null == b) throw "Error: Cannot compute squared distance between null Vec2";
- var d = Math.sqrt(c.geom.ZPP_VecMath.vec_dsq(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this)));
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- b.zpp_inner.weak ? (b.dispose(), !0) : !1;
- return d
- };
- h.geom.Vec2.prototype = {
- toString: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.toString()
- },
- perp: function (a) {
- null == a && (a = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(- function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), a)
- },
- cross: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot take cross product with null vector";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- var b = a.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b *= this.zpp_inner.x;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- var d = a.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b -= d * this.zpp_inner.y;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- dot: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot take dot product with null vector";
- var b;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b = this.zpp_inner.x;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- b *= a.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- var d = this.zpp_inner.y;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- b += d * a.zpp_inner.y;
- a.zpp_inner.weak ?
- (a.dispose(), !0) : !1;
- return b
- },
- muleq: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (a != a) throw "Error: Cannot multiply with NaN";
- return this.setxy(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * a, function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * a)
- },
- subeq: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (null == a) throw "Error: Cannot subtract null vectors";
- this.setxy(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) - function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) - function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this));
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- addeq: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (null == a) throw "Error: Cannot add null vectors";
- this.setxy(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this));
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- mul: function (a, b) {
- null == b && (b = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (a != a) throw "Error: Cannot multiply with NaN";
- return h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * a, function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * a, b)
- },
- sub: function (a, b) {
- null == b &&
- (b = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot subtract null vectors";
- var d = h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) - function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this),
- function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) - function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), b);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return d
- },
- addMul: function (a, b, d) {
- null == d && (d = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot add null vectors";
- b = h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * b, function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) + function (b) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * b, d);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- add: function (a, b) {
- null == b && (b = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot add null vectors";
- var d = h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) + function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), b);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return d
- },
- unit: function (a) {
- null == a && (a = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (0 == function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a))
- }(this)) throw "Error: Cannot normalise vector of length 0";
- var b = 1 / Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) +
- function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this));
- return h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * b, function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * b, a)
- },
- normalise: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (0 == function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a))
- }(this)) throw "Error: Cannot normalise vector of length 0";
- var a;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a = this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a *= this.zpp_inner.x;
- var b;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b = this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a = 1 / Math.sqrt(a + b * this.zpp_inner.y);
- var d = this;
- d.set_x(function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.x
- }(this) * a);
- d = this;
- d.set_y(function (a) {
- if (null !=
- d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.y
- }(this) * a);
- this.zpp_inner.invalidate();
- return this
- },
- reflect: function (a, b) {
- null == b && (b = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (0 == function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a))
- }(this)) throw "Error: Cannot reflect in zero vector";
- var d = function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a), !0)
- }(this).normalise(),
- d = a.sub(d.muleq(2 * d.dot(a)), b);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return d
- },
- rotate: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (a != a) throw "Error: Cannot rotate Vec2 by NaN";
- if (0 != a % (2 * Math.PI)) {
- var b = Math.sin(a);
- a = Math.cos(a);
- var d = a * this.zpp_inner.x - b * this.zpp_inner.y;
- this.zpp_inner.y = this.zpp_inner.x * b + this.zpp_inner.y * a;
- this.zpp_inner.x = d;
- this.zpp_inner.invalidate()
- }
- return this
- },
- set_angle: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (a != a) throw "Error: Vec2::angle cannot be NaN";
- var b = function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a))
- }(this);
- this.setxy(b * Math.cos(a), b * Math.sin(a));
- return function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) == function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) && 0 == function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) ? 0 : Math.atan2(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a))
- }(this)
- },
- get_angle: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- var a;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a = this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- if (a = a == this.zpp_inner.y) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a = 0 == this.zpp_inner.x
- }
- return a ? 0 : Math.atan2(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this))
- },
- setxy: function (a, b) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (a != a || b != b) throw "Error: Vec2 components cannot be NaN";
- var d;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- if (!(d = this.zpp_inner.x != a)) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- d = this.zpp_inner.y != b
- }
- d && (this.zpp_inner.x =
- a, this.zpp_inner.y = b, this.zpp_inner.invalidate());
- return this
- },
- set: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (null == a) throw "Error: Cannot assign null Vec2";
- var b = this.setxy(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this));
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- lsq: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- var a;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a = this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a *= this.zpp_inner.x;
- var b;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b = this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return a + b * this.zpp_inner.y
- },
- set_length: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (a != a) throw "Error: Vec2::length cannot be NaN";
- var b;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b = this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b *= this.zpp_inner.x;
- var d;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- d = this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- if (0 == b + d * this.zpp_inner.y) throw "Error: Cannot set length of a zero vector";
- a /= Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) + function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this));
- var c = this;
- c.set_x(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this) * a);
- c = this;
- c.set_y(function (a) {
- if (null !=
- c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this) * a);
- this.zpp_inner.invalidate();
- return function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) +
- function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a))
- }(this)
- },
- get_length: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) *
- function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) + function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this))
- },
- set_y: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- if (this.zpp_inner.y != a) {
- if (a != a) throw "Error: Vec2::y cannot be NaN";
- this.zpp_inner.y = a;
- this.zpp_inner.invalidate()
- }
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.y
- },
- get_y: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.y
- },
- set_x: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- if (this.zpp_inner.x != a) {
- if (a != a) throw "Error: Vec2::x cannot be NaN";
- this.zpp_inner.x = a;
- this.zpp_inner.invalidate()
- }
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.x
- },
- get_x: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.x
- },
- toPoint: function (a) {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- null == a && (a = new k.geom.Point);
- var b = a;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b.x = this.zpp_inner.x;
- b = a;
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b.y = this.zpp_inner.y;
- return a
- },
- copy: function (a) {
- null == a && (a = !1);
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (a) {
- if (a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), a)
- },
- dispose: function () {
- if (this.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner.immutable();
- if (this.zpp_inner._inuse) throw "Error: This Vec2 is not disposable";
- var a = this.zpp_inner;
- this.zpp_inner = this.zpp_inner.outer = null;
- var b = this;
- b.zpp_pool = null;
- null != c.util.ZPP_PubPool.nextVec2 ? c.util.ZPP_PubPool.nextVec2.zpp_pool =
- b : c.util.ZPP_PubPool.poolVec2 = b;
- c.util.ZPP_PubPool.nextVec2 = b;
- b.zpp_disp = !0;
- b = a;
- null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
- b._isimmutable = null;
- b._validate = null;
- b._invalidate = null;
- b.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = b
- },
- __class__: h.geom.Vec2
- };
- h.geom.Vec2Iterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_Vec2List.internal) throw "Error: Cannot instantiate Vec2Iterator derp!";
- };
- s["nape.geom.Vec2Iterator"] = h.geom.Vec2Iterator;
- h.geom.Vec2Iterator.__name__ = ["nape", "geom", "Vec2Iterator"];
- h.geom.Vec2Iterator.get = function (a) {
- var b = null == h.geom.Vec2Iterator.zpp_pool ? function (a) {
- c.util.ZPP_Vec2List.internal = !0;
- a = new h.geom.Vec2Iterator;
- c.util.ZPP_Vec2List.internal = !1;
- return a
- }(this) : function (a) {
- a = h.geom.Vec2Iterator.zpp_pool;
- h.geom.Vec2Iterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.geom.Vec2Iterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.zpp_gl();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.geom.Vec2Iterator.zpp_pool;
- h.geom.Vec2Iterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.geom.Vec2Iterator
- };
- h.geom.Vec2List = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_Vec2List;
- this.zpp_inner.outer = this
- };
- s["nape.geom.Vec2List"] = h.geom.Vec2List;
- h.geom.Vec2List.__name__ = ["nape", "geom", "Vec2List"];
- h.geom.Vec2List.fromArray = function (a) {
- if (null ==
- a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.geom.Vec2List, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.geom.Vec2List.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.zpp_gl();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- for (var b = this.iterator(); b.hasNext();) try {
- var d = a,
- c = void 0;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.geom.Vec2Iterator.zpp_pool;
- h.geom.Vec2Iterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- for (var a = "[", b = !0, d = this.iterator(); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- for (a = a.iterator(); a.hasNext();) {
- var b = a.next();
- this.has(b) || this.add(b)
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- for (var b = new h.geom.Vec2List,
- d = this.iterator(); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(a), function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(a), !1)
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_vm();
- return h.geom.Vec2Iterator.get(this)
- },
- empty: function () {
- return 0 == this.zpp_gl()
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; !this.empty();) this.pop();
- else
- for (; !this.empty();) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- if (this.empty()) throw "Error: Cannot remove from empty list";
- this.zpp_vm();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next &&
- (this.zpp_inner.at_ite = null);
- var b = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.wrapper()
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- if (this.empty()) throw "Error: Cannot remove from empty list";
- this.zpp_vm();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.zpp_gl() ? null : this.zpp_inner.inner.iterator_at(this.zpp_gl() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt :
- d.next.elt,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.wrapper()
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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, a.zpp_inner)), this.zpp_inner.invalidate(), null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a));
- return b
- },
- at: function (a) {
- this.zpp_vm();
- if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.zpp_gl() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.wrapper()
- },
- has: function (a) {
- this.zpp_vm();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- zpp_vm: function () {
- this.zpp_inner.valmod()
- },
- zpp_gl: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- get_length: function () {
- return this.zpp_gl()
- },
- __class__: h.geom.Vec2List
- };
- h.geom.Vec3 = function (a, b, d) {
- null == d && (d = 0);
- null == b && (b = 0);
- null == a && (a = 0);
- this.zpp_inner = this.zpp_pool = null;
- this.zpp_inner = new c.geom.ZPP_Vec3;
- this.zpp_inner.outer = this;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.x = a;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.y = b;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.z = d;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- this.zpp_inner.z
- };
- s["nape.geom.Vec3"] = h.geom.Vec3;
- h.geom.Vec3.__name__ = ["nape", "geom", "Vec3"];
- h.geom.Vec3.get = function (a, b, d) {
- null == d && (d = 0);
- null == b && (b = 0);
- null == a && (a = 0);
- var g;
- 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));
- g.setxyz(a, b, d);
- g.zpp_inner.immutable = !1;
- g.zpp_inner._validate = null;
- return g
- };
- h.geom.Vec3.prototype = {
- toString: function () {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- var a = "{ x: " + this.zpp_inner.x + " y: ";
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a = a + this.zpp_inner.y + " z: ";
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return a + this.zpp_inner.z + " }"
- },
- xy: function (a) {
- null == a && (a = !1);
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), a)
- },
- setxyz: function (a, b, d) {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.x = a;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.y = b;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.z = d;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- this.zpp_inner.z;
- return this
- },
- set: function (a) {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot assign null Vec3";
- return this.setxyz(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.z
- }(this))
- },
- lsq: function () {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- var a = this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- var a = a * this.zpp_inner.x,
- b;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b = this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- a += b * this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b = this.zpp_inner.z;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return a + b * this.zpp_inner.z
- },
- set_length: function (a) {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (a != a) throw "Error: Vec3::length cannot be NaN";
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- var b = this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b *=
- this.zpp_inner.x;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- var d = this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- b += d * this.zpp_inner.y;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- d = this.zpp_inner.z;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- if (0 == b + d * this.zpp_inner.z) throw "Error: Cannot set length of a zero vector";
- a /= function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.z
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.z
- }(a))
- }(this);
- b = this;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (b.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- d = b.zpp_inner;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- d.x = b.zpp_inner.x * a;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- b.zpp_inner.x;
- b = this;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (b.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- d = b.zpp_inner;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- d.y = b.zpp_inner.y * a;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- b.zpp_inner.y;
- b = this;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (b.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- d = b.zpp_inner;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- d.z = b.zpp_inner.z * a;
- if (null != b && b.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- b.zpp_inner.z;
- return function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(a) + function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.z
- }(a) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.z
- }(a))
- }(this)
- },
- get_length: function () {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this) + function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this) + function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.z
- }(this) * function (a) {
- if (a.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.z
- }(this))
- },
- dispose: function () {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: This Vec3 is not disposable";
- this.zpp_pool = null;
- null != c.util.ZPP_PubPool.nextVec3 ? c.util.ZPP_PubPool.nextVec3.zpp_pool = this : c.util.ZPP_PubPool.poolVec3 = this;
- c.util.ZPP_PubPool.nextVec3 =
- this;
- this.zpp_disp = !0
- },
- set_z: function (a) {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.z = a;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.z
- },
- get_z: function () {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.z
- },
- set_y: function (a) {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.y = a;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.y
- },
- get_y: function () {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.y
- },
- set_x: function (a) {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (this.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- this.zpp_inner.x =
- a;
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.x
- },
- get_x: function () {
- if (this.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- this.zpp_inner.validate();
- return this.zpp_inner.x
- },
- __class__: h.geom.Vec3
- };
- h.geom.Winding = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate Winding derp!";
- };
- s["nape.geom.Winding"] = h.geom.Winding;
- h.geom.Winding.__name__ = ["nape", "geom", "Winding"];
- h.geom.Winding.get_UNDEFINED =
- function () {
- 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);
- return c.util.ZPP_Flags.Winding_UNDEFINED
- };
- h.geom.Winding.get_CLOCKWISE = function () {
- 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);
- return c.util.ZPP_Flags.Winding_CLOCKWISE
- };
- h.geom.Winding.get_ANTICLOCKWISE = function () {
- 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);
- return c.util.ZPP_Flags.Winding_ANTICLOCKWISE
- };
- h.geom.Winding.prototype = {
- toString: function () {
- 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);
- var a;
- this == c.util.ZPP_Flags.Winding_UNDEFINED ? a = "UNDEFINED" : (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), 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" : ""));
- return a
- },
- __class__: h.geom.Winding
- };
- h.phys = {};
- h.phys.Interactor = function () {
- this.zpp_inner_i = null;
- throw "Error: Cannot instantiate an Interactor, only Shape/Body/Compound";
- };
- s["nape.phys.Interactor"] = h.phys.Interactor;
- h.phys.Interactor.__name__ = ["nape", "phys", "Interactor"];
- h.phys.Interactor.prototype = {
- toString: function () {
- return ""
- },
- get_cbTypes: function () {
- null == this.zpp_inner_i.wrap_cbTypes && this.zpp_inner_i.setupcbTypes();
- return this.zpp_inner_i.wrap_cbTypes
- },
- set_group: function (a) {
- this.zpp_inner_i.immutable_midstep("Interactor::group");
- this.zpp_inner_i.setGroup(null == a ? null : a.zpp_inner);
- return null == this.zpp_inner_i.group ? null : this.zpp_inner_i.group.outer
- },
- get_group: function () {
- return null ==
- this.zpp_inner_i.group ? null : this.zpp_inner_i.group.outer
- },
- get_castCompound: function () {
- return null != this.zpp_inner_i.icompound ? this.zpp_inner_i.icompound.outer : null
- },
- get_castBody: function () {
- return null != this.zpp_inner_i.ibody ? this.zpp_inner_i.ibody.outer : null
- },
- get_castShape: function () {
- return null != this.zpp_inner_i.ishape ? this.zpp_inner_i.ishape.outer : null
- },
- isCompound: function () {
- return null != this.zpp_inner_i.icompound
- },
- isBody: function () {
- return null != this.zpp_inner_i.ibody
- },
- isShape: function () {
- return null !=
- this.zpp_inner_i.ishape
- },
- get_userData: function () {
- null == this.zpp_inner_i.userData && (this.zpp_inner_i.userData = {});
- return this.zpp_inner_i.userData
- },
- get_id: function () {
- return this.zpp_inner_i.id
- },
- __class__: h.phys.Interactor
- };
- h.phys.Body = function (a, b) {
- this.debugDraw = !0;
- this.zpp_inner = null;
- try {
- h.phys.Interactor.call(this)
- } catch (d) {}
- this.zpp_inner = new c.phys.ZPP_Body;
- this.zpp_inner.outer = this;
- this.zpp_inner.outer_i = this;
- this.zpp_inner_i = this.zpp_inner;
- if (null != b) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- var g = this.zpp_inner;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- g.posx = b.zpp_inner.x;
- g = this.zpp_inner;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- g.posy = b.zpp_inner.y
- } else this.zpp_inner.posx = 0, this.zpp_inner.posy = 0;
- this.set_type(null == a ? function (a) {
- 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);
- return c.util.ZPP_Flags.BodyType_DYNAMIC
- }(this) : a);
- null != b && (b.zpp_inner.weak ? (b.dispose(), !0) : !1);
- this.zpp_inner_i.insert_cbtype(c.callbacks.ZPP_CbType.ANY_BODY.zpp_inner)
- };
- s["nape.phys.Body"] = h.phys.Body;
- h.phys.Body.__name__ = ["nape", "phys", "Body"];
- h.phys.Body.__super__ = h.phys.Interactor;
- h.phys.Body.prototype = I(h.phys.Interactor.prototype, {
- toString: function () {
- return (this.zpp_inner.world ? "(space::world" : "(" + (this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC ? "dynamic" : this.zpp_inner.type ==
- c.util.ZPP_Flags.id_BodyType_STATIC ? "static" : "kinematic")) + ")#" + this.zpp_inner_i.id
- },
- contains: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot check containment of null point";
- var b = a.zpp_inner.weak;
- a.zpp_inner.weak = !1;
- var d;
- d = !1;
- for (var c = this.zpp_inner.shapes.head; null != c;) {
- if (c.elt.outer.contains(a)) {
- d = !0;
- break
- }
- c = c.next
- }
- a.zpp_inner.weak = b;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return d
- },
- totalImpulse: function (a, b) {
- null == b &&
- (b = !1);
- var d = 0,
- g = 0,
- e = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
- var l = f.next().zpp_inner;
- if (l.type != c.dynamics.ZPP_Arbiter.SENSOR && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
- var l = l.wrapper().totalImpulse(this, b),
- m = 1,
- u = m;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- d += l.zpp_inner.x * u;
- if (null !=
- l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- g += l.zpp_inner.y * u;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- e += l.zpp_inner.z * m;
- l.dispose()
- }
- }
- for (f = this.zpp_inner.constraints.head; null != f;) {
- l = f.elt;
- if (l.active) {
- l = l.outer.bodyImpulse(this);
- u = m = 1;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- d += l.zpp_inner.x * u;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- g += l.zpp_inner.y * u;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- e += l.zpp_inner.z * m;
- l.dispose()
- }
- f = f.next
- }
- return h.geom.Vec3.get(d, g, e)
- },
- constraintsImpulse: function () {
- for (var a = 0, b = 0, d = 0, c = this.zpp_inner.constraints.head; null != c;) {
- var e = c.elt.outer.bodyImpulse(this);
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- a += 1 * e.zpp_inner.x;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- b += 1 * e.zpp_inner.y;
- if (null != e && e.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- d += 1 * e.zpp_inner.z;
- e.dispose();
- c = c.next
- }
- return h.geom.Vec3.get(a, b, d)
- },
- totalFluidImpulse: function (a) {
- var b = 0,
- d = 0,
- g = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var e = this.zpp_inner.wrap_arbiters.iterator(); e.hasNext();) {
- var f = e.next().zpp_inner;
- if (f.type == c.dynamics.ZPP_Arbiter.FLUID &&
- (null == a || f.b2 == a.zpp_inner || f.b1 == a.zpp_inner)) {
- f = f.wrapper().get_fluidArbiter().totalImpulse(this);
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- b += 1 * f.zpp_inner.x;
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- d += 1 * f.zpp_inner.y;
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- g += 1 * f.zpp_inner.z;
- f.dispose()
- }
- }
- return h.geom.Vec3.get(b,
- d, g)
- },
- dragImpulse: function (a) {
- var b = 0,
- d = 0,
- g = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var e = this.zpp_inner.wrap_arbiters.iterator(); e.hasNext();) {
- var f = e.next().zpp_inner;
- if (f.type == c.dynamics.ZPP_Arbiter.FLUID && (null == a || f.b2 == a.zpp_inner || f.b1 == a.zpp_inner)) {
- f = f.wrapper().get_fluidArbiter().dragImpulse(this);
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- b += 1 * f.zpp_inner.x;
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- d += 1 * f.zpp_inner.y;
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- g += 1 * f.zpp_inner.z;
- f.dispose()
- }
- }
- return h.geom.Vec3.get(b, d, g)
- },
- buoyancyImpulse: function (a) {
- var b = 0,
- d = 0,
- g = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var e = this.zpp_inner.wrap_arbiters.iterator(); e.hasNext();) {
- var f =
- e.next().zpp_inner;
- if (f.type == c.dynamics.ZPP_Arbiter.FLUID && (null == a || f.b2 == a.zpp_inner || f.b1 == a.zpp_inner)) {
- f = f.wrapper().get_fluidArbiter().buoyancyImpulse(this);
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- b += 1 * f.zpp_inner.x;
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- d += 1 * f.zpp_inner.y;
- if (null != f && f.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- g += 1 * f.zpp_inner.z;
- f.dispose()
- }
- }
- return h.geom.Vec3.get(b, d, g)
- },
- rollingImpulse: function (a, b) {
- null == b && (b = !1);
- var d = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var g = this.zpp_inner.wrap_arbiters.iterator(); g.hasNext();) {
- var e = g.next().zpp_inner;
- 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))
- }
- return d
- },
- totalContactsImpulse: function (a,
- b) {
- null == b && (b = !1);
- var d = 0,
- g = 0,
- e = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
- var l = f.next().zpp_inner;
- if (l.type == c.dynamics.ZPP_Arbiter.COL && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
- l = l.wrapper().get_collisionArbiter().totalImpulse(this, b);
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- d += 1 * l.zpp_inner.x;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- g += 1 * l.zpp_inner.y;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- e += 1 * l.zpp_inner.z;
- l.dispose()
- }
- }
- return h.geom.Vec3.get(d, g, e)
- },
- tangentImpulse: function (a, b) {
- null == b && (b = !1);
- var d = 0,
- g = 0,
- e = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
- var l =
- f.next().zpp_inner;
- if (l.type == c.dynamics.ZPP_Arbiter.COL && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
- l = l.wrapper().get_collisionArbiter().tangentImpulse(this, b);
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- d += 1 * l.zpp_inner.x;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- g += 1 * l.zpp_inner.y;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- e += 1 * l.zpp_inner.z;
- l.dispose()
- }
- }
- return h.geom.Vec3.get(d, g, e)
- },
- normalImpulse: function (a, b) {
- null == b && (b = !1);
- var d = 0,
- g = 0,
- e = 0;
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var f = this.zpp_inner.wrap_arbiters.iterator(); f.hasNext();) {
- var l = f.next().zpp_inner;
- if (l.type == c.dynamics.ZPP_Arbiter.COL && (null == a || l.b2 == a.zpp_inner || l.b1 == a.zpp_inner)) {
- l = l.wrapper().get_collisionArbiter().normalImpulse(this, b);
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- d += 1 * l.zpp_inner.x;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- g += 1 * l.zpp_inner.y;
- if (null != l && l.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- e += 1 * l.zpp_inner.z;
- l.dispose()
- }
- }
- return h.geom.Vec3.get(d, g, e)
- },
- get_worldCOM: function () {
- if (this.zpp_inner.world) throw "Error: Space::world has no worldCOM";
- null == this.zpp_inner.wrap_worldCOM && (this.zpp_inner.wrap_worldCOM = h.geom.Vec2.get(this.zpp_inner.worldCOMx,
- 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)));
- return this.zpp_inner.wrap_worldCOM
- },
- get_localCOM: function () {
- if (this.zpp_inner.world) throw "Error: Space::world has no localCOM";
- 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)));
- return this.zpp_inner.wrap_localCOM
- },
- setShapeFluidProperties: function (a) {
- this.zpp_inner.immutable_midstep("Body::setShapeFluidProperties()");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.set_fluidProperties(a), b = b.next;
- return this
- },
- setShapeFilters: function (a) {
- this.zpp_inner.immutable_midstep("Body::setShapeFilters()");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.set_filter(a), b = b.next;
- return this
- },
- setShapeMaterials: function (a) {
- this.zpp_inner.immutable_midstep("Body::setShapeMaterials()");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.set_material(a), b = b.next;
- return this
- },
- rotate: function (a, b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot rotate about a null Vec2";
- if (b != b) throw "Error: Cannot rotate by NaN radians";
- var d = a.zpp_inner.weak;
- a.zpp_inner.weak = !1;
- null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
- var c = this.zpp_inner.wrap_pos.sub(a);
- c.rotate(b);
- this.set_position(a.add(c, !0));
- c.dispose();
- this.set_rotation(this.zpp_inner.rot + b);
- a.zpp_inner.weak = d;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- align: function () {
- this.zpp_inner.immutable_midstep("Body::align()");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (null == this.zpp_inner.shapes.head) throw "Error: Cannot align empty Body";
- this.zpp_inner.validate_localCOM();
- var a = h.geom.Vec2.get(-this.zpp_inner.localCOMx, -this.zpp_inner.localCOMy, null);
- this.translateShapes(a);
- var b = this.localVectorToWorld(a);
- null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
- this.zpp_inner.wrap_pos.subeq(b);
- if (this.zpp_inner.pre_posx < Math.POSITIVE_INFINITY) {
- var d = this.zpp_inner,
- c = this.zpp_inner.pre_posx;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- d.pre_posx = c - 1 * b.zpp_inner.x;
- d = this.zpp_inner;
- c = this.zpp_inner.pre_posy;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- d.pre_posy = c - 1 * b.zpp_inner.y
- }
- a.dispose();
- b.dispose();
- return this
- },
- transformShapes: function (a) {
- this.zpp_inner.immutable_midstep("Body::transformShapes()");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.transform(a), b = b.next;
- return this
- },
- scaleShapes: function (a, b) {
- this.zpp_inner.immutable_midstep("Body::scaleShapes()");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- for (var d = this.zpp_inner.shapes.head; null != d;) d.elt.outer.scale(a, b), d = d.next;
- return this
- },
- rotateShapes: function (a) {
- this.zpp_inner.immutable_midstep("Body::rotateShapes()");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- for (var b = this.zpp_inner.shapes.head; null != b;) b.elt.outer.rotate(a), b = b.next;
- return this
- },
- translateShapes: function (a) {
- this.zpp_inner.immutable_midstep("Body::translateShapes()");
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (null == a) throw "Error: Cannot displace by null Vec2";
- var b = a.zpp_inner.weak;
- a.zpp_inner.weak = !1;
- for (var d = this.zpp_inner.shapes.head; null != d;) d.elt.outer.translate(a), d = d.next;
- a.zpp_inner.weak = b;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- applyAngularImpulse: function (a, b) {
- null == b && (b = !1);
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- var d;
- if (d = b) {
- if (null == this.zpp_inner.space) throw "Error: isSleeping makes no sense if the object is not contained within a Space";
- d = this.zpp_inner.component.sleeping
- }
- if (d) return this;
- this.zpp_inner.validate_inertia();
- this.zpp_inner.angvel += a * this.zpp_inner.iinertia;
- b || this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.zpp_inner.wake();
- return this
- },
- applyImpulse: function (a, b, d) {
- null == d && (d = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (null == a) throw "Error: Cannot apply null impulse to Body";
- var g;
- if (g = d) {
- if (null == this.zpp_inner.space) throw "Error: isSleeping makes no sense if the object is not contained within a Space";
- g = this.zpp_inner.component.sleeping
- }
- if (g) return a.zpp_inner.weak ? (a.dispose(), !0) : !1, this;
- this.zpp_inner.validate_mass();
- g = this.zpp_inner.imass;
- var e = this.zpp_inner,
- f = this.zpp_inner.velx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- e.velx = f + a.zpp_inner.x * g;
- e = this.zpp_inner;
- f = this.zpp_inner.vely;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- e.vely = f + a.zpp_inner.y * g;
- if (null != b) {
- var l = 0;
- g = 0;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- l = b.zpp_inner.x - this.zpp_inner.posx;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- g = b.zpp_inner.y - this.zpp_inner.posy;
- this.zpp_inner.validate_inertia();
- e = this.zpp_inner;
- f = this.zpp_inner.angvel;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- l *= a.zpp_inner.y;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- e.angvel = f + (l - a.zpp_inner.x * g) * this.zpp_inner.iinertia;
- b.zpp_inner.weak ? (b.dispose(), !0) : !1
- }
- d || this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.zpp_inner.wake();
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- worldVectorToLocal: function (a, b) {
- null == b && (b = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot transform null Vec2";
- this.zpp_inner.validate_axis();
- var d = 0,
- c = 0;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- d = a.zpp_inner.x * this.zpp_inner.axisy;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- d += a.zpp_inner.y *
- this.zpp_inner.axisx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- c = a.zpp_inner.y * this.zpp_inner.axisy;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- c -= a.zpp_inner.x * this.zpp_inner.axisx;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return h.geom.Vec2.get(d, c, b)
- },
- localVectorToWorld: function (a, b) {
- null == b && (b = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null ==
- a) throw "Error: Cannot transform null Vec2";
- this.zpp_inner.validate_axis();
- var d = 0,
- c = 0,
- d = this.zpp_inner.axisy;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- d *= a.zpp_inner.x;
- c = this.zpp_inner.axisx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- d -= c * a.zpp_inner.y;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- c = a.zpp_inner.x * this.zpp_inner.axisx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- c += a.zpp_inner.y * this.zpp_inner.axisy;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return h.geom.Vec2.get(d, c, b)
- },
- worldPointToLocal: function (a, b) {
- null == b && (b = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot transform null Vec2";
- this.zpp_inner.validate_axis();
- var d = 0,
- c = 0,
- e = c = 0;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- c = a.zpp_inner.x - this.zpp_inner.posx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- e = a.zpp_inner.y - this.zpp_inner.posy;
- d = c * this.zpp_inner.axisy + e * this.zpp_inner.axisx;
- c = e * this.zpp_inner.axisy - c * this.zpp_inner.axisx;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return h.geom.Vec2.get(d, c, b)
- },
- localPointToWorld: function (a, b) {
- null == b && (b = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot transform null Vec2";
- this.zpp_inner.validate_axis();
- var d = 0,
- c = 0,
- d = this.zpp_inner.axisy;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- d *= a.zpp_inner.x;
- c = this.zpp_inner.axisx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- d -= c * a.zpp_inner.y;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- c = a.zpp_inner.x * this.zpp_inner.axisx;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- c += a.zpp_inner.y * this.zpp_inner.axisy;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return h.geom.Vec2.get(d + this.zpp_inner.posx, c + this.zpp_inner.posy, b)
- },
- crushFactor: function () {
- 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";
- var a = 0,
- b = h.geom.Vec2.get(null, null, null);
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- for (var d = this.zpp_inner.wrap_arbiters.iterator(); d.hasNext();) {
- var g = d.next().totalImpulse(this),
- e = g.xy();
- b.addeq(e);
- a += function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) +
- function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a))
- }(this);
- e.dispose();
- g.dispose()
- }
- null == this.zpp_inner.wrap_constraints && (this.zpp_inner.wrap_constraints = c.util.ZPP_ConstraintList.get(this.zpp_inner.constraints, !0));
- for (d = this.zpp_inner.wrap_constraints.iterator(); d.hasNext();) g =
- d.next().bodyImpulse(this), e = g.xy(), b.addeq(e), a += function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) + function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a))
- }(this), e.dispose(), g.dispose();
- a -= function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(a) * function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(a) + function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(a) * function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(a))
- }(this);
- if (this.zpp_inner.world) throw "Error: Space::world has no mass";
- this.zpp_inner.validate_mass();
- 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";
- a /= this.zpp_inner.cmass * (null == this.zpp_inner.space ? null : this.zpp_inner.space.outer).zpp_inner.pre_dt;
- b.dispose();
- return a
- },
- interactingBodies: function (a, b, d) {
- null == b && (b = -1);
- 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 =
- 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));
- return this.zpp_inner.interactingBodies(a, b, d)
- },
- connectedBodies: function (a, b) {
- null ==
- a && (a = -1);
- return this.zpp_inner.connectedBodies(a, b)
- },
- set_inertia: function (a) {
- this.zpp_inner.immutable_midstep("Body::inertia");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (a != a) throw "Error: Inertia cannot be NaN";
- if (0 >= a) throw "Error: Inertia must be strictly positive";
- if (a >= Math.POSITIVE_INFINITY) throw "Error: Inertia cannot be infinite, use allowRotation = false instead";
- this.zpp_inner.inertiaMode = c.util.ZPP_Flags.id_InertiaMode_FIXED;
- this.zpp_inner.cinertia = a;
- this.zpp_inner.invalidate_inertia();
- if (this.zpp_inner.world) throw "Error: Space::world has no inertia";
- this.zpp_inner.validate_inertia();
- 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";
- return this.zpp_inner.cinertia
- },
- get_inertia: function () {
- if (this.zpp_inner.world) throw "Error: Space::world has no inertia";
- this.zpp_inner.validate_inertia();
- 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";
- return this.zpp_inner.cinertia
- },
- get_constraintInertia: function () {
- this.zpp_inner.world || this.zpp_inner.validate_inertia();
- return this.zpp_inner.sinertia
- },
- set_inertiaMode: function (a) {
- this.zpp_inner.immutable_midstep("Body::inertiaMode");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (null == a) throw "Error: Cannot use null InertiaMode";
- var b = this.zpp_inner;
- 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);
- b.inertiaMode = a == c.util.ZPP_Flags.InertiaMode_FIXED ? c.util.ZPP_Flags.id_InertiaMode_FIXED : c.util.ZPP_Flags.id_InertiaMode_DEFAULT;
- this.zpp_inner.invalidate_inertia();
- 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);
- a = c.util.ZPP_Flags.InertiaMode_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);
- return [a, c.util.ZPP_Flags.InertiaMode_FIXED][this.zpp_inner.inertiaMode]
- },
- get_inertiaMode: function () {
- 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);
- var a = c.util.ZPP_Flags.InertiaMode_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);
- return [a, c.util.ZPP_Flags.InertiaMode_FIXED][this.zpp_inner.inertiaMode]
- },
- set_gravMassScale: function (a) {
- this.zpp_inner.immutable_midstep("Body::gravMassScale");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (a != a) throw "Error: gravMassScale cannot be NaN";
- this.zpp_inner.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_SCALED;
- this.zpp_inner.gravMassScale = a;
- this.zpp_inner.invalidate_gravMassScale();
- this.zpp_inner.validate_gravMassScale();
- 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";
- return this.zpp_inner.gravMassScale
- },
- get_gravMassScale: function () {
- this.zpp_inner.validate_gravMassScale();
- 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";
- return this.zpp_inner.gravMassScale
- },
- set_gravMass: function (a) {
- this.zpp_inner.immutable_midstep("Body::gravMass");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (a != a) throw "Error: gravMass cannot be NaN";
- this.zpp_inner.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_FIXED;
- this.zpp_inner.gravMass = a;
- this.zpp_inner.invalidate_gravMass();
- if (this.zpp_inner.world) throw "Error: Space::world has no gravMass";
- this.zpp_inner.validate_gravMass();
- 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";
- return this.zpp_inner.gravMass
- },
- get_gravMass: function () {
- if (this.zpp_inner.world) throw "Error: Space::world has no gravMass";
- this.zpp_inner.validate_gravMass();
- 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";
- return this.zpp_inner.gravMass
- },
- set_gravMassMode: function (a) {
- this.zpp_inner.immutable_midstep("Body::gravMassMode");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (null == a) throw "Error: Cannot use null gravMassMode";
- var b = this.zpp_inner;
- 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 == 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 :
- c.util.ZPP_Flags.id_GravMassMode_FIXED);
- b.gravMassMode = a;
- this.zpp_inner.invalidate_gravMass();
- 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);
- b = c.util.ZPP_Flags.GravMassMode_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);
- a = c.util.ZPP_Flags.GravMassMode_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);
- return [b, a, c.util.ZPP_Flags.GravMassMode_SCALED][this.zpp_inner.massMode]
- },
- get_gravMassMode: function () {
- 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);
- var a = c.util.ZPP_Flags.GravMassMode_DEFAULT,
- b;
- 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);
- b = c.util.ZPP_Flags.GravMassMode_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);
- return [a, b, c.util.ZPP_Flags.GravMassMode_SCALED][this.zpp_inner.massMode]
- },
- set_mass: function (a) {
- this.zpp_inner.immutable_midstep("Body::mass");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (a != a) throw "Error: Mass cannot be NaN";
- if (0 >= a) throw "Error: Mass must be strictly positive";
- if (a >= Math.POSITIVE_INFINITY) throw "Error: Mass cannot be infinite, use allowMovement = false instead";
- this.zpp_inner.massMode = c.util.ZPP_Flags.id_MassMode_FIXED;
- this.zpp_inner.cmass = a;
- this.zpp_inner.invalidate_mass();
- if (this.zpp_inner.world) throw "Error: Space::world has no mass";
- this.zpp_inner.validate_mass();
- 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";
- return this.zpp_inner.cmass
- },
- get_mass: function () {
- if (this.zpp_inner.world) throw "Error: Space::world has no mass";
- this.zpp_inner.validate_mass();
- 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";
- return this.zpp_inner.cmass
- },
- get_constraintMass: function () {
- this.zpp_inner.world || this.zpp_inner.validate_mass();
- return this.zpp_inner.smass
- },
- set_massMode: function (a) {
- this.zpp_inner.immutable_midstep("Body::massMode");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (null == a) throw "Error: cannot use null massMode";
- var b = this.zpp_inner;
- 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);
- b.massMode = a == c.util.ZPP_Flags.MassMode_DEFAULT ? c.util.ZPP_Flags.id_MassMode_DEFAULT : c.util.ZPP_Flags.id_MassMode_FIXED;
- this.zpp_inner.invalidate_mass();
- 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);
- a = c.util.ZPP_Flags.MassMode_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);
- return [a, c.util.ZPP_Flags.MassMode_FIXED][this.zpp_inner.massMode]
- },
- get_massMode: function () {
- var a;
- 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);
- a = c.util.ZPP_Flags.MassMode_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);
- return [a, c.util.ZPP_Flags.MassMode_FIXED][this.zpp_inner.massMode]
- },
- set_allowRotation: function (a) {
- this.zpp_inner.immutable_midstep("Body::" + K.string(a));
- !this.zpp_inner.norotate != a && (this.zpp_inner.norotate = !a, this.zpp_inner.invalidate_inertia());
- return !this.zpp_inner.norotate
- },
- get_allowRotation: function () {
- return !this.zpp_inner.norotate
- },
- set_allowMovement: function (a) {
- this.zpp_inner.immutable_midstep("Body::" + K.string(a));
- !this.zpp_inner.nomove != a && (this.zpp_inner.nomove = !a, this.zpp_inner.invalidate_mass());
- return !this.zpp_inner.nomove
- },
- get_allowMovement: function () {
- return !this.zpp_inner.nomove
- },
- get_bounds: function () {
- if (this.zpp_inner.world) throw "Error: Space::world has no bounds";
- return this.zpp_inner.aabb.wrapper()
- },
- set_torque: function (a) {
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (this.zpp_inner.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Non-dynamic body cannot have torque applied.";
- if (a != a) throw "Error: Body::torque cannot be NaN";
- this.zpp_inner.torque != a && (this.zpp_inner.torque = a, this.zpp_inner.wake());
- return this.zpp_inner.torque
- },
- get_torque: function () {
- return this.zpp_inner.torque
- },
- set_kinAngVel: function (a) {
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (this.zpp_inner.kinangvel != a) {
- if (a != a) throw "Error: Body::kinAngVel cannot be NaN";
- this.zpp_inner.kinangvel = a;
- this.zpp_inner.wake()
- }
- return this.zpp_inner.kinangvel
- },
- get_kinAngVel: function () {
- return this.zpp_inner.kinangvel
- },
- set_angularVel: function (a) {
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (this.zpp_inner.angvel != a) {
- if (a != a) throw "Error: Body::angularVel cannot be NaN";
- if (this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: A static object cannot be given a velocity";
- this.zpp_inner.angvel = a;
- this.zpp_inner.wake()
- }
- return this.zpp_inner.angvel
- },
- get_angularVel: function () {
- return this.zpp_inner.angvel
- },
- set_rotation: function (a) {
- this.zpp_inner.immutable_midstep("Body::rotation");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- 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";
- if (this.zpp_inner.rot != a) {
- if (a != a) throw "Error: Body::rotation cannot be NaN";
- this.zpp_inner.rot = a;
- this.zpp_inner.invalidate_rot();
- this.zpp_inner.wake()
- }
- return this.zpp_inner.rot
- },
- get_rotation: function () {
- return this.zpp_inner.rot
- },
- get_constraintVelocity: function () {
- null == this.zpp_inner.wrapcvel && this.zpp_inner.setup_cvel();
- return this.zpp_inner.wrapcvel
- },
- set_force: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Body::force cannot be null";
- null == this.zpp_inner.wrap_force && this.zpp_inner.setupForce();
- this.zpp_inner.wrap_force.set(a);
- null == this.zpp_inner.wrap_force && this.zpp_inner.setupForce();
- return this.zpp_inner.wrap_force
- },
- get_force: function () {
- null == this.zpp_inner.wrap_force && this.zpp_inner.setupForce();
- return this.zpp_inner.wrap_force
- },
- set_surfaceVel: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Body::surfaceVel cannot be null";
- null == this.zpp_inner.wrap_svel && this.zpp_inner.setupsvel();
- this.zpp_inner.wrap_svel.set(a);
- null == this.zpp_inner.wrap_svel && this.zpp_inner.setupsvel();
- return this.zpp_inner.wrap_svel
- },
- get_surfaceVel: function () {
- null == this.zpp_inner.wrap_svel && this.zpp_inner.setupsvel();
- return this.zpp_inner.wrap_svel
- },
- set_kinematicVel: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Body::kinematicVel cannot be null";
- null == this.zpp_inner.wrap_kinvel && this.zpp_inner.setupkinvel();
- this.zpp_inner.wrap_kinvel.set(a);
- null == this.zpp_inner.wrap_kinvel && this.zpp_inner.setupkinvel();
- return this.zpp_inner.wrap_kinvel
- },
- get_kinematicVel: function () {
- null == this.zpp_inner.wrap_kinvel && this.zpp_inner.setupkinvel();
- return this.zpp_inner.wrap_kinvel
- },
- setVelocityFromTarget: function (a, b, d) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Cannot set velocity for null target position";
- if (0 == d) throw "deltaTime cannot be 0 for setVelocityFromTarget";
- d = 1 / d;
- null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
- this.zpp_inner.wrap_vel.set(a.sub(function (a) {
- null == a.zpp_inner.wrap_pos && a.zpp_inner.setupPosition();
- return a.zpp_inner.wrap_pos
- }(this), !0).muleq(d));
- this.set_angularVel((b - this.zpp_inner.rot) * d);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- set_velocity: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Body::velocity cannot be null";
- null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
- this.zpp_inner.wrap_vel.set(a);
- null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
- return this.zpp_inner.wrap_vel
- },
- get_velocity: function () {
- null == this.zpp_inner.wrap_vel && this.zpp_inner.setupVelocity();
- return this.zpp_inner.wrap_vel
- },
- set_position: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Body::position cannot be null";
- null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
- this.zpp_inner.wrap_pos.set(a);
- null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
- return this.zpp_inner.wrap_pos
- },
- get_position: function () {
- null == this.zpp_inner.wrap_pos && this.zpp_inner.setupPosition();
- return this.zpp_inner.wrap_pos
- },
- copy: function () {
- if (this.zpp_inner.world) throw "Error: Space::world cannot be copied";
- return this.zpp_inner.copy()
- },
- get_constraints: function () {
- null == this.zpp_inner.wrap_constraints && (this.zpp_inner.wrap_constraints = c.util.ZPP_ConstraintList.get(this.zpp_inner.constraints, !0));
- return this.zpp_inner.wrap_constraints
- },
- get_isSleeping: function () {
- if (null == this.zpp_inner.space) throw "Error: isSleeping makes no sense if the object is not contained within a Space";
- return this.zpp_inner.component.sleeping
- },
- get_arbiters: function () {
- null == this.zpp_inner.wrap_arbiters && (this.zpp_inner.wrap_arbiters = c.util.ZPP_ArbiterList.get(this.zpp_inner.arbiters, !0));
- return this.zpp_inner.wrap_arbiters
- },
- set_space: function (a) {
- 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";
- this.zpp_inner.immutable_midstep("Body::space");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- (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));
- return null ==
- this.zpp_inner.space ? null : this.zpp_inner.space.outer
- },
- get_space: function () {
- return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
- },
- set_compound: function (a) {
- (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));
- return null == this.zpp_inner.compound ? null :
- this.zpp_inner.compound.outer
- },
- get_compound: function () {
- return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
- },
- get_shapes: function () {
- return this.zpp_inner.wrap_shapes
- },
- isKinematic: function () {
- return this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC
- },
- isDynamic: function () {
- return this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC
- },
- isStatic: function () {
- return this.zpp_inner.type == c.util.ZPP_Flags.id_BodyType_STATIC
- },
- integrate: function (a) {
- if (a != a) throw "Cannot integrate by NaN time";
- this.zpp_inner.immutable_midstep("Body::space");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (0 == a) return this;
- var b = this.zpp_inner;
- b.sweepTime = 0;
- b.sweep_angvel = b.angvel;
- b.sweepIntegrate(a);
- b.invalidate_pos();
- b.invalidate_rot();
- b.sweepTime = 0;
- return this
- },
- set_disableCCD: function (a) {
- this.zpp_inner.disableCCD = a;
- return this.zpp_inner.disableCCD
- },
- get_disableCCD: function () {
- return this.zpp_inner.disableCCD
- },
- set_isBullet: function (a) {
- this.zpp_inner.bulletEnabled = a;
- return this.zpp_inner.bulletEnabled
- },
- get_isBullet: function () {
- return this.zpp_inner.bulletEnabled
- },
- set_type: function (a) {
- this.zpp_inner.immutable_midstep("Body::type");
- if (this.zpp_inner.world) throw "Error: Space::world is immutable";
- if (c.phys.ZPP_Body.types[this.zpp_inner.type] != a) {
- if (null == a) throw "Error: Cannot use null BodyType";
- 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);
- a == c.util.ZPP_Flags.BodyType_DYNAMIC ? a = c.util.ZPP_Flags.id_BodyType_DYNAMIC :
- (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);
- 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);
- this.zpp_inner.invalidate_type();
- null != this.zpp_inner.space ? this.zpp_inner.space.transmitType(this.zpp_inner,
- a) : this.zpp_inner.type = a
- }
- return c.phys.ZPP_Body.types[this.zpp_inner.type]
- },
- get_type: function () {
- return c.phys.ZPP_Body.types[this.zpp_inner.type]
- },
- __class__: h.phys.Body
- });
- h.phys.BodyIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_BodyList.internal) throw "Error: Cannot instantiate BodyIterator derp!";
- };
- s["nape.phys.BodyIterator"] = h.phys.BodyIterator;
- h.phys.BodyIterator.__name__ = ["nape", "phys", "BodyIterator"];
- h.phys.BodyIterator.get = function (a) {
- var b =
- null == h.phys.BodyIterator.zpp_pool ? function (a) {
- c.util.ZPP_BodyList.internal = !0;
- a = new h.phys.BodyIterator;
- c.util.ZPP_BodyList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.phys.BodyIterator.zpp_pool;
- h.phys.BodyIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.phys.BodyIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.phys.BodyIterator.zpp_pool;
- h.phys.BodyIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.phys.BodyIterator
- };
- h.phys.BodyList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_BodyList;
- this.zpp_inner.outer = this
- };
- s["nape.phys.BodyList"] = h.phys.BodyList;
- h.phys.BodyList.__name__ = ["nape", "phys", "BodyList"];
- h.phys.BodyList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.phys.BodyList,
- d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.phys.BodyList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.phys.BodyIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next =
- h.phys.BodyIterator.zpp_pool;
- h.phys.BodyIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.phys.BodyIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.phys.BodyIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.phys.BodyList,
- d;
- this.zpp_inner.valmod();
- for (d = h.phys.BodyIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Body is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.phys.BodyIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ?
- this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt :
- b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: BodyList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.phys.BodyList
- };
- h.phys.BodyType = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate BodyType derp!";
- };
- s["nape.phys.BodyType"] = h.phys.BodyType;
- h.phys.BodyType.__name__ = ["nape", "phys", "BodyType"];
- h.phys.BodyType.get_STATIC = function () {
- 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);
- return c.util.ZPP_Flags.BodyType_STATIC
- };
- h.phys.BodyType.get_DYNAMIC =
- function () {
- 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);
- return c.util.ZPP_Flags.BodyType_DYNAMIC
- };
- h.phys.BodyType.get_KINEMATIC = function () {
- 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);
- return c.util.ZPP_Flags.BodyType_KINEMATIC
- };
- h.phys.BodyType.prototype = {
- toString: function () {
- 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);
- var a;
- 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 =
- new h.phys.BodyType, c.util.ZPP_Flags.internal = !1), a = this == c.util.ZPP_Flags.BodyType_KINEMATIC ? "KINEMATIC" : ""));
- return a
- },
- __class__: h.phys.BodyType
- };
- h.phys.Compound = function () {
- this.zpp_inner = null;
- try {
- h.phys.Interactor.call(this)
- } catch (a) {}
- this.zpp_inner = new c.phys.ZPP_Compound;
- this.zpp_inner.outer = this;
- this.zpp_inner.outer_i = this;
- this.zpp_inner_i = this.zpp_inner;
- this.zpp_inner.insert_cbtype(c.callbacks.ZPP_CbType.ANY_COMPOUND.zpp_inner)
- };
- s["nape.phys.Compound"] = h.phys.Compound;
- h.phys.Compound.__name__ = ["nape", "phys", "Compound"];
- h.phys.Compound.__super__ = h.phys.Interactor;
- h.phys.Compound.prototype = I(h.phys.Interactor.prototype, {
- rotate: function (a, b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot rotate about a null Vec2";
- if (b != b) throw "Error: Cannot rotate by NaN radians";
- var d = a.zpp_inner.weak;
- a.zpp_inner.weak = !1;
- this.visitBodies(function (d) {
- d.rotate(a, b)
- });
- a.zpp_inner.weak = d;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- translate: function (a) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot translate by null Vec2";
- var b = a.zpp_inner.weak;
- a.zpp_inner.weak = !1;
- this.visitBodies(function (b) {
- null == b.zpp_inner.wrap_pos && b.zpp_inner.setupPosition();
- b.zpp_inner.wrap_pos.addeq(a)
- });
- a.zpp_inner.weak = b;
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- COM: function (a) {
- null == a && (a = !1);
- var b = h.geom.Vec2.get(0, 0, a),
- d = 0;
- this.visitBodies(function (a) {
- if (!a.zpp_inner.wrap_shapes.empty()) {
- b.addeq(function (b) {
- if (a.zpp_inner.world) throw "Error: Space::world has no worldCOM";
- 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)));
- return a.zpp_inner.wrap_worldCOM
- }(this).mul(function (b) {
- if (a.zpp_inner.world) throw "Error: Space::world has no mass";
- a.zpp_inner.validate_mass();
- 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";
- return a.zpp_inner.cmass
- }(this), !0));
- var e = d;
- if (a.zpp_inner.world) throw "Error: Space::world has no mass";
- a.zpp_inner.validate_mass();
- 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";
- d = e + a.zpp_inner.cmass
- }
- });
- if (0 == d) throw "Error: COM of an empty Compound is undefined silly";
- b.muleq(1 / d);
- return b
- },
- visitCompounds: function (a) {
- if (null == a) throw "Error: lambda cannot be null for Compound::visitConstraints";
- for (var b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) {
- var d = b.next();
- a(d);
- d.visitCompounds(a)
- }
- },
- visitConstraints: function (a) {
- if (null == a) throw "Error: lambda cannot be null for Compound::visitConstraints";
- for (var b = this.zpp_inner.wrap_constraints.iterator(); b.hasNext();) {
- var d = b.next();
- a(d)
- }
- for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) d = b.next(), d.visitConstraints(a)
- },
- visitBodies: function (a) {
- if (null == a) throw "Error: lambda cannot be null for Compound::visitBodies";
- for (var b = this.zpp_inner.wrap_bodies.iterator(); b.hasNext();) {
- var d = b.next();
- a(d)
- }
- for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) b.next().visitBodies(a)
- },
- breakApart: function () {
- this.zpp_inner.breakApart()
- },
- copy: function () {
- return this.zpp_inner.copy()
- },
- toString: function () {
- return "Compound" + this.zpp_inner_i.id
- },
- set_space: function (a) {
- if (null != this.zpp_inner.compound) throw "Error: Cannot set the space of an inner Compound, only the root Compound space can be set";
- this.zpp_inner.immutable_midstep("Compound::space");
- (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));
- return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
- },
- get_space: function () {
- return null == this.zpp_inner.space ? null : this.zpp_inner.space.outer
- },
- set_compound: function (a) {
- this.zpp_inner.immutable_midstep("Compound::compound");
- (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));
- return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
- },
- get_compound: function () {
- return null == this.zpp_inner.compound ? null : this.zpp_inner.compound.outer
- },
- get_compounds: function () {
- return this.zpp_inner.wrap_compounds
- },
- get_constraints: function () {
- return this.zpp_inner.wrap_constraints
- },
- get_bodies: function () {
- return this.zpp_inner.wrap_bodies
- },
- __class__: h.phys.Compound
- });
- h.phys.CompoundIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_CompoundList.internal) throw "Error: Cannot instantiate CompoundIterator derp!";
- };
- s["nape.phys.CompoundIterator"] = h.phys.CompoundIterator;
- h.phys.CompoundIterator.__name__ = ["nape", "phys", "CompoundIterator"];
- h.phys.CompoundIterator.get =
- function (a) {
- var b = null == h.phys.CompoundIterator.zpp_pool ? function (a) {
- c.util.ZPP_CompoundList.internal = !0;
- a = new h.phys.CompoundIterator;
- c.util.ZPP_CompoundList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.phys.CompoundIterator.zpp_pool;
- h.phys.CompoundIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.phys.CompoundIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.phys.CompoundIterator.zpp_pool;
- h.phys.CompoundIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.phys.CompoundIterator
- };
- h.phys.CompoundList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_CompoundList;
- this.zpp_inner.outer = this
- };
- s["nape.phys.CompoundList"] = h.phys.CompoundList;
- h.phys.CompoundList.__name__ = ["nape", "phys", "CompoundList"];
- h.phys.CompoundList.fromArray = function (a) {
- if (null ==
- a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.phys.CompoundList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.phys.CompoundList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.phys.CompoundIterator.get(this); b.hasNext();) try {
- var d =
- a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.phys.CompoundIterator.zpp_pool;
- h.phys.CompoundIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.phys.CompoundIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.phys.CompoundIterator.get(a); a.hasNext();) {
- var b =
- a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.phys.CompoundList,
- d;
- this.zpp_inner.valmod();
- for (d = h.phys.CompoundIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Compound is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.phys.CompoundIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null :
- this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() -
- 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: CompoundList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) :
- !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length &&
- (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.phys.CompoundList
- };
- h.phys.FluidProperties = function (a, b) {
- null == b && (b = 1);
- null == a && (a = 1);
- this.zpp_inner = null;
- 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);
- null;
- this.zpp_inner.outer = this;
- if (a != 1E3 *
- this.zpp_inner.density) {
- if (a != a) throw "Error: FluidProperties::density cannot be NaN";
- this.zpp_inner.density = a / 1E3;
- this.zpp_inner.invalidate()
- }
- 1E3 * this.zpp_inner.density;
- if (b != this.zpp_inner.viscosity) {
- if (b != b) throw "Error: FluidProperties::viscosity cannot be NaN";
- if (0 > b) throw "Error: FluidProperties::viscosity (" + b + ") must be >= 0";
- this.zpp_inner.viscosity = b / 1;
- this.zpp_inner.invalidate()
- }
- this.zpp_inner.viscosity
- };
- s["nape.phys.FluidProperties"] = h.phys.FluidProperties;
- h.phys.FluidProperties.__name__ = ["nape", "phys", "FluidProperties"];
- h.phys.FluidProperties.prototype = {
- toString: function () {
- return "{ density: " + 1E3 * this.zpp_inner.density + " viscosity: " + this.zpp_inner.viscosity + " gravity: " + K.string(this.zpp_inner.wrap_gravity) + " }"
- },
- set_gravity: function (a) {
- 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);
- else {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
- this.zpp_inner.wrap_gravity.set(a)
- }
- return this.zpp_inner.wrap_gravity
- },
- get_gravity: function () {
- return this.zpp_inner.wrap_gravity
- },
- set_viscosity: function (a) {
- if (a != this.zpp_inner.viscosity) {
- if (a != a) throw "Error: FluidProperties::viscosity cannot be NaN";
- if (0 > a) throw "Error: FluidProperties::viscosity (" + a + ") must be >= 0";
- this.zpp_inner.viscosity = a / 1;
- this.zpp_inner.invalidate()
- }
- return this.zpp_inner.viscosity
- },
- get_viscosity: function () {
- return this.zpp_inner.viscosity
- },
- set_density: function (a) {
- if (a != 1E3 * this.zpp_inner.density) {
- if (a != a) throw "Error: FluidProperties::density cannot be NaN";
- this.zpp_inner.density = a / 1E3;
- this.zpp_inner.invalidate()
- }
- return 1E3 * this.zpp_inner.density
- },
- get_density: function () {
- return 1E3 * this.zpp_inner.density
- },
- copy: function () {
- var a = new h.phys.FluidProperties(1E3 * this.zpp_inner.density, this.zpp_inner.viscosity);
- null != this.zpp_inner.userData && (a.zpp_inner.userData = W.copy(this.zpp_inner.userData));
- a.set_gravity(this.zpp_inner.wrap_gravity);
- return a
- },
- get_shapes: function () {
- null == this.zpp_inner.wrap_shapes && (this.zpp_inner.wrap_shapes = c.util.ZPP_ShapeList.get(this.zpp_inner.shapes, !0));
- return this.zpp_inner.wrap_shapes
- },
- get_userData: function () {
- null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
- return this.zpp_inner.userData
- },
- __class__: h.phys.FluidProperties
- };
- h.phys.GravMassMode = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate GravMassMode derp!";
- };
- s["nape.phys.GravMassMode"] = h.phys.GravMassMode;
- h.phys.GravMassMode.__name__ = ["nape", "phys", "GravMassMode"];
- h.phys.GravMassMode.get_DEFAULT = function () {
- 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);
- return c.util.ZPP_Flags.GravMassMode_DEFAULT
- };
- h.phys.GravMassMode.get_FIXED = function () {
- 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);
- return c.util.ZPP_Flags.GravMassMode_FIXED
- };
- h.phys.GravMassMode.get_SCALED = function () {
- 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);
- return c.util.ZPP_Flags.GravMassMode_SCALED
- };
- h.phys.GravMassMode.prototype = {
- toString: function () {
- var a;
- 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);
- this == c.util.ZPP_Flags.GravMassMode_DEFAULT ?
- 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" : ""));
- return a
- },
- __class__: h.phys.GravMassMode
- };
- h.phys.InertiaMode =
- function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate InertiaMode derp!";
- };
- s["nape.phys.InertiaMode"] = h.phys.InertiaMode;
- h.phys.InertiaMode.__name__ = ["nape", "phys", "InertiaMode"];
- h.phys.InertiaMode.get_DEFAULT = function () {
- 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);
- return c.util.ZPP_Flags.InertiaMode_DEFAULT
- };
- h.phys.InertiaMode.get_FIXED = function () {
- 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);
- return c.util.ZPP_Flags.InertiaMode_FIXED
- };
- h.phys.InertiaMode.prototype = {
- toString: function () {
- 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);
- var a;
- 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" : "");
- return a
- },
- __class__: h.phys.InertiaMode
- };
- h.phys.InteractorIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_InteractorList.internal) throw "Error: Cannot instantiate InteractorIterator derp!";
- };
- s["nape.phys.InteractorIterator"] = h.phys.InteractorIterator;
- h.phys.InteractorIterator.__name__ = ["nape", "phys",
- "InteractorIterator"
- ];
- h.phys.InteractorIterator.get = function (a) {
- var b = null == h.phys.InteractorIterator.zpp_pool ? function (a) {
- c.util.ZPP_InteractorList.internal = !0;
- a = new h.phys.InteractorIterator;
- c.util.ZPP_InteractorList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.phys.InteractorIterator.zpp_pool;
- h.phys.InteractorIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.phys.InteractorIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.phys.InteractorIterator.zpp_pool;
- h.phys.InteractorIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.phys.InteractorIterator
- };
- h.phys.InteractorList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_InteractorList;
- this.zpp_inner.outer = this
- };
- s["nape.phys.InteractorList"] = h.phys.InteractorList;
- h.phys.InteractorList.__name__ = ["nape",
- "phys", "InteractorList"
- ];
- h.phys.InteractorList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.phys.InteractorList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.phys.InteractorList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.phys.InteractorIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.phys.InteractorIterator.zpp_pool;
- h.phys.InteractorIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.phys.InteractorIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.phys.InteractorIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.phys.InteractorList,
- d;
- this.zpp_inner.valmod();
- for (d = h.phys.InteractorIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Interactor is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.phys.InteractorIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner_i) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null !=
- this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.outer_i;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer_i
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer_i;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null ==
- this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer_i;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer_i
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: InteractorList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer_i
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner_i)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.phys.InteractorList
- };
- h.phys.MassMode = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate MassMode derp!";
- };
- s["nape.phys.MassMode"] = h.phys.MassMode;
- h.phys.MassMode.__name__ = ["nape", "phys", "MassMode"];
- h.phys.MassMode.get_DEFAULT =
- function () {
- 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);
- return c.util.ZPP_Flags.MassMode_DEFAULT
- };
- h.phys.MassMode.get_FIXED = function () {
- 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);
- return c.util.ZPP_Flags.MassMode_FIXED
- };
- h.phys.MassMode.prototype = {
- toString: function () {
- var a;
- 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);
- 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" : "");
- return a
- },
- __class__: h.phys.MassMode
- };
- h.phys.Material = function (a, b, d, g, e) {
- null == e && (e = 0.001);
- null == g && (g = 1);
- null == d && (d = 2);
- null == b &&
- (b = 1);
- null == a && (a = 0);
- this.zpp_inner = null;
- 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);
- null;
- this.zpp_inner.outer = this;
- if (a != this.zpp_inner.elasticity) {
- if (a != a) throw "Error: Material::elasticity cannot be NaN";
- this.zpp_inner.elasticity = a / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
- }
- this.zpp_inner.elasticity;
- if (b != this.zpp_inner.dynamicFriction) {
- if (b !=
- b) throw "Error: Material::dynamicFriction cannot be NaN";
- if (0 > b) throw "Error: Material::dynamicFriction cannot be negative";
- this.zpp_inner.dynamicFriction = b / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ANGDRAG | c.phys.ZPP_Material.ARBITERS)
- }
- this.zpp_inner.dynamicFriction;
- if (d != this.zpp_inner.staticFriction) {
- if (d != d) throw "Error: Material::staticFriction cannot be NaN";
- if (0 > d) throw "Error: Material::staticFriction cannot be negative";
- this.zpp_inner.staticFriction = d / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE |
- c.phys.ZPP_Material.ARBITERS)
- }
- this.zpp_inner.staticFriction;
- if (g != 1E3 * this.zpp_inner.density) {
- if (g != g) throw "Error: Material::density cannot be NaN";
- if (0 > g) throw "Error: Material::density must be positive";
- if (0 > g) throw "Error: Material::density cannot be negative";
- this.zpp_inner.density = g / 1E3;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.PROPS)
- }
- 1E3 * this.zpp_inner.density;
- if (e != this.zpp_inner.rollingFriction) {
- if (e != e) throw "Error: Material::rollingFriction cannot be NaN";
- if (0 >
- e) throw "Error: Material::rollingFriction cannot be negative";
- this.zpp_inner.rollingFriction = e / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
- }
- this.zpp_inner.rollingFriction
- };
- s["nape.phys.Material"] = h.phys.Material;
- h.phys.Material.__name__ = ["nape", "phys", "Material"];
- h.phys.Material.wood = function () {
- return new h.phys.Material(0.4, 0.2, 0.38, 0.7, 0.005)
- };
- h.phys.Material.steel = function () {
- return new h.phys.Material(0.2, 0.57, 0.74, 7.8, 0.001)
- };
- h.phys.Material.ice = function () {
- return new h.phys.Material(0.3,
- 0.03, 0.1, 0.9, 1E-4)
- };
- h.phys.Material.rubber = function () {
- return new h.phys.Material(0.8, 1, 1.4, 1.5, 0.01)
- };
- h.phys.Material.glass = function () {
- return new h.phys.Material(0.4, 0.4, 0.94, 2.6, 0.002)
- };
- h.phys.Material.sand = function () {
- return new h.phys.Material(-1, 0.45, 0.6, 1.6, 16)
- };
- h.phys.Material.prototype = {
- toString: function () {
- return "{ elasticity: " + this.zpp_inner.elasticity + " dynamicFriction: " + this.zpp_inner.dynamicFriction + " staticFriction: " + this.zpp_inner.staticFriction + " density: " + 1E3 * this.zpp_inner.density +
- " rollingFriction: " + this.zpp_inner.rollingFriction + " }"
- },
- set_rollingFriction: function (a) {
- if (a != this.zpp_inner.rollingFriction) {
- if (a != a) throw "Error: Material::rollingFriction cannot be NaN";
- if (0 > a) throw "Error: Material::rollingFriction cannot be negative";
- this.zpp_inner.rollingFriction = a / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
- }
- return this.zpp_inner.rollingFriction
- },
- get_rollingFriction: function () {
- return this.zpp_inner.rollingFriction
- },
- set_density: function (a) {
- if (a !=
- 1E3 * this.zpp_inner.density) {
- if (a != a) throw "Error: Material::density cannot be NaN";
- if (0 > a) throw "Error: Material::density must be positive";
- if (0 > a) throw "Error: Material::density cannot be negative";
- this.zpp_inner.density = a / 1E3;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.PROPS)
- }
- return 1E3 * this.zpp_inner.density
- },
- get_density: function () {
- return 1E3 * this.zpp_inner.density
- },
- set_staticFriction: function (a) {
- if (a != this.zpp_inner.staticFriction) {
- if (a != a) throw "Error: Material::staticFriction cannot be NaN";
- if (0 > a) throw "Error: Material::staticFriction cannot be negative";
- this.zpp_inner.staticFriction = a / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
- }
- return this.zpp_inner.staticFriction
- },
- get_staticFriction: function () {
- return this.zpp_inner.staticFriction
- },
- set_dynamicFriction: function (a) {
- if (a != this.zpp_inner.dynamicFriction) {
- if (a != a) throw "Error: Material::dynamicFriction cannot be NaN";
- if (0 > a) throw "Error: Material::dynamicFriction cannot be negative";
- this.zpp_inner.dynamicFriction =
- a / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ANGDRAG | c.phys.ZPP_Material.ARBITERS)
- }
- return this.zpp_inner.dynamicFriction
- },
- get_dynamicFriction: function () {
- return this.zpp_inner.dynamicFriction
- },
- set_elasticity: function (a) {
- if (a != this.zpp_inner.elasticity) {
- if (a != a) throw "Error: Material::elasticity cannot be NaN";
- this.zpp_inner.elasticity = a / 1;
- this.zpp_inner.invalidate(c.phys.ZPP_Material.WAKE | c.phys.ZPP_Material.ARBITERS)
- }
- return this.zpp_inner.elasticity
- },
- get_elasticity: function () {
- return this.zpp_inner.elasticity
- },
- copy: function () {
- 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);
- null != this.zpp_inner.userData && (a.zpp_inner.userData = W.copy(this.zpp_inner.userData));
- return a
- },
- get_shapes: function () {
- null == this.zpp_inner.wrap_shapes && (this.zpp_inner.wrap_shapes = c.util.ZPP_ShapeList.get(this.zpp_inner.shapes, !0));
- return this.zpp_inner.wrap_shapes
- },
- get_userData: function () {
- null == this.zpp_inner.userData &&
- (this.zpp_inner.userData = {});
- return this.zpp_inner.userData
- },
- __class__: h.phys.Material
- };
- h.shape = {};
- h.shape.Shape = function () {
- this.zpp_inner = null;
- try {
- h.phys.Interactor.call(this)
- } catch (a) {}
- throw "Error: Shape cannot be instantiated derp!";
- };
- s["nape.shape.Shape"] = h.shape.Shape;
- h.shape.Shape.__name__ = ["nape", "shape", "Shape"];
- h.shape.Shape.__super__ = h.phys.Interactor;
- h.shape.Shape.prototype = I(h.phys.Interactor.prototype, {
- toString: function () {
- return (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ?
- "Circle" : "Polygon") + "#" + this.zpp_inner_i.id
- },
- copy: function () {
- return this.zpp_inner.copy()
- },
- contains: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Cannot check null point for containment";
- if (null == (null != this.zpp_inner.body ? this.zpp_inner.body.outer : null)) throw "Error: Shape is not well defined without a Body";
- c.geom.ZPP_Geom.validateShape(this.zpp_inner);
- a.zpp_inner.validate();
- var b = c.geom.ZPP_Collide.shapeContains(this.zpp_inner, a.zpp_inner);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- transform: function (a) {
- this.zpp_inner.immutable_midstep("Shape::transform()");
- 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";
- if (null == a) throw "Error: Cannot transform Shape by null matrix";
- if (a.singular()) throw "Error: Cannot transform Shape by a singular matrix";
- if (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE)
- if (a.equiorthogonal()) this.zpp_inner.circle.__transform(a);
- else throw "Error: Cannot transform Circle by a non equiorthogonal matrix";
- else this.zpp_inner.polygon.__transform(a);
- return this
- },
- rotate: function (a) {
- this.zpp_inner.immutable_midstep("Shape::rotate()");
- 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";
- if (a != a) throw "Error: Cannot rotate Shape by NaN";
- if (0 != a % (2 * Math.PI)) {
- var b = Math.cos(a);
- a = Math.sin(a);
- 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)
- }
- return this
- },
- scale: function (a, b) {
- this.zpp_inner.immutable_midstep("Shape::scale()");
- 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";
- if (a != a || b != b) throw "Error: Cannot scale Shape by NaN";
- if (0 == a || 0 == b) throw "Error: Cannot Scale shape by a factor of 0";
- if (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
- var d = a * a - b * b;
- if (d * d < h.Config.epsilon * h.Config.epsilon) this.zpp_inner.circle.__scale(a, b);
- else throw "Error: Cannot perform a non equal scaling on a Circle";
- } else this.zpp_inner.polygon.__scale(a, b);
- return this
- },
- translate: function (a) {
- this.zpp_inner.immutable_midstep("Shape::translate()");
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- 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";
- if (null == a) throw "Error: Cannot displace Shape by null Vec2";
- 0 < a.lsq() && (this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.__translate(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this)) : this.zpp_inner.polygon.__translate(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this)));
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return this
- },
- get_bounds: function () {
- return this.zpp_inner.aabb.wrapper()
- },
- set_sensorEnabled: function (a) {
- this.zpp_inner.immutable_midstep("Shape::sensorEnabled");
- this.zpp_inner.sensorEnabled = a;
- this.zpp_inner.wake();
- return this.zpp_inner.sensorEnabled
- },
- get_sensorEnabled: function () {
- return this.zpp_inner.sensorEnabled
- },
- set_fluidEnabled: function (a) {
- this.zpp_inner.immutable_midstep("Shape::fluidEnabled");
- (this.zpp_inner.fluidEnabled = a) && null == this.zpp_inner.fluidProperties && this.set_fluidProperties(new h.phys.FluidProperties);
- this.zpp_inner.wake();
- return this.zpp_inner.fluidEnabled
- },
- get_fluidEnabled: function () {
- return this.zpp_inner.fluidEnabled
- },
- set_fluidProperties: function (a) {
- if (null ==
- a) throw "Error: Cannot assign null as Shape fluidProperties, disable fluids by setting fluidEnabled to false";
- this.zpp_inner.setFluid(a.zpp_inner);
- this.zpp_inner.immutable_midstep("Shape::fluidProperties");
- null == this.zpp_inner.fluidProperties && this.zpp_inner.setFluid((new h.phys.FluidProperties).zpp_inner);
- return this.zpp_inner.fluidProperties.wrapper()
- },
- get_fluidProperties: function () {
- this.zpp_inner.immutable_midstep("Shape::fluidProperties");
- null == this.zpp_inner.fluidProperties && this.zpp_inner.setFluid((new h.phys.FluidProperties).zpp_inner);
- return this.zpp_inner.fluidProperties.wrapper()
- },
- set_filter: function (a) {
- this.zpp_inner.immutable_midstep("Shape::filter");
- if (null == a) throw "Error: Cannot assign null as Shape filter";
- this.zpp_inner.setFilter(a.zpp_inner);
- return this.zpp_inner.filter.wrapper()
- },
- get_filter: function () {
- return this.zpp_inner.filter.wrapper()
- },
- set_material: function (a) {
- this.zpp_inner.immutable_midstep("Shape::material");
- if (null == a) throw "Error: Cannot assign null as Shape material";
- this.zpp_inner.setMaterial(a.zpp_inner);
- return this.zpp_inner.material.wrapper()
- },
- get_material: function () {
- return this.zpp_inner.material.wrapper()
- },
- get_angDrag: function () {
- this.zpp_inner.validate_angDrag();
- return this.zpp_inner.angDrag
- },
- get_inertia: function () {
- this.zpp_inner.validate_area_inertia();
- return this.zpp_inner.inertia
- },
- get_area: function () {
- this.zpp_inner.validate_area_inertia();
- return this.zpp_inner.area
- },
- set_localCOM: function (a) {
- this.zpp_inner.immutable_midstep("Body::localCOM");
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- 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";
- if (null == a) throw "Error: Shape::localCOM cannot be null";
- 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());
- this.zpp_inner.wrap_localCOM.set(a);
- 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());
- return this.zpp_inner.wrap_localCOM
- },
- get_localCOM: function () {
- 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());
- return this.zpp_inner.wrap_localCOM
- },
- get_worldCOM: function () {
- null == this.zpp_inner.wrap_worldCOM && (this.zpp_inner.wrap_worldCOM = h.geom.Vec2.get(this.zpp_inner.worldCOMx,
- 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)));
- return this.zpp_inner.wrap_worldCOM
- },
- get_castPolygon: function () {
- return this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? this.zpp_inner.polygon.outer_zn : null
- },
- get_castCircle: function () {
- return this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.zpp_inner.circle.outer_zn :
- null
- },
- set_body: function (a) {
- this.zpp_inner.immutable_midstep("Shape::body");
- (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));
- return null != this.zpp_inner.body ? this.zpp_inner.body.outer : null
- },
- get_body: function () {
- return null != this.zpp_inner.body ? this.zpp_inner.body.outer : null
- },
- isPolygon: function () {
- return this.zpp_inner.type ==
- c.util.ZPP_Flags.id_ShapeType_POLYGON
- },
- isCircle: function () {
- return this.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE
- },
- get_type: function () {
- return c.shape.ZPP_Shape.types[this.zpp_inner.type]
- },
- __class__: h.shape.Shape
- });
- h.shape.Circle = function (a, b, d, g) {
- this.zpp_inner_zn = null;
- try {
- h.shape.Shape.call(this)
- } catch (e) {}
- this.zpp_inner_zn = new c.shape.ZPP_Circle;
- this.zpp_inner_zn.outer = this;
- this.zpp_inner_zn.outer_zn = this;
- this.zpp_inner_i = this.zpp_inner = this.zpp_inner_zn;
- this.zpp_inner_i.outer_i = this;
- this.zpp_inner.immutable_midstep("Circle::radius");
- 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";
- if (a != this.zpp_inner_zn.radius) {
- if (a != a) throw "Error: Circle::radius cannot be NaN";
- if (a < h.Config.epsilon) throw "Error: Circle::radius (" + a + ") must be > Config.epsilon";
- if (1E100 < a) throw "Error: Circle::radius (" + a + ") must be < PR(Const).FMAX";
- this.zpp_inner_zn.radius = a;
- this.zpp_inner_zn.invalidate_radius()
- }
- this.zpp_inner_zn.radius;
- if (null == b) this.zpp_inner.localCOMx = 0, this.zpp_inner.localCOMy = 0;
- else {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a = this.zpp_inner;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- a.localCOMx = b.zpp_inner.x;
- a = this.zpp_inner;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- a.localCOMy = b.zpp_inner.y;
- b.zpp_inner.weak ? (b.dispose(), !0) : !1
- } 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;
- else {
- this.zpp_inner.immutable_midstep("Shape::material");
- if (null == d) throw "Error: Cannot assign null as Shape material";
- this.zpp_inner.setMaterial(d.zpp_inner);
- this.zpp_inner.material.wrapper()
- } if (null ==
- 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;
- else {
- this.zpp_inner.immutable_midstep("Shape::filter");
- if (null == g) throw "Error: Cannot assign null as Shape filter";
- this.zpp_inner.setFilter(g.zpp_inner);
- this.zpp_inner.filter.wrapper()
- }
- this.zpp_inner_i.insert_cbtype(c.callbacks.ZPP_CbType.ANY_SHAPE.zpp_inner)
- };
- s["nape.shape.Circle"] = h.shape.Circle;
- h.shape.Circle.__name__ = ["nape", "shape", "Circle"];
- h.shape.Circle.__super__ = h.shape.Shape;
- h.shape.Circle.prototype = I(h.shape.Shape.prototype, {
- set_radius: function (a) {
- this.zpp_inner.immutable_midstep("Circle::radius");
- 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";
- if (a != this.zpp_inner_zn.radius) {
- if (a !=
- a) throw "Error: Circle::radius cannot be NaN";
- if (a < h.Config.epsilon) throw "Error: Circle::radius (" + a + ") must be > Config.epsilon";
- if (1E100 < a) throw "Error: Circle::radius (" + a + ") must be < PR(Const).FMAX";
- this.zpp_inner_zn.radius = a;
- this.zpp_inner_zn.invalidate_radius()
- }
- return this.zpp_inner_zn.radius
- },
- get_radius: function () {
- return this.zpp_inner_zn.radius
- },
- __class__: h.shape.Circle
- });
- h.shape.Edge = function () {
- this.zpp_inner = null;
- if (!c.shape.ZPP_Edge.internal) throw "Error: Cannot instantiate an Edge derp!";
- };
- s["nape.shape.Edge"] = h.shape.Edge;
- h.shape.Edge.__name__ = ["nape", "shape", "Edge"];
- h.shape.Edge.prototype = {
- toString: function () {
- if (null == this.zpp_inner.polygon) return "Edge(object-pooled)";
- 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 + " }") + " }";
- this.zpp_inner.polygon.validate_gaxi();
- return "{ localNormal : " + ("{ x: " + this.zpp_inner.lnormx + " y: " + this.zpp_inner.lnormy + " }") + " worldNormal : " +
- ("{ x: " + this.zpp_inner.gnormx + " y: " + this.zpp_inner.gnormy + " }") + " }"
- },
- get_worldVertex2: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- this.zpp_inner.polygon.validate_gaxi();
- return this.zpp_inner.gp1.wrapper()
- },
- get_worldVertex1: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- this.zpp_inner.polygon.validate_gaxi();
- return this.zpp_inner.gp0.wrapper()
- },
- get_localVertex2: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- this.zpp_inner.polygon.validate_laxi();
- return this.zpp_inner.lp1.wrapper()
- },
- get_localVertex1: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- this.zpp_inner.polygon.validate_laxi();
- return this.zpp_inner.lp0.wrapper()
- },
- get_worldProjection: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- if (null == this.zpp_inner.polygon.body) throw "Error: Edge world projection only makes sense for Polygons contained within a rigid body";
- this.zpp_inner.polygon.validate_gaxi();
- return this.zpp_inner.gprojection
- },
- get_localProjection: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- this.zpp_inner.polygon.validate_laxi();
- return this.zpp_inner.lprojection
- },
- get_length: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- this.zpp_inner.polygon.validate_laxi();
- return this.zpp_inner.length
- },
- get_worldNormal: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- null == this.zpp_inner.wrap_gnorm &&
- this.zpp_inner.getgnorm();
- return this.zpp_inner.wrap_gnorm
- },
- get_localNormal: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- null == this.zpp_inner.wrap_lnorm && this.zpp_inner.getlnorm();
- return this.zpp_inner.wrap_lnorm
- },
- get_polygon: function () {
- if (null == this.zpp_inner.polygon) throw "Error: Edge not current in use";
- return this.zpp_inner.polygon.outer_zn
- },
- __class__: h.shape.Edge
- };
- h.shape.EdgeIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner =
- null;
- if (!c.util.ZPP_EdgeList.internal) throw "Error: Cannot instantiate EdgeIterator derp!";
- };
- s["nape.shape.EdgeIterator"] = h.shape.EdgeIterator;
- h.shape.EdgeIterator.__name__ = ["nape", "shape", "EdgeIterator"];
- h.shape.EdgeIterator.get = function (a) {
- var b = null == h.shape.EdgeIterator.zpp_pool ? function (a) {
- c.util.ZPP_EdgeList.internal = !0;
- a = new h.shape.EdgeIterator;
- c.util.ZPP_EdgeList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.shape.EdgeIterator.zpp_pool;
- h.shape.EdgeIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.shape.EdgeIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.shape.EdgeIterator.zpp_pool;
- h.shape.EdgeIterator.zpp_pool = this;
- this.zpp_inner = null;
- return !1
- },
- __class__: h.shape.EdgeIterator
- };
- h.shape.EdgeList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_EdgeList;
- this.zpp_inner.outer = this
- };
- s["nape.shape.EdgeList"] = h.shape.EdgeList;
- h.shape.EdgeList.__name__ = ["nape", "shape", "EdgeList"];
- h.shape.EdgeList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.shape.EdgeList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.shape.EdgeList.prototype = {
- filter: function (a) {
- if (null == a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.shape.EdgeIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.shape.EdgeIterator.zpp_pool;
- h.shape.EdgeIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.shape.EdgeIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" :
- c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.shape.EdgeIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.shape.EdgeList,
- d;
- this.zpp_inner.valmod();
- for (d = h.shape.EdgeIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Edge is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.shape.EdgeIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null !=
- d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.wrapper()
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null !=
- this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.wrapper()
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: EdgeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = a == this.get_length() - 1 ? a : this.get_length() - 2 - a);
- 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);
- else
- for (; this.zpp_inner.at_index != a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.wrapper()
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.shape.EdgeList
- };
- h.shape.Polygon = function (a, b, d) {
- this.zpp_inner_zn = null;
- try {
- h.shape.Shape.call(this)
- } catch (g) {}
- if (null == a) throw "Error: localVerts cannot be null";
- this.zpp_inner_zn = new c.shape.ZPP_Polygon;
- this.zpp_inner_zn.outer = this;
- this.zpp_inner_zn.outer_zn =
- this;
- this.zpp_inner_i = this.zpp_inner = this.zpp_inner_zn;
- this.zpp_inner_i.outer_i = this;
- if (F.Boot.__instanceof(a, Array))
- for (var e = a, f = 0; f < e.length;) {
- var l = e[f];
- ++f;
- if (null == l) throw "Error: Array<Vec2> contains null objects";
- if (!F.Boot.__instanceof(l, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
- var m = l;
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- null == this.zpp_inner_zn.wrap_lverts && this.zpp_inner_zn.getlverts();
- this.zpp_inner_zn.wrap_lverts.push(function (a) {
- if (null !=
- m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(a), function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(a), !1)
- }(this))
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (e = a.iterator(); e.hasNext();) {
- m = e.next();
- if (null == m) throw "Error: Vec2List contains null objects";
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- null == this.zpp_inner_zn.wrap_lverts && this.zpp_inner_zn.getlverts();
- this.zpp_inner_zn.wrap_lverts.push(function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(a), function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(a), !1)
- }(this))
- } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
- e = a;
- if (null != e && e.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- e = e.zpp_inner.vertices;
- if (null != e) {
- l = e;
- 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) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null !=
- m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(a), function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(a), !1)
- }(this)), m.dispose(); while (l != e)
- }
- } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
- if (F.Boot.__instanceof(a, Array))
- for (e = a, l = 0; l < e.length;) {
- a = e[l];
- if (f = a.zpp_inner.weak) a.dispose(),
- f = !0;
- f ? e.splice(l, 1) : l++
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- 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);
- 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 =
- null), null;
- else {
- this.zpp_inner.immutable_midstep("Shape::material");
- if (null == b) throw "Error: Cannot assign null as Shape material";
- this.zpp_inner.setMaterial(b.zpp_inner);
- this.zpp_inner.material.wrapper()
- } 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;
- else {
- this.zpp_inner.immutable_midstep("Shape::filter");
- if (null == d) throw "Error: Cannot assign null as Shape filter";
- this.zpp_inner.setFilter(d.zpp_inner);
- this.zpp_inner.filter.wrapper()
- }
- this.zpp_inner_i.insert_cbtype(c.callbacks.ZPP_CbType.ANY_SHAPE.zpp_inner)
- };
- s["nape.shape.Polygon"] = h.shape.Polygon;
- h.shape.Polygon.__name__ = ["nape", "shape", "Polygon"];
- h.shape.Polygon.rect = function (a, b, d, c, e) {
- null == e && (e = !1);
- if (a != a || b != b || d != d || c != c) throw "Error: Polygon.rect cannot accept NaN arguments";
- return [h.geom.Vec2.get(a, b, e), h.geom.Vec2.get(a + d, b, e), h.geom.Vec2.get(a +
- d, b + c, e), h.geom.Vec2.get(a, b + c, e)]
- };
- h.shape.Polygon.box = function (a, b, d) {
- null == d && (d = !1);
- if (a != a || b != b) throw "Error: Polygon.box cannot accept NaN arguments";
- return h.shape.Polygon.rect(-a / 2, -b / 2, a, b, d)
- };
- h.shape.Polygon.regular = function (a, b, d, c, e) {
- null == e && (e = !1);
- null == c && (c = 0);
- if (a != a || b != b || c != c) throw "Error: Polygon.regular cannot accept NaN arguments";
- for (var f = [], l = 2 * Math.PI / d, m = 0; m < d;) {
- var u = m++ * l + c,
- u = h.geom.Vec2.get(Math.cos(u) * a, Math.sin(u) * b, e);
- f.push(u)
- }
- return f
- };
- h.shape.Polygon.__super__ =
- h.shape.Shape;
- h.shape.Polygon.prototype = I(h.shape.Shape.prototype, {
- validity: function () {
- return this.zpp_inner_zn.valid()
- },
- get_edges: function () {
- null == this.zpp_inner_zn.wrap_edges && this.zpp_inner_zn.getedges();
- return this.zpp_inner_zn.wrap_edges
- },
- get_worldVerts: function () {
- null == this.zpp_inner_zn.wrap_gverts && this.zpp_inner_zn.getgverts();
- return this.zpp_inner_zn.wrap_gverts
- },
- get_localVerts: function () {
- null == this.zpp_inner_zn.wrap_lverts && this.zpp_inner_zn.getlverts();
- return this.zpp_inner_zn.wrap_lverts
- },
- __class__: h.shape.Polygon
- });
- h.shape.ShapeIterator = function () {
- this.zpp_next = null;
- this.zpp_critical = !1;
- this.zpp_i = 0;
- this.zpp_inner = null;
- if (!c.util.ZPP_ShapeList.internal) throw "Error: Cannot instantiate ShapeIterator derp!";
- };
- s["nape.shape.ShapeIterator"] = h.shape.ShapeIterator;
- h.shape.ShapeIterator.__name__ = ["nape", "shape", "ShapeIterator"];
- h.shape.ShapeIterator.get = function (a) {
- var b = null == h.shape.ShapeIterator.zpp_pool ? function (a) {
- c.util.ZPP_ShapeList.internal = !0;
- a = new h.shape.ShapeIterator;
- c.util.ZPP_ShapeList.internal = !1;
- return a
- }(this) : function (a) {
- a = h.shape.ShapeIterator.zpp_pool;
- h.shape.ShapeIterator.zpp_pool = a.zpp_next;
- return a
- }(this);
- b.zpp_i = 0;
- b.zpp_inner = a;
- b.zpp_critical = !1;
- return b
- };
- h.shape.ShapeIterator.prototype = {
- next: function () {
- this.zpp_critical = !1;
- return this.zpp_inner.at(this.zpp_i++)
- },
- hasNext: function () {
- this.zpp_inner.zpp_inner.valmod();
- var a = this.zpp_inner.get_length();
- this.zpp_critical = !0;
- if (this.zpp_i < a) return !0;
- this.zpp_next = h.shape.ShapeIterator.zpp_pool;
- h.shape.ShapeIterator.zpp_pool = this;
- this.zpp_inner =
- null;
- return !1
- },
- __class__: h.shape.ShapeIterator
- };
- h.shape.ShapeList = function () {
- this.zpp_inner = null;
- this.zpp_inner = new c.util.ZPP_ShapeList;
- this.zpp_inner.outer = this
- };
- s["nape.shape.ShapeList"] = h.shape.ShapeList;
- h.shape.ShapeList.__name__ = ["nape", "shape", "ShapeList"];
- h.shape.ShapeList.fromArray = function (a) {
- if (null == a) throw "Error: Cannot convert null Array to Nape list";
- for (var b = new h.shape.ShapeList, d = 0; d < a.length;) {
- var c = a[d];
- ++d;
- b.push(c)
- }
- return b
- };
- h.shape.ShapeList.prototype = {
- filter: function (a) {
- if (null ==
- a) throw "Error: Cannot select elements of list with null";
- for (var b = 0; b < this.get_length();) {
- var d = this.at(b);
- try {
- a(d) ? b++ : this.remove(d)
- } catch (c) {
- break
- }
- }
- return this
- },
- foreach: function (a) {
- if (null == a) throw "Error: Cannot execute null on list elements";
- var b;
- this.zpp_inner.valmod();
- for (b = h.shape.ShapeIterator.get(this); b.hasNext();) try {
- var d = a,
- c;
- b.zpp_critical = !1;
- c = b.zpp_inner.at(b.zpp_i++);
- d(c)
- } catch (e) {
- b.zpp_next = h.shape.ShapeIterator.zpp_pool;
- h.shape.ShapeIterator.zpp_pool = b;
- b.zpp_inner = null;
- break
- }
- return this
- },
- toString: function () {
- var a = "[",
- b = !0,
- d;
- this.zpp_inner.valmod();
- for (d = h.shape.ShapeIterator.get(this); d.hasNext();) {
- var c = d.next();
- b || (a += ",");
- a += null == c ? "NULL" : c.toString();
- b = !1
- }
- return a + "]"
- },
- merge: function (a) {
- if (null == a) throw "Error: Cannot merge with null list";
- a.zpp_inner.valmod();
- for (a = h.shape.ShapeIterator.get(a); a.hasNext();) {
- var b = a.next();
- this.has(b) || (this.zpp_inner.reverse_flag ? this.push(b) : this.unshift(b))
- }
- },
- copy: function (a) {
- null == a && (a = !1);
- var b = new h.shape.ShapeList,
- d;
- this.zpp_inner.valmod();
- for (d = h.shape.ShapeIterator.get(this); d.hasNext();) {
- var c = d.next();
- b.push(a ? function (a) {
- throw "Error: Shape is not a copyable type";
- }(this) : c)
- }
- return b
- },
- iterator: function () {
- this.zpp_inner.valmod();
- return h.shape.ShapeIterator.get(this)
- },
- empty: function () {
- return null == this.zpp_inner.inner.head
- },
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; null != this.zpp_inner.inner.head;) this.pop();
- else
- for (; null != this.zpp_inner.inner.head;) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b;
- b = !1;
- for (var d = this.zpp_inner.inner.head; null != d;) {
- if (d.elt == a.zpp_inner) {
- b = !0;
- break
- }
- d = d.next
- }
- 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());
- return b
- },
- add: function (a) {
- return this.zpp_inner.reverse_flag ? this.push(a) : this.unshift(a)
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var b = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == b ? this.zpp_inner.inner.head.elt : b.next.elt,
- d = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(d);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return d = a.outer
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
- this.zpp_inner.modify_test();
- if (null == this.zpp_inner.inner.head) throw "Error: Cannot remove from empty list";
- this.zpp_inner.valmod();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.zpp_inner.inner.head.elt,
- b = a.outer;
- null !=
- this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.pop()
- } else {
- null != this.zpp_inner.at_ite && null == this.zpp_inner.at_ite.next && (this.zpp_inner.at_ite = null);
- var d = 1 == this.get_length() ? null : this.zpp_inner.inner.iterator_at(this.get_length() - 2),
- a = null == d ? this.zpp_inner.inner.head.elt : d.next.elt,
- b = a.outer;
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.zpp_inner.inner.erase(d)
- }
- this.zpp_inner.invalidate();
- return b = a.outer
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: ShapeList is immutable";
- this.zpp_inner.modify_test();
- this.zpp_inner.valmod();
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- 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));
- return b
- },
- at: function (a) {
- this.zpp_inner.valmod();
- if (0 > a || a >= this.get_length()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.get_length() - 1 - a);
- 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);
- else
- for (; this.zpp_inner.at_index !=
- a;) this.zpp_inner.at_index++, this.zpp_inner.at_ite = this.zpp_inner.at_ite.next;
- return this.zpp_inner.at_ite.elt.outer
- },
- has: function (a) {
- this.zpp_inner.valmod();
- return this.zpp_inner.inner.has(a.zpp_inner)
- },
- get_length: function () {
- this.zpp_inner.valmod();
- this.zpp_inner.zip_length && (this.zpp_inner.zip_length = !1, this.zpp_inner.user_length = this.zpp_inner.inner.length);
- return this.zpp_inner.user_length
- },
- __class__: h.shape.ShapeList
- };
- h.shape.ShapeType = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ShapeType derp!";
- };
- s["nape.shape.ShapeType"] = h.shape.ShapeType;
- h.shape.ShapeType.__name__ = ["nape", "shape", "ShapeType"];
- h.shape.ShapeType.get_CIRCLE = function () {
- 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);
- return c.util.ZPP_Flags.ShapeType_CIRCLE
- };
- h.shape.ShapeType.get_POLYGON = function () {
- 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);
- return c.util.ZPP_Flags.ShapeType_POLYGON
- };
- h.shape.ShapeType.prototype = {
- toString: function () {
- var a;
- 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);
- 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 ==
- c.util.ZPP_Flags.ShapeType_POLYGON ? "POLYGON" : "");
- return a
- },
- __class__: h.shape.ShapeType
- };
- h.shape.ValidationResult = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate ValidationResult derp!";
- };
- s["nape.shape.ValidationResult"] = h.shape.ValidationResult;
- h.shape.ValidationResult.__name__ = ["nape", "shape", "ValidationResult"];
- h.shape.ValidationResult.get_VALID = function () {
- 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);
- return c.util.ZPP_Flags.ValidationResult_VALID
- };
- h.shape.ValidationResult.get_DEGENERATE = function () {
- 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);
- return c.util.ZPP_Flags.ValidationResult_DEGENERATE
- };
- h.shape.ValidationResult.get_CONCAVE = function () {
- 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);
- return c.util.ZPP_Flags.ValidationResult_CONCAVE
- };
- h.shape.ValidationResult.get_SELF_INTERSECTING = function () {
- 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);
- return c.util.ZPP_Flags.ValidationResult_SELF_INTERSECTING
- };
- h.shape.ValidationResult.prototype = {
- toString: function () {
- 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);
- var a;
- 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" :
- (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 ?
- "SELF_INTERSECTING" : "")));
- return a
- },
- __class__: h.shape.ValidationResult
- };
- h.space = {};
- h.space.Broadphase = function () {
- if (!c.util.ZPP_Flags.internal) throw "Error: Cannot instantiate Broadphase derp!";
- };
- s["nape.space.Broadphase"] = h.space.Broadphase;
- h.space.Broadphase.__name__ = ["nape", "space", "Broadphase"];
- h.space.Broadphase.get_DYNAMIC_AABB_TREE = function () {
- 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);
- return c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE
- };
- h.space.Broadphase.get_SWEEP_AND_PRUNE = function () {
- 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);
- return c.util.ZPP_Flags.Broadphase_SWEEP_AND_PRUNE
- };
- h.space.Broadphase.prototype = {
- toString: function () {
- 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);
- var a;
- 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" : "");
- return a
- },
- __class__: h.space.Broadphase
- };
- h.space.Space = function (a, b) {
- this.zpp_inner = null;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- this.zpp_inner = new c.space.ZPP_Space(null == a ? null : a.zpp_inner, b);
- this.zpp_inner.outer = this;
- null != a && (a.zpp_inner.weak ? (a.dispose(), !0) : !1)
- };
- s["nape.space.Space"] = h.space.Space;
- h.space.Space.__name__ = ["nape", "space", "Space"];
- h.space.Space.prototype = {
- rayMultiCast: function (a, b, d, c) {
- null == b && (b = !1);
- if (null == a) throw "Error: Cannot cast null ray :)";
- return this.zpp_inner.rayMultiCast(a, b, d, c)
- },
- rayCast: function (a, b, d) {
- null == b && (b = !1);
- if (null == a) throw "Error: Cannot cast null ray :)";
- return this.zpp_inner.rayCast(a,
- b, d)
- },
- convexMultiCast: function (a, b, d, c, e) {
- null == d && (d = !1);
- if (null == a) throw "Error: Cannot cast null shape :)";
- if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null)) throw "Error: Shape must belong to a body to be cast.";
- if (0 > b || b != b) throw "Error: deltaTime must be positive";
- return this.zpp_inner.convexMultiCast(a.zpp_inner, b, c, d, e)
- },
- convexCast: function (a, b, d, c) {
- null == d && (d = !1);
- if (null == a) throw "Error: Cannot cast null shape :)";
- if (null == (null != a.zpp_inner.body ? a.zpp_inner.body.outer : null)) throw "Error: Shape must belong to a body to be cast.";
- if (0 > b || b != b) throw "Error: deltaTime must be positive";
- return this.zpp_inner.convexCast(a.zpp_inner, b, c, d)
- },
- bodiesInBody: function (a, b, d) {
- if (null == a) throw "Error: Cannot evaluate shapes in null body";
- d = null == d ? new h.phys.BodyList : d;
- for (a = a.zpp_inner.wrap_shapes.iterator(); a.hasNext();) {
- var c = a.next();
- this.bodiesInShape(c, !1, b, d)
- }
- return d
- },
- shapesInBody: function (a, b, d) {
- if (null == a) throw "Error: Cannot evaluate shapes in null body";
- d = null == d ? new h.shape.ShapeList : d;
- for (a = a.zpp_inner.wrap_shapes.iterator(); a.hasNext();) {
- var c =
- a.next();
- this.shapesInShape(c, !1, b, d)
- }
- return d
- },
- bodiesInShape: function (a, b, d, g) {
- null == b && (b = !1);
- if (null == a) throw "Error: Cannot evaluate bodies in a null shapes :)";
- 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 :)";
- if (a.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
- var e = a.zpp_inner.polygon.valid();
- 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);
- if (e != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Polygon query shape is invalid : " + e.toString();
- }
- return this.zpp_inner.bodiesInShape(a.zpp_inner, b, null == d ? null : d.zpp_inner, g)
- },
- shapesInShape: function (a, b, d, g) {
- null == b && (b = !1);
- if (null == a) throw "Error: Cannot evaluate shapes in a null shapes :)";
- 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 :)";
- if (a.zpp_inner.type ==
- c.util.ZPP_Flags.id_ShapeType_POLYGON) {
- var e = a.zpp_inner.polygon.valid();
- 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);
- if (e != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Polygon query shape is invalid : " + e.toString();
- }
- return this.zpp_inner.shapesInShape(a.zpp_inner, b, null == d ? null : d.zpp_inner, g)
- },
- bodiesInCircle: function (a, b, d, c, e) {
- null == d && (d = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot evaluate objects at null circle :)";
- if (b != b) throw "Error: Circle radius cannot be NaN";
- if (0 >= b) throw "Error: Circle radius must be strictly positive";
- b = this.zpp_inner.bodiesInCircle(a, b, d, null == c ? null : c.zpp_inner, e);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- shapesInCircle: function (a, b, d, c, e) {
- null == d && (d = !1);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot evaluate shapes at null circle :)";
- if (b != b) throw "Error: Circle radius cannot be NaN";
- if (0 >= b) throw "Error: Circle radius must be strictly positive";
- b = this.zpp_inner.shapesInCircle(a, b, d, null == c ? null : c.zpp_inner, e);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- bodiesInAABB: function (a, b, d, c, e) {
- null == d && (d = !0);
- null == b && (b = !1);
- if (null == a) throw "Error: Cannot evaluate objects in a null AABB :)";
- var f;
- a.zpp_inner.validate();
- (f = 0 == a.zpp_inner.width()) || (a.zpp_inner.validate(), f = 0 == a.zpp_inner.height());
- if (f) throw "Error: Cannot evaluate objects in degenerate AABB :/";
- return this.zpp_inner.bodiesInAABB(a,
- d, b, null == c ? null : c.zpp_inner, e)
- },
- shapesInAABB: function (a, b, d, c, e) {
- null == d && (d = !0);
- null == b && (b = !1);
- if (null == a) throw "Error: Cannot evaluate shapes in a null AABB :)";
- var f;
- a.zpp_inner.validate();
- (f = 0 == a.zpp_inner.width()) || (a.zpp_inner.validate(), f = 0 == a.zpp_inner.height());
- if (f) throw "Error: Cannot evaluate shapes in degenerate AABB :/";
- return this.zpp_inner.shapesInAABB(a, d, b, null == c ? null : c.zpp_inner, e)
- },
- bodiesUnderPoint: function (a, b, d) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot evaluate objects under a null point :)";
- b = this.zpp_inner.bodiesUnderPoint(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), null == b ? null : b.zpp_inner, d);
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- return b
- },
- shapesUnderPoint: function (a, b, d) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Cannot evaluate shapes under a null point :)";
- b = this.zpp_inner.shapesUnderPoint(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), null == b ? null : b.zpp_inner, d);
- a.zpp_inner.weak ?
- (a.dispose(), !0) : !1;
- return b
- },
- interactionType: function (a, b) {
- if (null == a || null == b) throw "Error: Cannot evaluate interaction type for null shapes";
- 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";
- 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 ==
- 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;
- var d = a.zpp_inner,
- g = b.zpp_inner;
- switch (this.zpp_inner.interactionType(d, g, d.body, g.body)) {
- case 0:
- 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);
- d = c.util.ZPP_Flags.InteractionType_FLUID;
- break;
- case 1:
- 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);
- d = c.util.ZPP_Flags.InteractionType_COLLISION;
- break;
- case 2:
- 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);
- d = c.util.ZPP_Flags.InteractionType_SENSOR;
- break;
- default:
- d = null
- }
- return d
- },
- get_elapsedTime: function () {
- return this.zpp_inner.time
- },
- get_timeStamp: function () {
- return this.zpp_inner.stamp
- },
- step: function (a, b, d) {
- null == d && (d = 10);
- null == b && (b = 10);
- if (a != a) throw "Error: deltaTime cannot be NaN";
- if (0 >= a) throw "Error: deltaTime must be strictly positive";
- if (0 >= b) throw "Error: must use atleast one velocity iteration";
- if (0 >= d) throw "Error: must use atleast one position iteration";
- this.zpp_inner.step(a, b, d)
- },
- clear: function () {
- if (this.zpp_inner.midstep) throw "Error: Space::clear() cannot be called during space step()";
- this.zpp_inner.clear()
- },
- get_listeners: function () {
- return this.zpp_inner.wrap_listeners
- },
- get_arbiters: function () {
- if (null == this.zpp_inner.wrap_arbiters) {
- var a = new c.dynamics.ZPP_SpaceArbiterList;
- a.space = this.zpp_inner;
- this.zpp_inner.wrap_arbiters = a
- }
- return this.zpp_inner.wrap_arbiters
- },
- get_world: function () {
- return this.zpp_inner.__static
- },
- visitCompounds: function (a) {
- if (null == a) throw "Error: lambda cannot be null for Space::visitCompounds";
- for (var b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) {
- var d = b.next();
- a(d);
- d.visitCompounds(a)
- }
- },
- visitConstraints: function (a) {
- if (null == a) throw "Error: lambda cannot be null for Space::visitConstraints";
- for (var b = this.zpp_inner.wrap_constraints.iterator(); b.hasNext();) {
- var d = b.next();
- a(d)
- }
- for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) d = b.next(), d.visitConstraints(a)
- },
- visitBodies: function (a) {
- if (null == a) throw "Error: lambda cannot be null for Space::visitBodies";
- for (var b = this.zpp_inner.wrap_bodies.iterator(); b.hasNext();) {
- var d = b.next();
- a(d)
- }
- for (b = this.zpp_inner.wrap_compounds.iterator(); b.hasNext();) b.next().visitBodies(a)
- },
- get_liveConstraints: function () {
- return this.zpp_inner.wrap_livecon
- },
- get_constraints: function () {
- return this.zpp_inner.wrap_constraints
- },
- get_liveBodies: function () {
- return this.zpp_inner.wrap_live
- },
- get_bodies: function () {
- return this.zpp_inner.wrap_bodies
- },
- get_compounds: function () {
- return this.zpp_inner.wrap_compounds
- },
- set_worldLinearDrag: function (a) {
- if (a != a) throw "Error: Space::worldLinearDrag cannot be NaN";
- this.zpp_inner.global_lin_drag = a;
- return this.zpp_inner.global_lin_drag
- },
- get_worldLinearDrag: function () {
- return this.zpp_inner.global_lin_drag
- },
- set_worldAngularDrag: function (a) {
- if (a !=
- a) throw "Error: Space::worldAngularDrag cannot be NaN";
- this.zpp_inner.global_ang_drag = a;
- return this.zpp_inner.global_ang_drag
- },
- get_worldAngularDrag: function () {
- return this.zpp_inner.global_ang_drag
- },
- set_sortContacts: function (a) {
- this.zpp_inner.sortcontacts = a;
- return this.zpp_inner.sortcontacts
- },
- get_sortContacts: function () {
- return this.zpp_inner.sortcontacts
- },
- get_broadphase: function () {
- var a;
- this.zpp_inner.bphase.is_sweep ? (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 = 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);
- return a
- },
- set_gravity: function (a) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: Space::gravity cannot be null";
- null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
- this.zpp_inner.wrap_gravity.set(a);
- null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
- return this.zpp_inner.wrap_gravity
- },
- get_gravity: function () {
- null == this.zpp_inner.wrap_gravity && this.zpp_inner.getgravity();
- return this.zpp_inner.wrap_gravity
- },
- get_userData: function () {
- null == this.zpp_inner.userData && (this.zpp_inner.userData = {});
- return this.zpp_inner.userData
- },
- __class__: h.space.Space
- };
- h.util = {};
- h.util.Debug = function () {
- this.cullingEnabled = !1;
- this.colour = null;
- this.drawCollisionArbiters = this.drawFluidArbiters = this.drawSensorArbiters = this.drawBodies = this.drawBodyDetail = this.drawShapeDetail = this.drawShapeAngleIndicators = this.drawConstraints = !1;
- this.zpp_inner = null;
- if (!c.util.ZPP_Debug.internal) throw "Error: Cannot instantiate Debug derp! Use ShapeDebug, or BitmapDebug on flash10+";
- this.drawSensorArbiters = this.drawFluidArbiters = this.drawCollisionArbiters = !1;
- this.drawShapeAngleIndicators = this.drawBodies = !0;
- this.cullingEnabled = this.drawConstraints =
- this.drawShapeDetail = this.drawBodyDetail = !1;
- this.colour = null
- };
- s["nape.util.Debug"] = h.util.Debug;
- h.util.Debug.__name__ = ["nape", "util", "Debug"];
- h.util.Debug.version = function () {
- return "Nape 2.0.12"
- };
- h.util.Debug.clearObjectPools = function () {
- for (; null != h.constraint.ConstraintIterator.zpp_pool;) {
- var a = h.constraint.ConstraintIterator.zpp_pool.zpp_next;
- h.constraint.ConstraintIterator.zpp_pool.zpp_next = null;
- h.constraint.ConstraintIterator.zpp_pool = a
- }
- for (; null != h.phys.InteractorIterator.zpp_pool;) a = h.phys.InteractorIterator.zpp_pool.zpp_next,
- h.phys.InteractorIterator.zpp_pool.zpp_next = null, h.phys.InteractorIterator.zpp_pool = a;
- 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;
- 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;
- for (; null != h.callbacks.ListenerIterator.zpp_pool;) a = h.callbacks.ListenerIterator.zpp_pool.zpp_next,
- h.callbacks.ListenerIterator.zpp_pool.zpp_next = null, h.callbacks.ListenerIterator.zpp_pool = a;
- 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;
- 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;
- for (; null != h.geom.GeomPolyIterator.zpp_pool;) a =
- h.geom.GeomPolyIterator.zpp_pool.zpp_next, h.geom.GeomPolyIterator.zpp_pool.zpp_next = null, h.geom.GeomPolyIterator.zpp_pool = a;
- 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;
- 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;
- for (; null != h.shape.ShapeIterator.zpp_pool;) a = h.shape.ShapeIterator.zpp_pool.zpp_next,
- h.shape.ShapeIterator.zpp_pool.zpp_next = null, h.shape.ShapeIterator.zpp_pool = a;
- 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;
- 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;
- for (; null != h.dynamics.ArbiterIterator.zpp_pool;) a = h.dynamics.ArbiterIterator.zpp_pool.zpp_next,
- h.dynamics.ArbiterIterator.zpp_pool.zpp_next = null, h.dynamics.ArbiterIterator.zpp_pool = a;
- 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;
- 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;
- for (; null != c.util.ZNPNode_ZPP_CallbackSet.zpp_pool;) a =
- 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;
- 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;
- 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;
- for (; null != c.phys.ZPP_FluidProperties.zpp_pool;) a =
- c.phys.ZPP_FluidProperties.zpp_pool.next, c.phys.ZPP_FluidProperties.zpp_pool.next = null, c.phys.ZPP_FluidProperties.zpp_pool = a;
- 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;
- 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;
- for (; null != c.util.ZNPNode_ZPP_Compound.zpp_pool;) a =
- 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;
- 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;
- 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 =
- a;
- 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;
- 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;
- 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 =
- a;
- 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;
- 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;
- for (; null != c.util.ZPP_Set_ZPP_Body.zpp_pool;) a = c.util.ZPP_Set_ZPP_Body.zpp_pool.next,
- c.util.ZPP_Set_ZPP_Body.zpp_pool.next = null, c.util.ZPP_Set_ZPP_Body.zpp_pool = a;
- 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;
- 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;
- 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 =
- null, c.util.ZNPNode_ZPP_CbSetPair.zpp_pool = a;
- 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;
- 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;
- 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 =
- a;
- 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;
- 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;
- 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;
- for (; null != c.util.ZNPNode_ZPP_CutInt.zpp_pool;) a =
- 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;
- 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;
- 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;
- for (; null != c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool;) a = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool.next,
- c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool.next = null, c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool = a;
- 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;
- 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;
- for (; null != c.geom.ZPP_PartitionPair.zpp_pool;) a =
- c.geom.ZPP_PartitionPair.zpp_pool.next, c.geom.ZPP_PartitionPair.zpp_pool.next = null, c.geom.ZPP_PartitionPair.zpp_pool = a;
- 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;
- 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;
- 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;
- 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;
- 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 =
- a;
- 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;
- 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;
- 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;
- for (; null != c.geom.ZPP_ToiEvent.zpp_pool;) a =
- c.geom.ZPP_ToiEvent.zpp_pool.next, c.geom.ZPP_ToiEvent.zpp_pool.next = null, c.geom.ZPP_ToiEvent.zpp_pool = a;
- 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;
- 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;
- for (; null != c.geom.ZPP_SimpleSeg.zpp_pool;) a = c.geom.ZPP_SimpleSeg.zpp_pool.next,
- c.geom.ZPP_SimpleSeg.zpp_pool.next = null, c.geom.ZPP_SimpleSeg.zpp_pool = a;
- 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;
- 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;
- for (; null != c.geom.ZPP_MarchSpan.zpp_pool;) a = c.geom.ZPP_MarchSpan.zpp_pool.next,
- c.geom.ZPP_MarchSpan.zpp_pool.next = null, c.geom.ZPP_MarchSpan.zpp_pool = a;
- 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;
- 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;
- for (; null != c.util.Hashable2_Boolfalse.zpp_pool;) a = c.util.Hashable2_Boolfalse.zpp_pool.next, c.util.Hashable2_Boolfalse.zpp_pool.next =
- null, c.util.Hashable2_Boolfalse.zpp_pool = a;
- 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;
- 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;
- for (; null != c.util.ZNPNode_ZPP_AABBPair.zpp_pool;) a = c.util.ZNPNode_ZPP_AABBPair.zpp_pool.next,
- c.util.ZNPNode_ZPP_AABBPair.zpp_pool.next = null, c.util.ZNPNode_ZPP_AABBPair.zpp_pool = a;
- 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;
- 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;
- 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 =
- null, c.util.ZNPNode_ZPP_Vec2.zpp_pool = a;
- 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;
- 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;
- 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;
- for (; null !=
- 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;
- 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;
- 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 =
- a;
- 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;
- 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;
- 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;
- for (; null != c.util.ZPP_Set_ZPP_CbSet.zpp_pool;) a =
- 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;
- 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;
- 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 =
- a;
- 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;
- 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;
- for (; null != c.dynamics.ZPP_SensorArbiter.zpp_pool;) a = c.dynamics.ZPP_SensorArbiter.zpp_pool.next, c.dynamics.ZPP_SensorArbiter.zpp_pool.next =
- null, c.dynamics.ZPP_SensorArbiter.zpp_pool = a;
- 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;
- 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;
- 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 =
- null, c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = a;
- 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;
- 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;
- for (; null != c.util.ZNPNode_ConvexResult.zpp_pool;) a = c.util.ZNPNode_ConvexResult.zpp_pool.next, c.util.ZNPNode_ConvexResult.zpp_pool.next =
- null, c.util.ZNPNode_ConvexResult.zpp_pool = a;
- 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;
- 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;
- for (; null != c.util.ZPP_PubPool.poolGeomPoly;) a = c.util.ZPP_PubPool.poolGeomPoly.zpp_pool, c.util.ZPP_PubPool.poolGeomPoly.zpp_pool =
- null, c.util.ZPP_PubPool.poolGeomPoly = a;
- 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;
- 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
- };
- h.util.Debug.createGraphic = function (a) {
- if (null == a) throw "Error: Cannot create debug graphic for null Body";
- var b = new k.display.Shape,
- d = b.graphics,
- g = 16777215 * Math.exp(-a.zpp_inner_i.id /
- 1500) | 0;
- d.lineStyle(0.1, (0.7 * ((g & 16711680) >> 16) | 0) << 16 | (0.7 * ((g & 65280) >> 8) | 0) << 8 | 0.7 * (g & 255) | 0, 1);
- for (a = a.zpp_inner.wrap_shapes.iterator(); a.hasNext();) {
- var e = a.next();
- if (e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
- var f = e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? e.zpp_inner.circle.outer_zn : null;
- d.drawCircle(function (a) {
- 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());
- return f.zpp_inner.wrap_localCOM
- }(this).get_x(), function (a) {
- 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());
- return f.zpp_inner.wrap_localCOM
- }(this).get_y(), f.zpp_inner_zn.radius)
- } else {
- g = e.zpp_inner.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? e.zpp_inner.polygon.outer_zn : null;
- d.moveTo(function (a) {
- 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());
- return e.zpp_inner.wrap_localCOM
- }(this).get_x(), function (a) {
- 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());
- return e.zpp_inner.wrap_localCOM
- }(this).get_y());
- var l = 0;
- null == g.zpp_inner_zn.wrap_gverts && g.zpp_inner_zn.getgverts();
- for (var m = g.zpp_inner_zn.wrap_gverts.zpp_gl(); l < m;) {
- var h = l++;
- null == g.zpp_inner_zn.wrap_lverts && g.zpp_inner_zn.getlverts();
- var p =
- g.zpp_inner_zn.wrap_lverts.at(h);
- d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))
- }
- null == g.zpp_inner_zn.wrap_lverts && g.zpp_inner_zn.getlverts();
- p = g.zpp_inner_zn.wrap_lverts.at(0);
- d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))
- }
- 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) {
- 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());
- return f.zpp_inner.wrap_localCOM
- }(this).get_x() + 0.3 * f.zpp_inner_zn.radius, function (a) {
- 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());
- return f.zpp_inner.wrap_localCOM
- }(this).get_y()), d.lineTo(function (a) {
- 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());
- return f.zpp_inner.wrap_localCOM
- }(this).get_x() +
- f.zpp_inner_zn.radius, function (a) {
- 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());
- return f.zpp_inner.wrap_localCOM
- }(this).get_y()))
- }
- return b
- };
- h.util.Debug.prototype = {
- drawSpring: function (a, b, d, c, e) {},
- drawFilledPolygon: function (a, b) {},
- drawPolygon: function (a, b) {},
- drawFilledCircle: function (a, b, d) {},
- drawFilledTriangle: function (a, b, d, c) {},
- drawAABB: function (a, b) {},
- drawCircle: function (a, b, d) {},
- drawCurve: function (a, b, d, c) {},
- drawLine: function (a, b, d) {},
- draw: function (a) {},
- flush: function () {},
- clear: function () {},
- set_transform: function (a) {
- if (null == a) throw "Error: Cannot set Debug::transform to null";
- null == this.zpp_inner.xform && this.zpp_inner.setform();
- this.zpp_inner.xform.outer.set(a);
- null == this.zpp_inner.xform && this.zpp_inner.setform();
- return this.zpp_inner.xform.outer
- },
- get_transform: function () {
- null == this.zpp_inner.xform && this.zpp_inner.setform();
- return this.zpp_inner.xform.outer
- },
- get_display: function () {
- return this.zpp_inner.d_shape.shape
- },
- set_bgColour: function (a) {
- this.zpp_inner.d_shape.setbg(a);
- return this.zpp_inner.bg_col
- },
- get_bgColour: function () {
- return this.zpp_inner.bg_col
- },
- __class__: h.util.Debug
- };
- h.util.ShapeDebug = function (a, b, d) {
- null == d && (d = 3355443);
- this.thickness = 0;
- this.zpp_inner_zn = null;
- if (0 >= a) throw "Error: Debug width must be > 0";
- if (0 >= b) throw "Error: Debug height must be > 0";
- c.util.ZPP_Debug.internal = !0;
- h.util.Debug.call(this);
- c.util.ZPP_Debug.internal = !1;
- this.zpp_inner_zn = new c.util.ZPP_ShapeDebug(a, b);
- this.zpp_inner_zn.outer_zn =
- this;
- this.zpp_inner = this.zpp_inner_zn;
- this.zpp_inner.outer = this;
- this.zpp_inner.d_shape.setbg(d);
- this.zpp_inner.bg_col;
- this.thickness = 0.1
- };
- s["nape.util.ShapeDebug"] = h.util.ShapeDebug;
- h.util.ShapeDebug.__name__ = ["nape", "util", "ShapeDebug"];
- h.util.ShapeDebug.__super__ = h.util.Debug;
- h.util.ShapeDebug.prototype = I(h.util.Debug.prototype, {
- drawSpring: function (a, b, d, c, e) {
- null == e && (e = 3);
- null == c && (c = 3);
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: drawCurve::start cannot be null";
- if (null == b) throw "Error: drawCurve::end cannot be null";
- if (0 > c) throw "Error: drawCurve::coils must be >= 0";
- if (0 == c) this.drawLine(a, b, d);
- else {
- var f;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- f = b.zpp_inner.x;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- f -= a.zpp_inner.x;
- var l;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- l = b.zpp_inner.y;
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- l -= a.zpp_inner.y;
- var m = 1 / (4 * c);
- f *= m;
- l *= m;
- var u = 0,
- p = 0,
- u = f,
- p = l;
- if (0.1 > u * u + p * p) return;
- var m = 1 / Math.sqrt(u * u + p * p),
- p = p * m,
- m = u * m,
- u = -p,
- p = m,
- m = 2 * e,
- u = u * m,
- p = p * m,
- C = function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(b), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(b), !1)
- }(this);
- e = h.geom.Vec2.get(null, null, null);
- for (var r = h.geom.Vec2.get(null, null, null), m = 0; m < c;) m++, e.set_x(function (a) {
- if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.x
- }(this) + f + u), e.set_y(function (a) {
- if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.y
- }(this) + l + p), r.set_x(function (a) {
- if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.x
- }(this) + 2 * f), r.set_y(function (a) {
- if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.y
- }(this) + 2 * l), this.drawCurve(C, e, r, d), C.set_x(function (a) {
- if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- r.zpp_inner.validate();
- return r.zpp_inner.x
- }(this)), C.set_y(function (a) {
- if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- r.zpp_inner.validate();
- return r.zpp_inner.y
- }(this)), e.set_x(function (a) {
- if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.x
- }(this) + f - u), e.set_y(function (a) {
- if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.y
- }(this) + l - p), r.set_x(function (a) {
- if (null !=
- C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.x
- }(this) + 2 * f), r.set_y(function (a) {
- if (null != C && C.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- C.zpp_inner.validate();
- return C.zpp_inner.y
- }(this) + 2 * l), this.drawCurve(C, e, r, d), C.set_x(function (a) {
- if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- r.zpp_inner.validate();
- return r.zpp_inner.x
- }(this)), C.set_y(function (a) {
- if (null != r && r.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- r.zpp_inner.validate();
- return r.zpp_inner.y
- }(this));
- C.dispose();
- e.dispose();
- r.dispose()
- }
- a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- b.zpp_inner.weak ? (b.dispose(), !0) : !1
- },
- draw: function (a) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (this.zpp_inner.xnull)
- 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);
- else if (F.Boot.__instanceof(a,
- h.phys.Compound)) this.zpp_inner_zn.draw_compound(F.Boot.__cast(a, h.phys.Compound).zpp_inner, null, 1, !0);
- 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);
- 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);
- else if (F.Boot.__instanceof(a, h.constraint.Constraint)) F.Boot.__cast(a, h.constraint.Constraint).zpp_inner.draw(this);
- else throw "Error: Unhandled object type for Debug draw";
- 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);
- 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);
- 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);
- else if (F.Boot.__instanceof(a,
- h.constraint.Constraint)) F.Boot.__cast(a, h.constraint.Constraint).zpp_inner.draw(this);
- else throw "Error: Unhandled object type for Debug draw";
- },
- drawFilledPolygon: function (a, b) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null == a) throw "Error: Cannot draw null polygon!";
- var d = this.zpp_inner_zn.graphics;
- d.beginFill(b & 16777215, 1);
- d.lineStyle(0, 0, 0);
- var c = null,
- e = !0;
- if (this.zpp_inner.xnull)
- if (F.Boot.__instanceof(a,
- Array))
- for (var f = a, l = 0; l < f.length;) {
- var m = f[l];
- ++l;
- if (null == m) throw "Error: Array<Vec2> contains null objects";
- if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
- var u = m;
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e ? (c = function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(a), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(a), !1)
- }(this), d.moveTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null !=
- u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this));
- e = !1
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (f = a.iterator(); f.hasNext();) {
- u = f.next();
- if (null == u) throw "Error: Vec2List contains null objects";
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e ? (c =
- function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(a), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(a), !1)
- }(this), d.moveTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this));
- e = !1
- } else if (F.Boot.__instanceof(a,
- h.geom.GeomPoly)) {
- f = a;
- if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- f = f.zpp_inner.vertices;
- if (null != f) {
- m = f;
- do u = h.geom.Vec2.get(m.x, m.y, null), m = m.next, e ? (c = function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(a), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(a), !1)
- }(this), d.moveTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this),
- function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this)), e = !1, u.dispose(); while (m != f)
- }
- } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
- else if (F.Boot.__instanceof(a, Array))
- for (f = a, l = 0; l < f.length;) {
- m = f[l];
- ++l;
- if (null == m) throw "Error: Array<Vec2> contains null objects";
- if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
- u = m;
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- var p = this.zpp_inner.xform.outer.transform(u);
- e ? (c = p, d.moveTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this));
- e || p.dispose();
- e = !1
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (f = a.iterator(); f.hasNext();) {
- u = f.next();
- if (null == u) throw "Error: Vec2List contains null objects";
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p = this.zpp_inner.xform.outer.transform(u);
- e ? (c = p, d.moveTo(function (a) {
- if (null !=
- p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this));
- e || p.dispose();
- e = !1
- } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
- f = a;
- if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- f = f.zpp_inner.vertices;
- if (null != f) {
- m = f;
- 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) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null !=
- p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this)), e || p.dispose(), e = !1, u.dispose(); while (m != f)
- }
- } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
- d.lineTo(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this), function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this));
- c.dispose();
- d.endFill();
- if (F.Boot.__instanceof(a, Array))
- for (f = a, e = 0; e < f.length;) {
- d = f[e];
- if (m = d.zpp_inner.weak) d.dispose(), m = !0;
- m ? f.splice(e, 1) : e++
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (f = a, null !=
- 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)
- },
- drawPolygon: function (a, b) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null == a) throw "Error: Cannot draw null polygon";
- var d = this.zpp_inner_zn.graphics;
- d.lineStyle(0.1, b & 16777215, 1);
- var c = null,
- e = !0;
- if (this.zpp_inner.xnull)
- if (F.Boot.__instanceof(a, Array))
- for (var f = a, l = 0; l < f.length;) {
- var m = f[l];
- ++l;
- if (null == m) throw "Error: Array<Vec2> contains null objects";
- if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
- var u = m;
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e ? (c = function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(a), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(a), !1)
- }(this), d.moveTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null !=
- u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this));
- e = !1
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (f = a.iterator(); f.hasNext();) {
- u = f.next();
- if (null == u) throw "Error: Vec2List contains null objects";
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e ? (c =
- function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(a), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(a), !1)
- }(this), d.moveTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this));
- e = !1
- } else if (F.Boot.__instanceof(a,
- h.geom.GeomPoly)) {
- f = a;
- if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- f = f.zpp_inner.vertices;
- if (null != f) {
- m = f;
- do u = h.geom.Vec2.get(m.x, m.y, null), m = m.next, e ? (c = function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(a), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(a), !1)
- }(this), d.moveTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this), function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.x
- }(this),
- function (a) {
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- u.zpp_inner.validate();
- return u.zpp_inner.y
- }(this)), e = !1, u.dispose(); while (m != f)
- }
- } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
- else if (F.Boot.__instanceof(a, Array))
- for (f = a, l = 0; l < f.length;) {
- m = f[l];
- ++l;
- if (null == m) throw "Error: Array<Vec2> contains null objects";
- if (!F.Boot.__instanceof(m, h.geom.Vec2)) throw "Error: Array<Vec2> contains non Vec2 objects";
- u = m;
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- var p = this.zpp_inner.xform.outer.transform(u);
- e ? (c = p, d.moveTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this));
- e || p.dispose();
- e = !1
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (f = a.iterator(); f.hasNext();) {
- u = f.next();
- if (null == u) throw "Error: Vec2List contains null objects";
- if (null != u && u.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p = this.zpp_inner.xform.outer.transform(u);
- e ? (c = p, d.moveTo(function (a) {
- if (null !=
- p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this));
- e || p.dispose();
- e = !1
- } else if (F.Boot.__instanceof(a, h.geom.GeomPoly)) {
- f = a;
- if (null != f && f.zpp_disp) throw "Error: GeomPoly has been disposed and cannot be used!";
- f = f.zpp_inner.vertices;
- if (null != f) {
- m = f;
- 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) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null !=
- p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this))) : d.lineTo(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(this), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(this)), e || p.dispose(), e = !1, u.dispose(); while (m != f)
- }
- } else throw "Error: Invalid type for polygon object, should be Array<Vec2>, Vec2List, GeomPoly or for flash10+ flash.Vector<Vec2>";
- d.lineTo(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this), function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this));
- c.dispose();
- if (F.Boot.__instanceof(a, Array))
- for (f = a, e = 0; e < f.length;) {
- d = f[e];
- if (m = d.zpp_inner.weak) d.dispose(), m = !0;
- m ? f.splice(e, 1) : e++
- } else if (F.Boot.__instanceof(a, h.geom.Vec2List))
- for (f = a, null != 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)
- },
- drawFilledCircle: function (a, b, d) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: drawFilledCircle::position cannot be null";
- if (b != b || 0 > b) throw "Error: drawFilledCircle::radius must be >=0";
- var c = this.zpp_inner_zn.graphics;
- c.lineStyle(0, 0, 0);
- c.beginFill(d & 16777215, 1);
- if (this.zpp_inner.xnull) c.drawCircle(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), b), a.zpp_inner.weak ? (a.dispose(), !0) :
- !1;
- else {
- var e = this.zpp_inner.xform.outer.transform(a);
- c.drawCircle(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(this), function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(this), b * this.zpp_inner.xdet);
- e.dispose()
- }
- c.endFill()
- },
- drawFilledTriangle: function (a, b, d, c) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a || null == b || null == d) throw "Error: drawFilledTriangle can't use null points";
- var e = this.zpp_inner_zn.graphics;
- e.lineStyle(0, 0, 0);
- e.beginFill(c & 16777215, 1);
- if (this.zpp_inner.xnull) e.moveTo(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this)), e.lineTo(function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this)), e.lineTo(function (a) {
- if (null !=
- d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.x
- }(this), function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.y
- }(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;
- else {
- var f = this.zpp_inner.xform.outer.transform(a);
- e.moveTo(function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(this), function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(this));
- f.dispose();
- f = this.zpp_inner.xform.outer.transform(b);
- e.lineTo(function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(this), function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(this));
- f.dispose();
- f = this.zpp_inner.xform.outer.transform(d);
- e.lineTo(function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(this), function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(this));
- f.dispose()
- }
- e.endFill()
- },
- drawAABB: function (a, b) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null == a) throw "Error: drawAABB::aabb cannot be null";
- var d = this.zpp_inner_zn.graphics;
- d.lineStyle(0.1, b & 16777215, 1);
- if (this.zpp_inner.xnull) d.drawRect(function (b) {
- a.zpp_inner.validate();
- return a.zpp_inner.minx
- }(this), function (b) {
- a.zpp_inner.validate();
- return a.zpp_inner.miny
- }(this), function (b) {
- a.zpp_inner.validate();
- return a.zpp_inner.width()
- }(this), function (b) {
- a.zpp_inner.validate();
- return a.zpp_inner.height()
- }(this));
- else {
- var c = this.zpp_inner.xform.outer.transform(a.zpp_inner.getmin()),
- e = h.geom.Vec2.get(function (b) {
- a.zpp_inner.validate();
- return a.zpp_inner.width()
- }(this), 0, null),
- f = this.zpp_inner.xform.outer.transform(e, !0),
- l = h.geom.Vec2.get(0, function (b) {
- a.zpp_inner.validate();
- return a.zpp_inner.height()
- }(this), null),
- m = this.zpp_inner.xform.outer.transform(l, !0);
- d.moveTo(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this), function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this));
- d.lineTo(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this) + function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(this), function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this) + function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(this));
- d.lineTo(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this) + function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(this) + function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(this), function (a) {
- if (null !=
- c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this) + function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(this) + function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(this));
- d.lineTo(function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this) + function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(this), function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this) + function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(this));
- d.lineTo(function (a) {
- if (null !=
- c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.x
- }(this), function (a) {
- if (null != c && c.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- c.zpp_inner.validate();
- return c.zpp_inner.y
- }(this));
- c.dispose();
- e.dispose();
- f.dispose();
- l.dispose();
- m.dispose()
- }
- },
- drawCircle: function (a, b, d) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: drawCircle::position cannot be null";
- if (b != b || 0 > b) throw "Error: drawCircle::radius must be >=0";
- var c = this.zpp_inner_zn.graphics;
- c.lineStyle(0.1, d & 16777215, 1);
- if (this.zpp_inner.xnull) c.drawCircle(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), b), a.zpp_inner.weak ? (a.dispose(), !0) : !1;
- else {
- var e = this.zpp_inner.xform.outer.transform(a);
- c.drawCircle(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(this), function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(this), b * this.zpp_inner.xdet);
- e.dispose()
- }
- },
- drawCurve: function (a, b,
- d, c) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: drawCurve::start cannot be null";
- if (null == b) throw "Error: drawCurve::control cannot be null";
- if (null == d) throw "Error: drawCurve::end cannot be null";
- var e = this.zpp_inner_zn.graphics;
- e.lineStyle(0.1, c & 16777215, 1);
- if (this.zpp_inner.xnull) e.moveTo(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this)), e.curveTo(function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this), function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.x
- }(this), function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.y
- }(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;
- else {
- var f = this.zpp_inner.xform.outer.transform(a),
- l = this.zpp_inner.xform.outer.transform(b),
- m = this.zpp_inner.xform.outer.transform(d);
- e.moveTo(function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.x
- }(this), function (a) {
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- return f.zpp_inner.y
- }(this));
- e.curveTo(function (a) {
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- return l.zpp_inner.x
- }(this), function (a) {
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- return l.zpp_inner.y
- }(this), function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(this), function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(this));
- f.dispose();
- l.dispose();
- m.dispose()
- }
- },
- drawLine: function (a, b, d) {
- if (null != this.zpp_inner.xform && !this.zpp_inner.xform.outer.equiorthogonal()) throw "Error: Debug draw can only operate with an equiorthogonal transform!";
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- if (null == a) throw "Error: drawLine::start cannot be null";
- if (null == b) throw "Error: drawLine::end cannot be null";
- var c = this.zpp_inner_zn.graphics;
- c.lineStyle(0.1, d & 16777215, 1);
- if (this.zpp_inner.xnull) c.moveTo(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this)), c.lineTo(function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this), function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this)), a.zpp_inner.weak ? (a.dispose(), !0) : !1, b.zpp_inner.weak ? (b.dispose(), !0) : !1;
- else {
- var e = this.zpp_inner.xform.outer.transform(a);
- c.moveTo(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(this), function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(this));
- e.dispose();
- e = this.zpp_inner.xform.outer.transform(b);
- c.lineTo(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(this), function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(this));
- e.dispose()
- }
- },
- clear: function () {
- this.zpp_inner_zn.graphics.clear()
- },
- __class__: h.util.ShapeDebug
- });
- var X;
- X = function () {};
- s["nme.AssetData"] = X;
- X.__name__ = ["nme", "AssetData"];
- X.initialize = function () {
- if (!X.initialized) {
- X.path.set("assets/ggg.png", "assets/ggg.png");
- var a = W.field(J.AssetType, "IMAGE");
- X.type.set("assets/ggg.png", a);
- X.path.set("assets/FontCourier.png", "assets/FontCourier.png");
- a = W.field(J.AssetType, "IMAGE");
- X.type.set("assets/FontCourier.png", a);
- X.path.set("assets/FontGame.png", "assets/FontGame.png");
- a = W.field(J.AssetType, "IMAGE");
- X.type.set("assets/FontGame.png", a);
- X.path.set("assets/Objects.png",
- "assets/Objects.png");
- a = W.field(J.AssetType, "IMAGE");
- X.type.set("assets/Objects.png", a);
- X.initialized = !0
- }
- };
- var J = {
- Assets: function () {}
- };
- s["openfl.Assets"] = J.Assets;
- J.Assets.__name__ = ["openfl", "Assets"];
- J.Assets.initialize = function () {
- J.Assets.initialized || (X.initialize(), J.Assets.initialized = !0)
- };
- J.Assets.getBitmapData = function (a, b) {
- null == b && (b = !0);
- J.Assets.initialize();
- if (X.type.exists(a) && X.type.get(a) == J.AssetType.IMAGE) {
- if (b && J.Assets.cachedBitmapData.exists(a)) return J.Assets.cachedBitmapData.get(a);
- var d = F.Boot.__cast(P.loaders.get(X.path.get(a)).contentLoaderInfo.content, k.display.Bitmap).bitmapData;
- b && J.Assets.cachedBitmapData.set(a, d);
- return d
- } - 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 + '"', {
- fileName: "Assets.hx",
- lineNumber: 175,
- className: "openfl.Assets",
- methodName: "getBitmapData"
- })) : y.Log.trace('[openfl.Assets] There is no BitmapData asset with an ID of "' + a + '"', {
- fileName: "Assets.hx",
- lineNumber: 181,
- className: "openfl.Assets",
- methodName: "getBitmapData"
- });
- return null
- };
- J.Assets.getBytes = function (a) {
- J.Assets.initialize();
- if (X.type.exists(a)) {
- var b = null;
- a = P.urlLoaders.get(X.path.get(a)).data;
- F.Boot.__instanceof(a, String) ? (new k.utils.ByteArray).writeUTFBytes(a) : b = F.Boot.__instanceof(a, k.utils.ByteArray) ? a : null;
- if (null != b) return b.position = 0, b
- } else y.Log.trace('[openfl.Assets] There is no String or ByteArray asset with an ID of "' + a + '"', {
- fileName: "Assets.hx",
- lineNumber: 238,
- className: "openfl.Assets",
- methodName: "getBytes"
- });
- return null
- };
- J.Assets.getFont = function (a) {
- J.Assets.initialize();
- 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);
- y.Log.trace('[openfl.Assets] There is no Font asset with an ID of "' + a + '"', {
- fileName: "Assets.hx",
- lineNumber: 275,
- className: "openfl.Assets",
- methodName: "getFont"
- });
- return null
- };
- J.Assets.getMovieClip = function (a) {
- J.Assets.initialize();
- var b = S.substr(a, 0, a.indexOf(":"));
- S.substr(a, a.indexOf(":") +
- 1, null);
- X.library.exists(b) || y.Log.trace('[openfl.Assets] There is no asset library named "' + b + '"', {
- fileName: "Assets.hx",
- lineNumber: 348,
- className: "openfl.Assets",
- methodName: "getMovieClip"
- });
- return null
- };
- J.Assets.getSound = function (a) {
- J.Assets.initialize();
- if (X.type.exists(a)) {
- var b = X.type.get(a);
- if (b == J.AssetType.SOUND || b == J.AssetType.MUSIC) return new k.media.Sound(new k.net.URLRequest(X.path.get(a)))
- }
- y.Log.trace('[openfl.Assets] There is no Sound asset with an ID of "' + a + '"', {
- fileName: "Assets.hx",
- lineNumber: 396,
- className: "openfl.Assets",
- methodName: "getSound"
- });
- return null
- };
- J.Assets.getText = function (a) {
- a = J.Assets.getBytes(a);
- return null == a ? null : a.readUTFBytes(a.length)
- };
- J.Assets.resolveClass = function (a) {
- a = $.replace(a, "native.", "browser.");
- return Y.resolveClass(a)
- };
- J.Assets.resolveEnum = function (a) {
- a = $.replace(a, "native.", "browser.");
- return Y.resolveEnum(a)
- };
- J.Assets.get_id = function () {
- J.Assets.initialize();
- for (var a = [], b = X.type.keys(); b.hasNext();) {
- var d = b.next();
- a.push(d)
- }
- return a
- };
- J.Assets.get_library =
- function () {
- J.Assets.initialize();
- return X.library
- };
- J.Assets.get_path = function () {
- J.Assets.initialize();
- return X.path
- };
- J.Assets.get_type = function () {
- J.Assets.initialize();
- return X.type
- };
- J.AssetType = s["openfl.AssetType"] = {
- __ename__: ["openfl", "AssetType"],
- __constructs__: "BINARY FONT IMAGE MUSIC SOUND TEXT".split(" ")
- };
- J.AssetType.BINARY = ["BINARY", 0];
- J.AssetType.BINARY.toString = N;
- J.AssetType.BINARY.__enum__ = J.AssetType;
- J.AssetType.FONT = ["FONT", 1];
- J.AssetType.FONT.toString = N;
- J.AssetType.FONT.__enum__ = J.AssetType;
- J.AssetType.IMAGE = ["IMAGE", 2];
- J.AssetType.IMAGE.toString = N;
- J.AssetType.IMAGE.__enum__ = J.AssetType;
- J.AssetType.MUSIC = ["MUSIC", 3];
- J.AssetType.MUSIC.toString = N;
- J.AssetType.MUSIC.__enum__ = J.AssetType;
- J.AssetType.SOUND = ["SOUND", 4];
- J.AssetType.SOUND.toString = N;
- J.AssetType.SOUND.__enum__ = J.AssetType;
- J.AssetType.TEXT = ["TEXT", 5];
- J.AssetType.TEXT.toString = N;
- J.AssetType.TEXT.__enum__ = J.AssetType;
- J.LibraryType = s["openfl.LibraryType"] = {
- __ename__: ["openfl", "LibraryType"],
- __constructs__: ["SWF", "XFL"]
- };
- J.LibraryType.SWF = ["SWF", 0];
- J.LibraryType.SWF.toString = N;
- J.LibraryType.SWF.__enum__ = J.LibraryType;
- J.LibraryType.XFL = ["XFL", 1];
- J.LibraryType.XFL.toString = N;
- J.LibraryType.XFL.__enum__ = J.LibraryType;
- J.display = {};
- J.display.Tilesheet = function (a) {
- this.nmeBitmap = a;
- this.qOffsets = [];
- this.qRects = [];
- this.bounds = new k.geom.Rectangle;
- this.tile = new k.geom.Rectangle;
- this.matrix = new k.geom.Matrix
- };
- s["openfl.display.Tilesheet"] = J.display.Tilesheet;
- J.display.Tilesheet.__name__ = ["openfl", "display", "Tilesheet"];
- J.display.Tilesheet.prototype = {
- drawTiles: function (a, b, d, c) {
- null == c && (c = 0);
- d = a.rec;
- var e = a.len,
- f, l = 0,
- m = b.length,
- h = 0,
- p, k, r = this.bounds,
- Q = this.tile,
- w = this.matrix,
- t, n, q = 0 != (c & 1),
- s = 0 != (c & 2),
- z = 0 != (c & 16),
- x = q || s || z;
- d[e++] = 16;
- d[e++] = this.nmeBitmap;
- d[e++] = c;
- f = e;
- d[e++] = 0;
- 0 != (c & 4) && (h += 3);
- 0 != (c & 8) && h++;
- for (r.setVoid(); l < m;)
- 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(),
- 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++];
- d[f] = e;
- a.len = e;
- a.grab(r.x, r.y, r.x + r.width, r.y + r.height)
- },
- addTileRect: function (a, b) {
- null == b && (b = new k.geom.Point);
- this.qRects.push(a);
- this.qOffsets.push(b);
- return this.qRects.length - 1
- },
- __class__: J.display.Tilesheet
- };
- var q = {
- OzEvent: function (a) {
- this.target = a
- }
- };
- s["oz.OzEvent"] = q.OzEvent;
- q.OzEvent.__name__ = ["oz", "OzEvent"];
- q.OzEvent.prototype = {
- __class__: q.OzEvent
- };
- q.OzFont = function () {
- this.chars = [];
- this.kernings = []
- };
- s["oz.OzFont"] = q.OzFont;
- q.OzFont.__name__ = ["oz", "OzFont"];
- q.OzFont.prototype = {
- RegisterCharacters: function () {
- this.frames = [];
- this.movieClips = [];
- for (var a = 0, b = 0, d = this.chars.length; b < d;) {
- var c = b++;
- 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({
- name: this.fontName + "_" + this.chars[c].letter,
- tilesheetId: -1,
- frames: [a]
- }), this.chars[c].movieClip = this.movieClips[this.movieClips.length - 1], a++)
- }
- q.OzSprite.RegisterTilesheet(this.bitmapName, this.movieClips, this.frames);
- this.tilesheetId = this.movieClips[0].tilesheetId
- },
- addKerning: function (a, b, d) {
- null == this.kernings[a] && (this.kernings[a] = []);
- this.kernings[a][b] = d
- },
- __class__: q.OzFont
- };
- q.OzGeometry = function () {};
- s["oz.OzGeometry"] = q.OzGeometry;
- q.OzGeometry.__name__ = ["oz", "OzGeometry"];
- q.OzGeometry.InitPool = function (a) {
- null == a && (a = -1); - 1 == a && (a = 1E4);
- q.OzGeometry.freePointers = [];
- for (var b = 0; b < a;) {
- var d = b++;
- q.OzGeometry.freePointers[d] = new q.OzGeometry
- }
- q.OzGeometry.freePointerId = 0
- };
- q.OzGeometry.GetNew = function () {
- return q.OzGeometry.freePointers[q.OzGeometry.freePointerId++]
- };
- q.OzGeometry.Release = function (a) {
- q.OzGeometry.freePointers[--q.OzGeometry.freePointerId] = a
- };
- q.OzGeometry.prototype = {
- pi: function (a) {
- return K.parseInt(a)
- },
- pf: function (a) {
- return K.parseFloat(a)
- },
- init: function (a, b, d, c, e, f, l, m, h) {
- null == h && (h = !0);
- null == f && (f = 0);
- null == e && (e = 0);
- null ==
- c && (c = 0);
- this.type = a;
- this.x = b;
- this.y = d;
- this.degrees = c;
- if (1 == this.type) this.halfWidth = e, this.halfHeight = f;
- else if (2 == this.type) this.radius = e;
- else if (3 == this.type)
- if (h)
- for (this.vx = [], this.vy = [], a = 0, b = l.length; a < b;) d = a++, this.vx[d] = l[d], this.vy[d] = m[d];
- else this.vx = l, this.vy = m;
- else 4 != this.type && 6 == this.type && (this.halfWidth = e, this.halfHeight = f)
- },
- fromXML: function (a) {
- switch (a.get("type")) {
- case "rect":
- this.init(1, this.pf(a.get("x")), this.pf(a.get("y")), this.pf(a.get("degrees")), this.pf(a.get("halfWidth")),
- this.pf(a.get("halfHeight")));
- break;
- case "poly":
- this.pi(a.get("nVertices"));
- for (var b = a.get("vertices").split(","), d = [], c = [], e = 0, f = b.length / 2 | 0; e < f;) {
- var l = 2 * e++;
- d[l / 2 | 0] = this.pf(b[l]);
- c[l / 2 | 0] = this.pf(b[l + 1])
- }
- this.init(3, this.pf(a.get("x")), this.pf(a.get("y")), this.pf(a.get("degrees")), 0, 0, d, c);
- break;
- case "circ":
- this.init(2, this.pf(a.get("x")), this.pf(a.get("y")), this.pf(a.get("degrees")), this.pf(a.get("radius")));
- break;
- case "line":
- this.x1 = this.pf(a.get("x1"));
- this.x2 = this.pf(a.get("x2"));
- this.y1 =
- this.pf(a.get("y1"));
- this.y2 = this.pf(a.get("y2"));
- this.init(4, this.pf(a.get("x")), this.pf(a.get("y")), 0, 0, 0);
- break;
- case "dot":
- this.init(5, this.pf(a.get("x")), this.pf(a.get("y")));
- break;
- case "trie":
- 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")));
- break;
- default:
- throw new k.errors.Error("Invalid shape Xml type");
- }
- },
- toXML: function () {
- var a = O.createElement("geometry");
- switch (this.type) {
- case 1:
- a.set("type", "rect");
- 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));
- break;
- case 2:
- a.set("type", "circ");
- a.set("x", this._f(this.x));
- a.set("y", this._f(this.y));
- a.set("degrees", this._f(this.degrees));
- a.set("radius", this._f(this.radius));
- break;
- case 3:
- a.set("type", "poly");
- a.set("x", this._f(this.x));
- a.set("y", this._f(this.y));
- a.set("degrees", this._f(this.degrees));
- a.set("nVertices", "" + this.vx.length);
- for (var b =
- "", d = 0, c = this.vx.length - 1; d < c;) var e = d++,
- b = b + (this._f(this.vx[e]) + "," + this._f(this.vy[e]) + ",");
- b += this._f(this.vx[this.vx.length - 1]) + "," + this._f(this.vy[this.vx.length - 1]);
- a.set("vertices", b);
- break;
- case 4:
- a.set("type", "line");
- a.set("x", this._f(this.x));
- a.set("y", this._f(this.y));
- a.set("x1", this._f(this.x1));
- a.set("y1", this._f(this.y1));
- a.set("x2", this._f(this.x2));
- a.set("y2", this._f(this.y2));
- break;
- case 5:
- a.set("type", "dot");
- a.set("x", this._f(this.x));
- a.set("y", this._f(this.y));
- break;
- case 6:
- a.set("type",
- "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))
- }
- return a
- },
- _f: function (a) {
- return "" + q.OzUtil.round(a, 2)
- },
- pointSelects: function (a, b) {
- var d = !1,
- c = q.OzGeometry.temp2;
- this.applyOriginRotation(a, b, -this.degrees, c);
- switch (this.type) {
- case 1:
- d = Math.abs(this.x - c[0]) < this.halfWidth && Math.abs(this.y - c[1]) < this.halfHeight;
- break;
- case 2:
- d = this.radius * this.radius >= (c[0] - this.x) *
- (c[0] - this.x) + (c[1] - this.y) * (c[1] - this.y);
- break;
- case 3:
- c[0] -= this.x;
- c[1] -= this.y;
- for (var e = d = 0, f = this.vx.length; e < f;) {
- var l = e++,
- m = (l + 1) % this.vx.length;
- 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--
- }
- d = 0 != d;
- break;
- case 6:
- var h, p, e = this.x - this.halfWidth,
- f = this.y + this.halfHeight,
- l = this.x,
- m = this.y - this.halfHeight;
- h = this.x + this.halfWidth;
- p = this.y + this.halfHeight;
- 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]);
- break;
- case 4:
- 5 > q.OzUtil.PointLineDistance(this.x1, this.y1, this.x2, this.y2, c[0] - this.x, c[1] - this.y, !0) && (d = !0);
- break;
- case 5:
- 5 > Math.abs(this.x - c[0]) && 5 > Math.abs(this.y - c[1]) && (d = !0)
- }
- return d
- },
- getMinMaxXY: function (a) {
- a[0] = 2E6;
- a[1] = 2E6;
- a[2] = -2E6;
- a[3] = -2E6;
- var b = q.OzGeometry.temp2;
- switch (this.type) {
- case 1:
- this.applyOriginRotation(this.x - this.halfWidth,
- this.y - this.halfHeight, this.degrees, b);
- this.adjustMinMaxXY(a, b);
- this.applyOriginRotation(this.x + this.halfWidth, this.y - this.halfHeight, this.degrees, b);
- this.adjustMinMaxXY(a, b);
- this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees, b);
- this.adjustMinMaxXY(a, b);
- this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees, b);
- this.adjustMinMaxXY(a, b);
- break;
- case 2:
- a[0] = this.x - this.radius;
- a[1] = this.y - this.radius;
- a[2] = this.x + this.radius;
- a[3] = this.y + this.radius;
- break;
- case 3:
- for (var d = 0, c = this.vx.length; d < c;) {
- var e = d++;
- this.applyOriginRotation(this.vx[e] + this.x, this.vy[e] + this.y, this.degrees, b);
- this.adjustMinMaxXY(a, b)
- }
- break;
- case 6:
- this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees, b);
- this.adjustMinMaxXY(a, b);
- this.applyOriginRotation(this.x, this.y - this.halfHeight, this.degrees, b);
- this.adjustMinMaxXY(a, b);
- this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees, b);
- this.adjustMinMaxXY(a, b);
- break;
- case 4:
- b[0] =
- this.x + this.x1;
- b[1] = this.y + this.y1;
- this.adjustMinMaxXY(a, b);
- b[0] = this.x + this.x2;
- b[1] = this.y + this.y2;
- this.adjustMinMaxXY(a, b);
- break;
- case 5:
- a[0] = this.x - 3, a[1] = this.y - 3, a[2] = this.x + 3, a[3] = this.y + 3
- }
- },
- drawLocalOutline: function (a) {
- switch (this.type) {
- case 1:
- a.moveTo(-this.halfWidth, -this.halfHeight);
- a.lineTo(this.halfWidth, -this.halfHeight);
- a.lineTo(this.halfWidth, this.halfHeight);
- a.lineTo(-this.halfWidth, this.halfHeight);
- a.lineTo(-this.halfWidth, -this.halfHeight);
- break;
- case 2:
- a.drawCircle(0, 0, this.radius);
- break;
- case 3:
- a.moveTo(this.vx[0], this.vy[0]);
- for (var b = 1, d = this.vx.length; b < d;) {
- var c = b++;
- a.lineTo(this.vx[c], this.vy[c])
- }
- a.lineTo(this.vx[0], this.vy[0]);
- break;
- case 6:
- a.moveTo(-this.halfWidth, this.halfHeight), a.lineTo(0, -this.halfHeight), a.lineTo(this.halfWidth, this.halfHeight), a.lineTo(-this.halfWidth, this.halfHeight)
- }
- },
- drawGlobalOutline: function (a, b, d, c) {
- null == c && (c = 0);
- null == d && (d = 0);
- null == b && (b = 0);
- var e = q.OzGeometry.temp2;
- switch (this.type) {
- case 1:
- this.applyOriginRotation(this.x - this.halfWidth,
- this.y - this.halfHeight, this.degrees + c, e);
- a.moveTo(b + e[0], d + e[1]);
- this.applyOriginRotation(this.x + this.halfWidth, this.y - this.halfHeight, this.degrees + c, e);
- a.lineTo(b + e[0], d + e[1]);
- this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
- a.lineTo(b + e[0], d + e[1]);
- this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
- a.lineTo(b + e[0], d + e[1]);
- this.applyOriginRotation(this.x - this.halfWidth, this.y - this.halfHeight, this.degrees + c, e);
- a.lineTo(b + e[0],
- d + e[1]);
- break;
- case 2:
- a.drawCircle(b + this.x, d + this.y, this.radius);
- break;
- case 3:
- this.applyOriginRotation(this.vx[0] + this.x, this.vy[0] + this.y, this.degrees, e);
- a.moveTo(b + e[0], d + e[1]);
- c = 1;
- for (var f = this.vx.length; c < f;) {
- var l = c++;
- this.applyOriginRotation(this.vx[l] + this.x, this.vy[l] + this.y, this.degrees, e);
- a.lineTo(b + e[0], d + e[1])
- }
- this.applyOriginRotation(this.vx[0] + this.x, this.vy[0] + this.y, this.degrees, e);
- a.lineTo(b + e[0], d + e[1]);
- break;
- case 6:
- this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight,
- this.degrees + c, e);
- a.moveTo(b + e[0], d + e[1]);
- this.applyOriginRotation(this.x, this.y - this.halfHeight, this.degrees + c, e);
- a.lineTo(b + e[0], d + e[1]);
- this.applyOriginRotation(this.x + this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
- a.lineTo(b + e[0], d + e[1]);
- this.applyOriginRotation(this.x - this.halfWidth, this.y + this.halfHeight, this.degrees + c, e);
- a.lineTo(b + e[0], d + e[1]);
- break;
- case 5:
- a.drawCircle(b + this.x, d + this.y, 3);
- break;
- case 4:
- this.applyOriginRotation(this.x + this.x1, this.y + this.y1, this.degrees + c, e), a.moveTo(b +
- 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])
- }
- },
- adjustMinMaxXY: function (a, b) {
- a[0] = Math.min(a[0], b[0]);
- a[1] = Math.min(a[1], b[1]);
- a[2] = Math.max(a[2], b[0]);
- a[3] = Math.max(a[3], b[1])
- },
- applyOriginRotation: function (a, b, d, c) {
- q.OzUtil.rotateAroundPoint(a, b, d, this.x, this.y, c)
- },
- makePhysics: function (a) {
- switch (this.type) {
- case 1:
- var b = new h.shape.Polygon(h.shape.Polygon.box(2 * this.halfWidth, 2 * this.halfHeight));
- b.zpp_inner.immutable_midstep("Shape::body");
- (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));
- null != b.zpp_inner.body ? b.zpp_inner.body.outer : null;
- break;
- case 2:
- b = new h.shape.Circle(this.radius);
- b.zpp_inner.immutable_midstep("Shape::body");
- (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));
- null != b.zpp_inner.body ? b.zpp_inner.body.outer : null;
- break;
- case 3:
- for (var b = [], d = 0, c = this.vx.length; d < c;) {
- var e = d++;
- b[e] = new h.geom.Vec2(this.vx[e], this.vy[e])
- }(new h.geom.GeomPoly(b)).convexDecomposition().foreach(function (b) {
- a.zpp_inner.wrap_shapes.add(new h.shape.Polygon(b))
- });
- break;
- default:
- throw new k.errors.Error("unsupported nape geo");
- }
- },
- __class__: q.OzGeometry
- };
- q.OzMatrix = function () {
- this.identity()
- };
- s["oz.OzMatrix"] = q.OzMatrix;
- q.OzMatrix.__name__ = ["oz",
- "OzMatrix"
- ];
- q.OzMatrix.getCurrentMatrix = function () {
- return q.OzMatrix.matrixStack[q.OzMatrix.matrixId]
- };
- q.OzMatrix.InitPool = function () {
- q.OzMatrix.matrixStack = [];
- for (var a = 0; 1E3 > a;) {
- var b = a++;
- q.OzMatrix.matrixStack[b] = new q.OzMatrix
- }
- q.OzMatrix.matrixId = 0;
- q.OzMatrix.DEG2RAD = Math.PI / 180;
- q.OzMatrix.RAD2DEG = 180 / Math.PI;
- q.OzMatrix.um = new q.OzMatrix
- };
- q.OzMatrix.PreMatrixMultiply = function (a) {
- var b = q.OzMatrix.matrixStack[q.OzMatrix.matrixId];
- q.OzMatrix.Multiply(b, a, b)
- };
- q.OzMatrix.PostMatrixMultiply = function (a) {
- var b =
- q.OzMatrix.matrixStack[q.OzMatrix.matrixId];
- new k.geom.Matrix;
- q.OzMatrix.Multiply(b, b, a)
- };
- q.OzMatrix.PushMatrix = function () {
- q.OzMatrix.matrixStack[q.OzMatrix.matrixId + 1].copy(q.OzMatrix.matrixStack[q.OzMatrix.matrixId]);
- q.OzMatrix.matrixId++
- };
- q.OzMatrix.PopMatrix = function () {
- q.OzMatrix.matrixId--
- };
- q.OzMatrix.getTemp = function (a) {
- return q.OzMatrix.matrixStack[q.OzMatrix.matrixId + a]
- };
- q.OzMatrix.Multiply = function (a, b, d) {
- var c = b.m00 * d.m01 + b.m01 * d.m11 + b.m02 * d.m21,
- e = b.m00 * d.m02 + b.m01 * d.m12 + b.m02 * d.m22,
- f = b.m10 *
- d.m00 + b.m11 * d.m10 + b.m12 * d.m20,
- l = b.m10 * d.m01 + b.m11 * d.m11 + b.m12 * d.m21,
- m = b.m10 * d.m02 + b.m11 * d.m12 + b.m12 * d.m22,
- h = b.m20 * d.m00 + b.m21 * d.m10 + b.m22 * d.m20,
- p = b.m20 * d.m01 + b.m21 * d.m11 + b.m22 * d.m21,
- k = b.m20 * d.m02 + b.m21 * d.m12 + b.m22 * d.m22;
- a.m00 = b.m00 * d.m00 + b.m01 * d.m10 + b.m02 * d.m20;
- a.m01 = c;
- a.m02 = e;
- a.m10 = f;
- a.m11 = l;
- a.m12 = m;
- a.m20 = h;
- a.m21 = p;
- a.m22 = k;
- a.transformed = !0
- };
- q.OzMatrix.prototype = {
- toMatrix: function (a) {
- a.a = this.m00;
- a.c = this.m01;
- a.tx = this.m02;
- a.b = this.m10;
- a.d = this.m11;
- a.ty = this.m12
- },
- fromMatrix: function (a) {
- this.m00 = a.a;
- this.m01 = a.c;
- this.m02 = a.tx;
- this.m10 = a.b;
- this.m11 = a.d;
- this.m12 = a.ty;
- this.m21 = this.m20 = 0;
- this.m22 = 1;
- this.transformed = !0
- },
- Scaling: function (a, b) {
- this.m00 = a;
- this.m10 = this.m02 = this.m01 = 0;
- this.m11 = b;
- this.m21 = this.m20 = this.m12 = 0;
- this.m22 = 1;
- this.transformed = !0
- },
- Translation: function (a, b) {
- this.m00 = 1;
- this.m01 = 0;
- this.m02 = a;
- this.m10 = 0;
- this.m11 = 1;
- this.m12 = b;
- this.m21 = this.m20 = 0;
- this.m22 = 1;
- this.transformed = !1
- },
- Rotation: function (a) {
- a *= q.OzMatrix.DEG2RAD;
- this.m00 = Math.cos(a);
- this.m01 = -Math.sin(a);
- this.m02 = 0;
- this.m10 = -this.m01;
- this.m11 = this.m00;
- this.m21 = this.m20 = this.m12 = 0;
- this.m22 = 1;
- this.transformed = !0
- },
- toString: function () {
- var a = "Matrix Transformed = " + K.string(this.transformed) + "\n",
- a = a + ("{" + this.m00 + ":" + this.m01 + ":" + this.m02 + "}\n"),
- a = a + ("{" + this.m10 + ":" + this.m11 + ":" + this.m12 + "}\n");
- return a += "{" + this.m20 + ":" + this.m21 + ":" + this.m22 + "}\n"
- },
- rotate: function (a) {
- q.OzMatrix.um.Rotation(a);
- q.OzMatrix.Multiply(this, q.OzMatrix.um, this)
- },
- scale: function (a, b) {
- q.OzMatrix.um.Scaling(a, b);
- q.OzMatrix.Multiply(this, q.OzMatrix.um,
- this)
- },
- translate: function (a, b) {
- q.OzMatrix.um.Translation(a, b);
- q.OzMatrix.Multiply(this, q.OzMatrix.um, this)
- },
- PostRotate: function (a) {
- q.OzMatrix.um.Rotation(a);
- q.OzMatrix.Multiply(this, this, q.OzMatrix.um)
- },
- PostScale: function (a, b) {
- q.OzMatrix.um.Scaling(a, b);
- q.OzMatrix.Multiply(this, this, q.OzMatrix.um)
- },
- PostTranslate: function (a, b) {
- q.OzMatrix.um.Translation(a, b);
- q.OzMatrix.Multiply(this, this, q.OzMatrix.um)
- },
- copy: function (a) {
- this.m00 = a.m00;
- this.m01 = a.m01;
- this.m02 = a.m02;
- this.m10 = a.m10;
- this.m11 = a.m11;
- this.m12 =
- a.m12;
- this.m20 = a.m20;
- this.m21 = a.m21;
- this.m22 = a.m22
- },
- identity: function () {
- this.m00 = 1;
- this.m10 = this.m02 = this.m01 = 0;
- this.m11 = 1;
- this.m21 = this.m20 = this.m12 = 0;
- this.m22 = 1;
- this.transformed = !1
- },
- __class__: q.OzMatrix
- };
- q.SpriteType = s["oz.SpriteType"] = {
- __ename__: ["oz", "SpriteType"],
- __constructs__: ["EMPTY", "BITMAP", "TEXT", "POLYGON"]
- };
- q.SpriteType.EMPTY = ["EMPTY", 0];
- q.SpriteType.EMPTY.toString = N;
- q.SpriteType.EMPTY.__enum__ = q.SpriteType;
- q.SpriteType.BITMAP = ["BITMAP", 1];
- q.SpriteType.BITMAP.toString = N;
- q.SpriteType.BITMAP.__enum__ =
- q.SpriteType;
- q.SpriteType.TEXT = ["TEXT", 2];
- q.SpriteType.TEXT.toString = N;
- q.SpriteType.TEXT.__enum__ = q.SpriteType;
- q.SpriteType.POLYGON = ["POLYGON", 3];
- q.SpriteType.POLYGON.toString = N;
- q.SpriteType.POLYGON.__enum__ = q.SpriteType;
- q.TextAlign = s["oz.TextAlign"] = {
- __ename__: ["oz", "TextAlign"],
- __constructs__: ["LEFT", "RIGHT", "CENTER", "JUSTIFIED"]
- };
- q.TextAlign.LEFT = ["LEFT", 0];
- q.TextAlign.LEFT.toString = N;
- q.TextAlign.LEFT.__enum__ = q.TextAlign;
- q.TextAlign.RIGHT = ["RIGHT", 1];
- q.TextAlign.RIGHT.toString = N;
- q.TextAlign.RIGHT.__enum__ =
- q.TextAlign;
- q.TextAlign.CENTER = ["CENTER", 2];
- q.TextAlign.CENTER.toString = N;
- q.TextAlign.CENTER.__enum__ = q.TextAlign;
- q.TextAlign.JUSTIFIED = ["JUSTIFIED", 3];
- q.TextAlign.JUSTIFIED.toString = N;
- q.TextAlign.JUSTIFIED.__enum__ = q.TextAlign;
- q.OzSprite = function (a, b) {
- this.reset();
- null == b && (b = q.SpriteType.EMPTY);
- this.mc = a;
- this.type = null != a ? q.SpriteType.BITMAP : b;
- b == q.SpriteType.POLYGON ? this.flSprite = new k.display.Sprite : b == q.SpriteType.TEXT && (this.textAlign = q.TextAlign.LEFT, this.text = "")
- };
- s["oz.OzSprite"] = q.OzSprite;
- q.OzSprite.__name__ = ["oz", "OzSprite"];
- q.OzSprite.StaticInit = function () {
- q.OzSprite.TilesheetId = -1;
- q.OzSprite.DrawingAlpha = !1;
- q.OzSprite.FloatArrays = new y.ds.IntMap;
- q.OzSprite.DrawArray = [];
- for (var a = q.OzSprite.DrawArrayLength = 0; 5E3 > a;) a++, q.OzSprite.DrawArray.push(0);
- q.OzSprite.Tilesheets = [];
- q.OzSprite.Bitmaps = [];
- q.OzSprite.BitmapsIds = [];
- q.OzSprite.BitmapsNames = [];
- q.OzSprite.TilesheetFrames = [];
- q.OzSprite.TilesheetBitmapDatas = [];
- q.OzSprite.DrawMatrix = new k.geom.Matrix;
- q.OzSprite.DrawPoint = new k.geom.Point;
- q.OzSprite.DrawRect = new k.geom.Rectangle;
- q.OzSprite.AlphaColorTransform = new k.geom.ColorTransform
- };
- q.OzSprite.RegisterTilesheet = function (a, b, d) {
- a = J.Assets.getBitmapData("assets/" + a);
- for (var c = new J.display.Tilesheet(a), e = 0, f = d.length; e < f;) {
- var l = e++;
- 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]))
- }
- 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),
- q.OzSprite.BitmapsNames.push(b[l].name);
- q.OzSprite.Tilesheets.push(c);
- q.OzSprite.TilesheetFrames.push(d);
- q.OzSprite.TilesheetBitmapDatas.push([]);
- e = 0;
- 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);
- return m
- };
- q.OzSprite.GetSpriteAtPoint = function (a, b, d, c, e, f, l, m) {
- null == m && (m = 0);
- null == l && (l = 1);
- null == f && (f = 1);
- null == e && (e = 0);
- null == c && (c = 0);
- if (1E-4 > a.alpha || !1 == a.visible) return null;
- if (null != a.child) {
- var h = a.child.prev,
- p = h;
- do {
- 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);
- if (null != k) return k;
- h = h.prev
- } while (h != p)
- }
- 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] -
- 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
- };
- q.OzSprite.Flush = function () {
- if (0 < q.OzSprite.DrawArrayLength) {
- if (q.OzSprite.DrawingAlpha)
- for (var a = 0, b = q.OzSprite.DrawArrayLength / 8 | 0; a < b;) {
- var d = a++,
- d = 8 * d;
- q.OzSprite.DrawMatrix.tx = q.OzSprite.DrawArray[d];
- q.OzSprite.DrawMatrix.ty = q.OzSprite.DrawArray[d + 1];
- q.OzSprite.DrawMatrix.a = 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];
- q.OzSprite.AlphaColorTransform.alphaMultiplier = q.OzSprite.DrawArray[d + 7];
- 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)
- } else
- 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 =
- 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,
- 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);
- q.OzSprite.DrawArrayLength = 0
- }
- };
- q.OzSprite.prototype = {
- getLineLength: function (a) {
- null == a && (a = 0);
- for (var b = 0; a != S.cca("\n", 0) && a < this.text.length;) {
- var d = S.cca(this.text,
- a),
- c = this.font.chars[d],
- c = c.xOffset + c.xAdvance;
- if (0 < a) {
- var e = S.cca(this.text, a - 1);
- null == this.font.kernings[e] || Math.isNaN(this.font.kernings[e][d]) || (c += this.font.kernings[e][d])
- }
- b += c;
- a++
- }
- return b
- },
- draw: function (a) {
- null == a && (a = 1);
- a *= this.alpha;
- if (this.visible && !(0.001 > a)) {
- q.OzMatrix.PushMatrix();
- if (this.type == q.SpriteType.EMPTY) {
- var b = q.OzMatrix.getCurrentMatrix();
- this.rotation %= 360;
- b.PostTranslate(this.x, this.y);
- b.PostRotate(this.rotation);
- b.PostScale(this.scaleX, this.scaleY)
- } else if (this.type ==
- q.SpriteType.BITMAP) {
- -1 == q.OzSprite.TilesheetId && (q.OzSprite.TilesheetId = this.mc.tilesheetId);
- q.OzSprite.TilesheetId != this.mc.tilesheetId && (q.OzSprite.Flush(), q.OzSprite.TilesheetId = this.mc.tilesheetId);
- if (0.999 > a && !q.OzSprite.DrawingAlpha || 0.999 < a && q.OzSprite.DrawingAlpha) q.OzSprite.Flush(), q.OzSprite.DrawingAlpha = !q.OzSprite.DrawingAlpha;
- b = q.OzMatrix.getCurrentMatrix();
- this.rotation %= 360;
- b.PostTranslate(this.x, this.y);
- b.PostRotate(this.rotation);
- b.PostScale(this.scaleX, this.scaleY);
- var d;
- d = q.OzSprite.TilesheetFrames[this.mc.tilesheetId][this.mc.frames[this.currentFrame -
- 1]];
- var c = q.OzMatrix.getTemp(1);
- c.Translation(-d[4], -d[5]);
- q.OzMatrix.Multiply(c, b, c);
- q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m02;
- q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m12;
- q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = this.mc.frames[this.currentFrame - 1];
- q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m00;
- q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m10;
- q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = c.m01;
- q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] =
- c.m11;
- q.OzSprite.DrawingAlpha && (q.OzSprite.DrawArray[q.OzSprite.DrawArrayLength++] = a);
- this.playing && (this.currentFrame = 1 + this.currentFrame % this.mc.frames.length)
- } else if (this.type == q.SpriteType.POLYGON) {
- q.OzSprite.Flush();
- b = q.OzMatrix.getCurrentMatrix();
- this.rotation %= 360;
- if (0.999 > a && !q.OzSprite.DrawingAlpha || 0.999 < a && q.OzSprite.DrawingAlpha) q.OzSprite.DrawingAlpha = !q.OzSprite.DrawingAlpha;
- b.PostTranslate(this.x, this.y);
- b.PostRotate(this.rotation);
- b.PostScale(this.scaleX, this.scaleY);
- b.toMatrix(q.OzSprite.DrawMatrix);
- 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)
- } else if (this.type == q.SpriteType.TEXT) {
- -1 == q.OzSprite.TilesheetId && (q.OzSprite.TilesheetId = this.font.tilesheetId);
- q.OzSprite.TilesheetId != this.font.tilesheetId && (q.OzSprite.Flush(), q.OzSprite.TilesheetId = this.font.tilesheetId);
- if (0.999 > a &&
- !q.OzSprite.DrawingAlpha || 0.999 < a && q.OzSprite.DrawingAlpha) q.OzSprite.Flush(), q.OzSprite.DrawingAlpha = !q.OzSprite.DrawingAlpha;
- q.OzMatrix.PushMatrix();
- d = q.OzMatrix.getCurrentMatrix();
- var e = 0;
- this.textAlign == q.TextAlign.CENTER ? e = -this.getLineLength() / 2 : this.textAlign == q.TextAlign.RIGHT && (e = -this.getLineLength());
- c = 0;
- b = q.OzMatrix.getCurrentMatrix();
- b.PostTranslate(this.x + e, this.y + 0);
- b.PostRotate(this.rotation);
- b.PostScale(this.scaleX, this.scaleY);
- for (var e = 0, f = this.text.length; e < f;) {
- var l = e++;
- this.rotation %=
- 360;
- var m = S.cca(this.text, l),
- h = this.font.chars[m],
- p = h.xOffset;
- if (0 < l) {
- var k = S.cca(this.text, l - 1),
- p = p + this.font.chars[k].xAdvance;
- null == this.font.kernings[k] || Math.isNaN(this.font.kernings[k][m]) || (p += this.font.kernings[k][m])
- }
- h = 0 + h.yOffset - c;
- c += h;
- b.PostTranslate(p, h);
- 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++] =
- 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))
- }
- q.OzMatrix.PopMatrix()
- }
- if (null != this.child) {
- b = this.child;
- do b.draw(a), b = b.next; while (b != this.child)
- }
- q.OzMatrix.PopMatrix()
- }
- },
- getTotalRotation: function () {
- return null == this.parent ? this.rotation : this.rotation + this.parent.getTotalRotation()
- },
- addChild: function (a) {
- if (null !=
- a)
- if (null != a.parent && a.parent.removeChild(a), a.parent = this, null == this.child) this.child = a, a.prev = a, a.next = a;
- else {
- var b = this.child.prev,
- d = this.child;
- b.next = a;
- d.prev = a;
- a.prev = b;
- a.next = d
- }
- },
- removeChildren: function () {
- for (y.Log.trace("new call", {
- fileName: "OzSprite.hx",
- lineNumber: 230,
- className: "oz.OzSprite",
- methodName: "removeChildren"
- }); null != this.child;) this.child.removeChildren(), this.removeChild(this.child), y.Log.trace(null == this.child, {
- fileName: "OzSprite.hx",
- lineNumber: 234,
- className: "oz.OzSprite",
- methodName: "removeChildren",
- customParams: ["is null?"]
- });
- y.Log.trace("end call", {
- fileName: "OzSprite.hx",
- lineNumber: 236,
- className: "oz.OzSprite",
- methodName: "removeChildren"
- })
- },
- clear: function () {
- this.removeChildren();
- y.Log.trace("remove children end", {
- fileName: "OzSprite.hx",
- lineNumber: 226,
- className: "oz.OzSprite",
- methodName: "clear"
- });
- this.type = q.SpriteType.EMPTY
- },
- removeChild: function (a) {
- if (null != a && a.parent == this) {
- this.child == a && (this.child = this.child.next == this.child ? null : this.child.next);
- var b = a.prev,
- d = a.next;
- null != b && (b.next = d);
- null != d && (d.prev = b);
- a.prev = a;
- a.next = a;
- a.parent = null
- }
- },
- changeMC: function (a) {
- this.mc = a;
- this.currentFrame = 1
- },
- getChild: function (a) {
- if (null != this.child) {
- var b = this.child;
- do {
- if (null != b.name && b.name == a) return b;
- b = b.next
- } while (b != this.child)
- }
- return null
- },
- init: function () {},
- play: function () {
- this.playing = !0
- },
- stop: function () {
- this.playing = !1
- },
- gotoAndStop: function (a) {
- 1 > a || a > this.mc.frames.length ? y.Log.trace("Error! Invalid frame", {
- fileName: "OzSprite.hx",
- lineNumber: 179,
- className: "oz.OzSprite",
- methodName: "gotoAndStop",
- customParams: [a]
- }) : this.currentFrame = a;
- this.playing = !1
- },
- reset: function () {
- this.parent = this.child = this.mc = null;
- this.next = this;
- this.prev = this;
- this.x = this.y = this.rotation = 0;
- this.scaleX = this.scaleY = 1;
- this.type = q.SpriteType.EMPTY;
- this.alpha = 1;
- this.mouseEnabled = this.visible = !0;
- this.currentFrame = 1;
- this.playing = !0
- },
- addEventListener: function (a, b) {
- null == this.eventListeners && (this.eventListeners = new y.ds.IntMap);
- this.eventListeners.set(a, b)
- },
- setxy: function (a, b) {
- this.x = a;
- this.y = b
- },
- __class__: q.OzSprite
- };
- q.OzUtil =
- function () {};
- s["oz.OzUtil"] = q.OzUtil;
- q.OzUtil.__name__ = ["oz", "OzUtil"];
- q.OzUtil.SortIdsByName = function (a, b) {
- var d, c;
- for (d = a.length - 1; 0 <= d;) {
- for (c = 0; c < d;) {
- if (b[c] > b[c + 1]) {
- var e = b[c];
- b[c] = b[c + 1];
- b[c + 1] = e;
- e = a[c];
- a[c] = a[c + 1];
- a[c + 1] = e
- }
- c++
- }
- d--
- }
- };
- q.OzUtil.FindStringId = function (a, b) {
- for (var d = -1, c = a.length; d + 1 < c;) {
- var e = Math.floor((d + c) / 2);
- if (a[e] < b) d = e;
- else if (a[e] > b) c = e;
- else return e
- }
- return -1
- };
- q.OzUtil.PointInsideSegment = function (a, b, d) {
- return b <= a && a <= d
- };
- q.OzUtil.round = function (a, b) {
- null == b && (b = 2);
- for (var d =
- 1, c = 0; c < b;) c++, d *= 10;
- return Math.round(a * d) / d
- };
- q.OzUtil.rotateAroundPoint = function (a, b, d, c, e, f) {
- var l = Math.sin(d / 180 * Math.PI);
- d = Math.cos(d / 180 * Math.PI);
- a -= c;
- b -= e;
- f[0] = c + a * d - b * l;
- f[1] = e + b * d + a * l
- };
- q.OzUtil.DotPoints = function (a, b, d, c, e, f, l, m) {
- return (d - a) * (l - e) + (c - b) * (m - f)
- };
- q.OzUtil.CrossPoints = function (a, b, d, c, e, f) {
- return (d - a) * (f - b) - (c - b) * (e - a)
- };
- q.OzUtil.AnglePoints = function (a, b, d, c, e, f) {
- var l = q.OzUtil.DistancePoints(a, b, d, c) * q.OzUtil.DistancePoints(d, c, e, f);
- return 1E-6 > Math.abs(l) ? 0 : 180 / Math.PI * Math.acos(q.OzUtil.DotPoints(d,
- c, a, b, d, c, e, f) / l)
- };
- q.OzUtil.DistancePoints = function (a, b, d, c) {
- a -= d;
- b -= c;
- return Math.sqrt(a * a + b * b)
- };
- q.OzUtil.PointLineDistance = function (a, b, d, c, e, f, l) {
- var m = q.OzUtil.CrossPoints(a, b, d, c, e, f) / q.OzUtil.DistancePoints(a, b, d, c);
- if (l) {
- if (0 < q.OzUtil.DotPoints(a, b, d, c, d, c, e, f)) return q.OzUtil.DistancePoints(d, c, e, f);
- if (0 < q.OzUtil.DotPoints(d, c, a, b, a, b, e, f)) return q.OzUtil.DistancePoints(a, b, e, f)
- }
- return Math.abs(m)
- };
- q.OzUtil.LineSegmentCrossOrLie = function (a, b, d, c, e, f, l, m) {
- 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, f, l, m, a, b) * q.OzUtil.CrossPoints(e, f, l, m, d, c)
- };
- q.OzUtil.LineSegmentCross = function (a, b, d, c, e, f, l, m) {
- 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,
- f, l, m, a, b) * q.OzUtil.CrossPoints(e, f, l, m, d, c)
- };
- q.OzUtil.DoublePolygonArea = function (a, b) {
- for (var d = a.length, c = 0, e = 0; e < d;) var f = e++,
- l = (f + 1) % d,
- c = c + (a[f] * b[l] - a[l] * b[f]);
- return c
- };
- q.OzUtil.ReverseVerticesOrder = function (a, b) {
- for (var d = a.length, c, e = 0, f = d / 2 | 0; e < f;) {
- var l = e++;
- c = a[l];
- a[l] = a[d - 1 - l];
- a[d - 1 - l] = c;
- c = b[l];
- b[l] = b[d - 1 - l];
- b[d - 1 - l] = c
- }
- };
- q.OzUtil.PointInsidePolygon = function (a, b, d, c) {
- for (var e = 0, f = 0, l = d.length; f < l;) {
- var m = f++,
- h = (m + 1) % d.length;
- c[m] <= b ? c[h] > b && 0 < q.OzUtil.CrossPoints(a, b, d[m], c[m], d[h], c[h]) &&
- e++ : c[h] <= b && 0 > q.OzUtil.CrossPoints(a, b, d[m], c[m], d[h], c[h]) && e--
- }
- return 0 != e
- };
- q.OzUtil.CleanPolygonCollinears = function (a, b) {
- for (var d = 0, c = 0; d < a.length && 3 < a.length;) {
- var e = (c + 1) % a.length,
- f = (c - 1 + a.length) % a.length;
- 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++)
- }
- };
- q.OzUtil.dashLine = function (a, b, d, c, e, f, l, m, h) {
- null == h && (h = 0);
- null == m && (m = !1);
- null == l && (l = 0);
- null == f && (f = 0);
- var p = c - b,
- k = e - d,
- r = Math.sqrt(p * p + k * k),
- p = Math.atan2(k,
- p),
- n = Math.cos(p),
- w = Math.sin(p),
- p = n * f,
- k = w * f,
- t = n * l,
- s = w * l,
- n = b + Math.min(h, r) * n,
- w = d + Math.min(h, r) * w;
- if (0 < h && (q.OzUtil.dashLine(a, n, w, b, d, l, f, !0), h > r)) return;
- a.moveTo(n, w);
- if (0 == l) a.lineTo(c, e);
- else if (b = Math.floor((r - h) / (f + l)), m) {
- for (m = 0; m < b;) m++, a.moveTo(n += p, w += k), a.lineTo(n += t, w += s);
- r - h - (f + l) * b >= f && (a.moveTo(n + p, w + k), a.lineTo(c, e))
- } else {
- for (m = 0; m < b;) m++, a.lineTo(n += p, w += k), a.moveTo(n += t, w += s);
- r - h - (f + l) * b >= f ? a.lineTo(n + p, w + k) : a.lineTo(c, e)
- }
- };
- q.Xu = function () {};
- s["oz.Xu"] = q.Xu;
- q.Xu.__name__ = ["oz", "Xu"];
- q.Xu.fc = function (a, b) {
- var d = null;
- if (null != a)
- for (var c = a.elementsNamed(b); c.hasNext();) {
- d = c.next();
- break
- }
- return d
- };
- q.Xu.cwav = function (a, b, d, c) {
- var e = null;
- if (null != a)
- for (a = a.elementsNamed(b); a.hasNext();) {
- b = a.next();
- var f = b.get(d);
- if (null != f && f == c) {
- e = b;
- break
- }
- }
- return e
- };
- var Z = {
- PlatformHTML5: function () {}
- };
- s["platforms.PlatformHTML5"] = Z.PlatformHTML5;
- Z.PlatformHTML5.__name__ = ["platforms", "PlatformHTML5"];
- Z.PlatformHTML5.hasInside = function (a) {
- y.Log.trace(F.Browser.window.location.toString(), {
- fileName: "PlatformHTML5.hx",
- lineNumber: 12,
- className: "platforms.PlatformHTML5",
- methodName: "hasInside"
- });
- return 0 <= F.Browser.window.location.toString().indexOf(a)
- };
- Z.PlatformHTML5.invalidRect = function () {
- return Z.PlatformHTML5.resizeW != Z.PlatformHTML5.getWidth() || Z.PlatformHTML5.resizeH != Z.PlatformHTML5.getHeight()
- };
- Z.PlatformHTML5.getWidth = function () {
- return F.Browser.window.innerWidth
- };
- Z.PlatformHTML5.getHeight = function () {
- return F.Browser.window.innerHeight
- };
- Z.PlatformHTML5.hideAddressBar = function () {};
- Z.PlatformHTML5.resize = function () {
- var a =
- 1 * R.RESIZE_WIDTH / R.RESIZE_HEIGHT,
- b = F.Browser.window.innerWidth,
- d = F.Browser.window.innerHeight;
- Z.PlatformHTML5.resizeW = b;
- Z.PlatformHTML5.resizeH = d;
- var c = b,
- e = d;
- Z.PlatformHTML5.offsetX = Z.PlatformHTML5.offsetY = 0;
- c / e > a ? (c = e * a, Z.PlatformHTML5.offsetX = (b - c) / 2) : (e = c / a, Z.PlatformHTML5.offsetY = (d - e) / 2);
- a = c / R.RESIZE_WIDTH;
- R.instance.set_scaleX(a);
- R.instance.set_scaleY(a);
-
- m = document.getElementById("gameDiv");
- m.style.width = c + "px";
- m.style.height = 2 * e + "px";
- m.style.left = Z.PlatformHTML5.offsetX +
- "px";
- m.style.top = Z.PlatformHTML5.offsetY + "px";
- m.style.position = "absolute"
-
- /* for (var a = new F.JQuery("body>div"), f = 0, l = a.length; f < l;) {
- var m = f++,
- m = a[m];
- m.style.width = c + "px";
- m.style.height = 2 * e + "px";
- m.style.left = Z.PlatformHTML5.offsetX +
- "px";
- m.style.top = Z.PlatformHTML5.offsetY + "px";
- m.style.position = "absolute"
- } */
- R.instance.debugText.text = "browser window: " + b + " : " + d;
- R.instance.debugText.text += "offsets: " + Z.PlatformHTML5.offsetX + " : " + Z.PlatformHTML5.offsetY;
- F.Browser.window.scrollTo(0, 1);
- y.Log.trace("resizing html5", {
- fileName: "PlatformHTML5.hx",
- lineNumber: 84,
- className: "platforms.PlatformHTML5",
- methodName: "resize"
- })
- };
- Z.PlatformHTML5.prototype = {
- __class__: Z.PlatformHTML5
- };
- var M = {
- State: function (a) {
- this.p = a;
- this.doc = new q.OzSprite;
- a.stateSprite.addChild(this.doc);
- this.cnt = 0
- }
- };
- s["states.State"] = M.State;
- M.State.__name__ = ["states", "State"];
- M.State.prototype = {
- destroy: function () {
- null != this.doc && null != this.doc.parent && this.doc.parent.removeChild(this.doc)
- },
- update: function () {
- this.cnt++
- },
- __class__: M.State
- };
- M.StateCredits = function (a) {
- M.State.call(this, a);
- ba.cmcCredits(this.doc);
- this.doc.getChild("btnBack").addEventListener(2, A(this, this.goToMenu));
- this.doc.getChild("sponsor").addEventListener(2, T.moreGames)
- };
- s["states.StateCredits"] = M.StateCredits;
- M.StateCredits.__name__ = ["states", "StateCredits"];
- M.StateCredits.__super__ = M.State;
- M.StateCredits.prototype = I(M.State.prototype, {
- goToMenu: function (a) {
- this.p.changeState(new M.StateMenu(this.p))
- },
- update: function () {
- M.State.prototype.update.call(this)
- },
- __class__: M.StateCredits
- });
- M.StateGGG = function (a) {
- M.State.call(this, a);
- ba.cmcGGG(this.doc);
- this.doc.x = R.WIDTH / 2;
- this.doc.y = R.HEIGHT / 2;
- this.doc.getChild("bg").addEventListener(2, T.moreGames);
- this.doc.getChild("sponsor").addEventListener(2, T.moreGames)
- };
- s["states.StateGGG"] = M.StateGGG;
- M.StateGGG.__name__ = ["states", "StateGGG"];
- M.StateGGG.__super__ = M.State;
- M.StateGGG.prototype = I(M.State.prototype, {
- update: function () {
- M.State.prototype.update.call(this);
- 90 <= this.cnt && this.p.changeState(new M.StateMenu(this.p))
- },
- __class__: M.StateGGG
- });
- M.StateLevels = function (a) {
- M.State.call(this, a);
- ba.cmcLevels(this.doc);
- this.doc.getChild("btnBack").addEventListener(2, A(this, this.goToMenu));
- this.doc.getChild("sponsor").addEventListener(2, T.moreGames);
- this.buttons = [];
- for (a = 0; 25 > a;) {
- var b = a++;
- this.buttons[b] =
- new q.OzSprite(E.cmcLevelSelectButton);
- this.buttons[b].x = 60 + 88 * (b % 5);
- this.buttons[b].y = 115 + 85 * (b / 5 | 0);
- this.doc.addChild(this.buttons[b]);
- 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);
- var d = new q.OzSprite(null, q.SpriteType.TEXT);
- d.font = n.Font;
- d.textAlign = q.TextAlign.CENTER;
- d.y -= d.font.lineHeight /
- 2;
- this.buttons[b].addChild(d);
- d.text = "" + (b + 1)
- }
- };
- s["states.StateLevels"] = M.StateLevels;
- M.StateLevels.__name__ = ["states", "StateLevels"];
- M.StateLevels.__super__ = M.State;
- M.StateLevels.prototype = I(M.State.prototype, {
- goToMenu: function (a) {
- this.p.changeState(new M.StateMenu(this.p))
- },
- goToPlay: function (a) {
- for (var b = -1, d = 0, c = this.buttons.length; d < c;) {
- var e = d++;
- if (a.target == this.buttons[e]) {
- b = e;
- break
- }
- }
- T.currentLevel = b;
- y.Log.trace(b, {
- fileName: "StateLevels.hx",
- lineNumber: 50,
- className: "states.StateLevels",
- methodName: "goToPlay"
- });
- this.p.changeState(new M.StatePlay(this.p))
- },
- update: function () {
- M.State.prototype.update.call(this)
- },
- __class__: M.StateLevels
- });
- M.StateMenu = function (a) {
- M.State.call(this, a);
- ba.cmcMenu(this.doc);
- this.doc.getChild("btnCredits").addEventListener(2, A(this, this.goToCredits));
- this.doc.getChild("btnPlay").addEventListener(2, A(this, this.goToLevels));
- this.doc.getChild("btnMore").addEventListener(2, T.moreGames);
- this.doc.getChild("sponsor").addEventListener(2, T.moreGames)
- };
- s["states.StateMenu"] = M.StateMenu;
- M.StateMenu.__name__ = ["states", "StateMenu"];
- M.StateMenu.__super__ = M.State;
- M.StateMenu.prototype = I(M.State.prototype, {
- goToLevels: function (a) {
- this.p.changeState(new M.StateLevels(this.p))
- },
- goToCredits: function (a) {
- // play68_submitScore(); //dp_Ranking(); /*this.p.changeState(new M.StateCredits(this.p))*/
- },
- update: function () {
- M.State.prototype.update.call(this)
- },
- __class__: M.StateMenu
- });
- M.StatePlay = function (a, b) {
- M.State.call(this, a);
- this.bounds = [];
- this.touch = !1;
- this.weStart = this.touch = !0;
- this.curShape = 0;
- this.world = new h.space.Space(new h.geom.Vec2(0, 500));
- this.objects = [];
- this.hovers = [];
- this.hoverSprite = new q.OzSprite;
- this.hoverSprite.alpha = 0.5;
- this.doc.addChild(this.menuSprite = new q.OzSprite);
- ba.cmcPlay(this.menuSprite);
- this.menuSprite.getChild("btnPause").addEventListener(2, A(this, this.pause));
- this.menuSprite.getChild("sponsor").addEventListener(2, T.moreGames);
- this.doc.addChild(this.nextSprite = new q.OzSprite);
- this.doc.addChild(this.objectSprite = new q.OzSprite);
- this.doc.addChild(this.hoverSprite);
- this.doc.addChild(this.clockSprite = new q.OzSprite);
- this.doc.addChild(this.menuSprite.getChild("btnPause"));
- this.doc.addChild(this.menuSprite.getChild("sponsor"));
- this.doc.addChild(this.dialogSprite = new q.OzSprite);
- this.state = M.StatePlay.NORMAL;
- var d;
- null != b ? (this.fromEditor = !0, d = b) : d = q.Xu.cwav(T.levelsXML, "level", "name", "" + (T.currentLevel + 1));
- if (this.fromEditor || 0 != T.currentLevel) this.menuSprite.getChild("instructions").visible = !1;
- for (d = d.elementsNamed("object"); d.hasNext();) {
- var c = d.next(),
- e = new ea;
- e.fromXML(c, q.Xu.cwav(q.Xu.fc(T.definitionsXML, "objects"), "object", "type", c.get("type")), T.definitionsXML);
- 0 == e.attributes.get("type").indexOf("static") ? (e.initPhysics(this.world), this.objectSprite.addChild(e.sprite), this.objects.push(e)) : this.hovers.push(e)
- }
- this.hovers.sort(function (a, b) {
- return a.position - b.position
- });
- this.texts = [];
- d = 0;
- for (c = this.hovers.length; d < c;) {
- e = d++;
- this.nextSprite.addChild(this.hovers[e].sprite);
- this.hovers[e].sprite.x = 40 + 80 * e;
- this.hovers[e].sprite.y = 40;
- this.hovers[e].sprite.scaleX = this.hovers[e].sprite.scaleY = 0.5;
- this.hovers[e].geometry.getMinMaxXY(this.bounds);
- var f = this.bounds[2] -
- this.hovers[e].geometry.x,
- l = this.bounds[3] - this.hovers[e].geometry.y,
- m = Math.round(f / 10) + "x" + Math.round(l / 10);
- 60 <= l && (this.hovers[e].sprite.scaleY = 0.25);
- 60 <= f && (this.hovers[e].sprite.scaleX = 0.25);
- f = new q.OzSprite(null, q.SpriteType.TEXT);
- f.font = n.Font;
- f.textAlign = q.TextAlign.CENTER;
- f.x = 40 + 80 * e;
- f.y = 50;
- f.text = m;
- this.nextSprite.addChild(f);
- this.texts.push(f)
- }
- D.reFocus(a)
- };
- s["states.StatePlay"] = M.StatePlay;
- M.StatePlay.__name__ = ["states", "StatePlay"];
- M.StatePlay.__super__ = M.State;
- M.StatePlay.prototype = I(M.State.prototype, {
- goNext: function (a) {
- T.currentLevel == T.NUMLEVELS - 1 ? this.goToLevels(null) : (T.currentLevel++, this.p.changeState(new M.StatePlay(this.p)))
- },
- goRestart: function (a) {
- this.p.changeState(new M.StatePlay(this.p))
- },
- goToLevels: function (a) {
- this.p.changeState(new M.StateLevels(this.p))
- },
- update: function () {
- M.State.prototype.update.call(this);
- if (!this.paused && this.state != M.StatePlay.LOSE && this.state != M.StatePlay.WIN) {
- if (this.state == M.StatePlay.NORMAL) {
- var a = !1;
- this.hoverSprite.x = D.mx;
- var b = 0;
- this.curShape < this.hovers.length &&
- (this.hovers[this.curShape].geometry.getMinMaxXY(this.bounds), b = this.bounds[3] - this.hovers[this.curShape].geometry.y + 80);
- this.hoverSprite.y = D.my - b;
- D.mup && this.hoverSprite.visible && (a = !0);
- D.mdown ? (this.hoverSprite.visible = !0, 0 == this.showNext && (this.showNext = 1)) : this.hoverSprite.visible = !1;
- 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 =
- 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;
- 1 == this.showNext && (this.showNext = 2, this.nextSprite.x -=
- 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)
- }
- if (this.state == M.StatePlay.WAITING) {
- this.clockSprite.getChild("arrow").rotation += 2.5;
- for (var a = !0, b = 0, d = this.objects.length; b < d;) {
- var c = b++;
- if (null != this.objects[c].body && !this.objects[c].body.get_isSleeping()) {
- a = !1;
- break
- }
- }
- if (a || 360 <= this.clockSprite.getChild("arrow").rotation) this.state =
- 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()
- }
- this.world.step(1 / R.FPS);
- b = 0;
- for (d =
- 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;
- b = 0;
- for (d = this.objects.length; b < d;)
- if (c = b++, this.objects[c].body.get_position().get_y() > R.HEIGHT && (this.state == M.StatePlay.NORMAL || this.state == M.StatePlay.WAITING)) {
- this.state = M.StatePlay.LOSE;
- ba.cmcYouLose(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("btnMore").addEventListener(2, T.moreGames);
- break
- }
- }
- },
- pause: function (a) {
- this.paused = !0;
- this.dialogSprite.clear();
- ba.cmcPaused(this.dialogSprite);
- this.dialogSprite.getChild("btnPlay").addEventListener(2, A(this, this.resume));
- this.dialogSprite.getChild("btnLevels").addEventListener(2,
- A(this, this.goToLevels));
- this.dialogSprite.getChild("btnRestart").addEventListener(2, A(this, this.goRestart));
- this.dialogSprite.getChild("btnMore").addEventListener(2, T.moreGames);
- this.dialogSprite.x = R.WIDTH / 2;
- this.dialogSprite.y = R.HEIGHT / 2
- },
- resume: function (a) {
- this.dialogSprite.clear();
- this.paused = !1;
- y.Log.trace("go on", {
- fileName: "StatePlay.hx",
- lineNumber: 133,
- className: "states.StatePlay",
- methodName: "resume"
- })
- },
- echoXY: function () {
- y.Log.trace("Echo stuff", {
- fileName: "StatePlay.hx",
- lineNumber: 127,
- className: "states.StatePlay",
- methodName: "echoXY"
- })
- },
- __class__: M.StatePlay
- });
- var c = {
- ZPP_Const: function () {}
- };
- s["zpp_nape.ZPP_Const"] = c.ZPP_Const;
- c.ZPP_Const.__name__ = ["zpp_nape", "ZPP_Const"];
- c.ZPP_Const.POSINF = function () {
- return Math.POSITIVE_INFINITY
- };
- c.ZPP_Const.NEGINF = function () {
- return Math.NEGATIVE_INFINITY
- };
- c.ZPP_ID = function () {};
- s["zpp_nape.ZPP_ID"] = c.ZPP_ID;
- c.ZPP_ID.__name__ = ["zpp_nape", "ZPP_ID"];
- c.ZPP_ID.Constraint = function () {
- return c.ZPP_ID._Constraint++
- };
- c.ZPP_ID.Interactor = function () {
- return c.ZPP_ID._Interactor++
- };
- c.ZPP_ID.CbType =
- function () {
- return c.ZPP_ID._CbType++
- };
- c.ZPP_ID.CbSet = function () {
- return c.ZPP_ID._CbSet++
- };
- c.ZPP_ID.Listener = function () {
- return c.ZPP_ID._Listener++
- };
- c.ZPP_ID.ZPP_SimpleVert = function () {
- return c.ZPP_ID._ZPP_SimpleVert++
- };
- c.ZPP_ID.ZPP_SimpleSeg = function () {
- return c.ZPP_ID._ZPP_SimpleSeg++
- };
- c.ZPP_ID.Space = function () {
- return c.ZPP_ID._Space++
- };
- c.ZPP_ID.InteractionGroup = function () {
- return c.ZPP_ID._InteractionGroup++
- };
- c.callbacks = {};
- c.callbacks.ZPP_Callback = function () {
- this.body = this.constraint = null;
- this.pre_swapped = !1;
- this.int1 = this.int2 = this.set = this.wrap_arbiters = this.pre_arbiter = null;
- this.length = 0;
- this.next = this.prev = null;
- this.index = 0;
- this.listener = this.space = null;
- this.event = 0;
- this.outer_body = this.outer_con = this.outer_int = null;
- this.length = 0
- };
- s["zpp_nape.callbacks.ZPP_Callback"] = c.callbacks.ZPP_Callback;
- c.callbacks.ZPP_Callback.__name__ = ["zpp_nape", "callbacks", "ZPP_Callback"];
- c.callbacks.ZPP_Callback.prototype = {
- genarbs: function () {
- 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;
- this.wrap_arbiters.zpp_inner.zip_length = !0;
- this.wrap_arbiters.zpp_inner.at_ite = null
- },
- alloc: function () {},
- free: function () {
- this.listener = this.constraint = this.body = this.int1 = this.int2 = null;
- null != this.wrap_arbiters && (this.wrap_arbiters.zpp_inner.inner = null);
- this.set = null
- },
- rev_at: function (a) {
- for (var b = this.prev; 0 != a--;) b = b.prev;
- return b
- },
- at: function (a) {
- for (var b = this.next; 0 != a--;) b = b.next;
- return b
- },
- cyclePrev: function (a) {
- return null == a.prev ? this.prev :
- a.prev
- },
- cycleNext: function (a) {
- return null == a.next ? this.next : a.next
- },
- rotateR: function () {
- this.push_rev(this.pop_rev())
- },
- rotateL: function () {
- this.push(this.pop())
- },
- splice: function (a) {
- var b = a.next;
- 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);
- this.length--;
- return b
- },
- clear: function () {
- for (; !this.empty();) this.pop()
- },
- empty: function () {
- return null == this.next
- },
- pop_rev: function () {
- var a = this.prev;
- this.prev =
- a.prev;
- null == this.prev ? this.next = null : this.prev.next = null;
- this.length--;
- return a
- },
- pop: function () {
- var a = this.next;
- this.next = a.next;
- null == this.next ? this.prev = null : this.next.prev = null;
- this.length--;
- return a
- },
- push_rev: function (a) {
- null != this.next ? this.next.prev = a : this.prev = a;
- a.next = this.next;
- a.prev = null;
- this.next = a;
- this.length++
- },
- push: function (a) {
- null != this.prev ? this.prev.next = a : this.next = a;
- a.prev = this.prev;
- a.next = null;
- this.prev = a;
- this.length++
- },
- wrapper_int: function () {
- 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);
- 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;
- this.wrap_arbiters.zpp_inner.zip_length = !0;
- this.wrap_arbiters.zpp_inner.at_ite = null;
- return this.outer_int
- },
- wrapper_con: function () {
- null == this.outer_con && (c.callbacks.ZPP_Callback.internal = !0, this.outer_con = new h.callbacks.ConstraintCallback,
- c.callbacks.ZPP_Callback.internal = !1, this.outer_con.zpp_inner = this);
- return this.outer_con
- },
- wrapper_body: function () {
- 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);
- return this.outer_body
- },
- __class__: c.callbacks.ZPP_Callback
- };
- c.callbacks.ZPP_CbSet = function () {
- this.interactors = this.wrap_interactors = this.constraints = this.wrap_constraints = null;
- this.zip_conlisteners = !1;
- this.conlisteners =
- null;
- this.zip_bodylisteners = !1;
- this.bodylisteners = null;
- this.zip_listeners = !1;
- this.manager = this.cbpairs = this.listeners = null;
- this.id = 0;
- this.next = null;
- this.count = 0;
- this.cbTypes = null;
- this.cbTypes = new c.util.ZNPList_ZPP_CbType;
- this.listeners = new c.util.ZNPList_ZPP_InteractionListener;
- this.zip_listeners = !0;
- this.bodylisteners = new c.util.ZNPList_ZPP_BodyListener;
- this.zip_bodylisteners = !0;
- this.conlisteners = new c.util.ZNPList_ZPP_ConstraintListener;
- this.zip_conlisteners = !0;
- this.constraints = new c.util.ZNPList_ZPP_Constraint;
- this.interactors = new c.util.ZNPList_ZPP_Interactor;
- this.id = c.ZPP_ID.CbSet();
- this.cbpairs = new c.util.ZNPList_ZPP_CbSetPair
- };
- s["zpp_nape.callbacks.ZPP_CbSet"] = c.callbacks.ZPP_CbSet;
- c.callbacks.ZPP_CbSet.__name__ = ["zpp_nape", "callbacks", "ZPP_CbSet"];
- c.callbacks.ZPP_CbSet.setlt = function (a, b) {
- for (var d = a.cbTypes.head, c = b.cbTypes.head; null != d && null != c;) {
- var e = d.elt,
- f = c.elt;
- if (e.id < f.id) return !0;
- if (f.id < e.id) return !1;
- d = d.next;
- c = c.next
- }
- return null != c && null == d
- };
- c.callbacks.ZPP_CbSet.get = function (a) {
- var b;
- 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);
- null;
- var d = null;
- for (a = a.head; null != a;) {
- var g = a.elt,
- d = b.cbTypes.insert(d, g);
- g.cbsets.add(b);
- a = a.next
- }
- return b
- };
- c.callbacks.ZPP_CbSet.compatible = function (a, b, d) {
- return a.options1.compatible(b.cbTypes) && a.options2.compatible(d.cbTypes) || a.options2.compatible(b.cbTypes) && a.options1.compatible(d.cbTypes)
- };
- c.callbacks.ZPP_CbSet.empty_intersection = function (a,
- b) {
- return null == a.manager.pair(a, b).listeners.head
- };
- c.callbacks.ZPP_CbSet.single_intersection = function (a, b, d) {
- return a.manager.pair(a, b).single_intersection(d)
- };
- c.callbacks.ZPP_CbSet.find_all = function (a, b, d, c) {
- a.manager.pair(a, b).forall(d, c)
- };
- c.callbacks.ZPP_CbSet.prototype = {
- alloc: function () {},
- free: function () {
- this.listeners.clear();
- this.zip_listeners = !0;
- this.bodylisteners.clear();
- this.zip_bodylisteners = !0;
- this.conlisteners.clear();
- for (this.zip_conlisteners = !0; null != this.cbTypes.head;) this.cbTypes.pop_unsafe().cbsets.remove(this)
- },
- remInteractor: function (a) {
- this.interactors.remove(a)
- },
- remConstraint: function (a) {
- this.constraints.remove(a)
- },
- addInteractor: function (a) {
- this.interactors.add(a)
- },
- addConstraint: function (a) {
- this.constraints.add(a)
- },
- validate: function () {
- this.zip_listeners && (this.zip_listeners = !1, this.realvalidate_listeners());
- this.zip_bodylisteners && (this.zip_bodylisteners = !1, this.realvalidate_bodylisteners());
- this.zip_conlisteners && (this.zip_conlisteners = !1, this.realvalidate_conlisteners())
- },
- realvalidate_conlisteners: function () {
- this.conlisteners.clear();
- for (var a = this.cbTypes.head; null != a;) {
- for (var b = null, d = this.conlisteners.head, g = a.elt.conlisteners.head; null != g;) {
- var e = g.elt;
- 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)
- }
- a = a.next
- }
- },
- validate_conlisteners: function () {
- this.zip_conlisteners && (this.zip_conlisteners = !1, this.realvalidate_conlisteners())
- },
- invalidate_conlisteners: function () {
- this.zip_conlisteners = !0
- },
- realvalidate_bodylisteners: function () {
- this.bodylisteners.clear();
- for (var a = this.cbTypes.head; null != a;) {
- for (var b = null, d = this.bodylisteners.head, g = a.elt.bodylisteners.head; null != g;) {
- var e = g.elt;
- 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)
- }
- a = a.next
- }
- },
- validate_bodylisteners: function () {
- this.zip_bodylisteners && (this.zip_bodylisteners = !1, this.realvalidate_bodylisteners())
- },
- invalidate_bodylisteners: function () {
- this.zip_bodylisteners = !0
- },
- realvalidate_listeners: function () {
- this.listeners.clear();
- for (var a = this.cbTypes.head; null != a;) {
- for (var b = null, d = this.listeners.head, g = a.elt.listeners.head; null != g;) {
- var e = g.elt;
- 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)
- }
- a = a.next
- }
- },
- validate_listeners: function () {
- this.zip_listeners &&
- (this.zip_listeners = !1, this.realvalidate_listeners())
- },
- invalidate_listeners: function () {
- this.zip_listeners = !0;
- this.invalidate_pairs()
- },
- invalidate_pairs: function () {
- for (var a = this.cbpairs.head; null != a;) a.elt.zip_listeners = !0, a = a.next
- },
- decrement: function () {
- return 0 == --this.count
- },
- increment: function () {
- this.count++
- },
- __class__: c.callbacks.ZPP_CbSet
- };
- c.callbacks.ZPP_CbSetPair = function () {
- this.listeners = null;
- this.zip_listeners = !1;
- this.a = this.b = this.next = null;
- this.listeners = new c.util.ZNPList_ZPP_InteractionListener
- };
- s["zpp_nape.callbacks.ZPP_CbSetPair"] = c.callbacks.ZPP_CbSetPair;
- c.callbacks.ZPP_CbSetPair.__name__ = ["zpp_nape", "callbacks", "ZPP_CbSetPair"];
- c.callbacks.ZPP_CbSetPair.get = function (a, b) {
- var d;
- 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);
- d.zip_listeners = !0;
- c.callbacks.ZPP_CbSet.setlt(a, b) ? (d.a = a, d.b = b) : (d.a = b, d.b = a);
- return d
- };
- c.callbacks.ZPP_CbSetPair.setlt = function (a, b) {
- return c.callbacks.ZPP_CbSet.setlt(a.a,
- b.a) || a.a == b.a && c.callbacks.ZPP_CbSet.setlt(a.b, b.b)
- };
- c.callbacks.ZPP_CbSetPair.prototype = {
- forall: function (a, b) {
- for (var d = this.listeners.head; null != d;) {
- var c = d.elt;
- c.event == a && b(c);
- d = d.next
- }
- },
- single_intersection: function (a) {
- var b = this.listeners.head;
- return null != b && b.elt == a && null == b.next
- },
- empty_intersection: function () {
- return null == this.listeners.head
- },
- __validate: function () {
- this.listeners.clear();
- for (var a = this.a.listeners.head, b = this.b.listeners.head; null != a && null != b;) {
- var d = a.elt,
- c = b.elt;
- d == c ? ((d.options1.compatible(this.a.cbTypes) &&
- 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
- }
- },
- validate: function () {
- this.zip_listeners && (this.zip_listeners = !1, this.__validate())
- },
- invalidate: function () {
- this.zip_listeners = !0
- },
- compatible: function (a) {
- return a.options1.compatible(this.a.cbTypes) && a.options2.compatible(this.b.cbTypes) || a.options2.compatible(this.a.cbTypes) &&
- a.options1.compatible(this.b.cbTypes)
- },
- alloc: function () {
- this.zip_listeners = !0
- },
- free: function () {
- this.a = this.b = null;
- this.listeners.clear()
- },
- __class__: c.callbacks.ZPP_CbSetPair
- };
- c.util = {};
- c.util.ZNPList_ZPP_InteractionListener = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_InteractionListener"] = c.util.ZNPList_ZPP_InteractionListener;
- c.util.ZNPList_ZPP_InteractionListener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_InteractionListener"];
- c.util.ZNPList_ZPP_InteractionListener.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a =
- this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_InteractionListener.zpp_pool;
- c.util.ZNPNode_ZPP_InteractionListener.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_InteractionListener.zpp_pool;
- c.util.ZNPNode_ZPP_InteractionListener.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a,
- b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_InteractionListener
- };
- c.util.ZNPList_ZPP_BodyListener =
- function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_BodyListener"] = c.util.ZNPList_ZPP_BodyListener;
- c.util.ZNPList_ZPP_BodyListener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_BodyListener"];
- c.util.ZNPList_ZPP_BodyListener.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_BodyListener.zpp_pool;
- c.util.ZNPNode_ZPP_BodyListener.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null,
- d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_BodyListener.zpp_pool;
- c.util.ZNPNode_ZPP_BodyListener.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next =
- d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_BodyListener
- };
- c.util.ZNPList_ZPP_ConstraintListener = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_ConstraintListener"] = c.util.ZNPList_ZPP_ConstraintListener;
- c.util.ZNPList_ZPP_ConstraintListener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_ConstraintListener"];
- c.util.ZNPList_ZPP_ConstraintListener.prototype = {
- at: function (a) {
- a =
- this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head,
- b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool;
- c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool;
- c.util.ZNPNode_ZPP_ConstraintListener.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a,
- b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_ConstraintListener
- };
- c.util.ZNPList_ZPP_Constraint =
- function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Constraint"] = c.util.ZNPList_ZPP_Constraint;
- c.util.ZNPList_ZPP_Constraint.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Constraint"];
- c.util.ZNPList_ZPP_Constraint.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Constraint.zpp_pool;
- c.util.ZNPNode_ZPP_Constraint.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d =
- this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Constraint.zpp_pool;
- c.util.ZNPNode_ZPP_Constraint.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod =
- this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Constraint
- };
- c.util.ZNPList_ZPP_Interactor = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Interactor"] = c.util.ZNPList_ZPP_Interactor;
- c.util.ZNPList_ZPP_Interactor.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Interactor"];
- c.util.ZNPList_ZPP_Interactor.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Interactor.zpp_pool;
- c.util.ZNPNode_ZPP_Interactor.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Interactor.zpp_pool;
- c.util.ZNPNode_ZPP_Interactor.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_ZPP_Interactor.zpp_pool ? d = new c.util.ZNPNode_ZPP_Interactor : (d =
- c.util.ZNPNode_ZPP_Interactor.zpp_pool, c.util.ZNPNode_ZPP_Interactor.zpp_pool = d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_Interactor.zpp_pool ? b = new c.util.ZNPNode_ZPP_Interactor : (b = c.util.ZNPNode_ZPP_Interactor.zpp_pool,
- c.util.ZNPNode_ZPP_Interactor.zpp_pool = b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Interactor
- };
- c.util.ZNPList_ZPP_CbSet = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_CbSet"] = c.util.ZNPList_ZPP_CbSet;
- c.util.ZNPList_ZPP_CbSet.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CbSet"];
- c.util.ZNPList_ZPP_CbSet.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CbSet.zpp_pool;
- c.util.ZNPNode_ZPP_CbSet.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head,
- c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CbSet.zpp_pool;
- c.util.ZNPNode_ZPP_CbSet.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a,
- b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_CbSet.zpp_pool ? b = new c.util.ZNPNode_ZPP_CbSet :
- (b = c.util.ZNPNode_ZPP_CbSet.zpp_pool, c.util.ZNPNode_ZPP_CbSet.zpp_pool = b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_CbSet
- };
- c.callbacks.ZPP_CbType = function () {
- this.cbsets = this.listeners = this.bodylisteners = this.conlisteners = null;
- this.id = 0;
- this.outer = this.userData = null;
- this.id =
- c.ZPP_ID.CbType();
- this.listeners = new c.util.ZNPList_ZPP_InteractionListener;
- this.bodylisteners = new c.util.ZNPList_ZPP_BodyListener;
- this.conlisteners = new c.util.ZNPList_ZPP_ConstraintListener;
- this.constraints = new c.util.ZNPList_ZPP_Constraint;
- this.interactors = new c.util.ZNPList_ZPP_Interactor;
- this.cbsets = new c.util.ZNPList_ZPP_CbSet
- };
- s["zpp_nape.callbacks.ZPP_CbType"] = c.callbacks.ZPP_CbType;
- c.callbacks.ZPP_CbType.__name__ = ["zpp_nape", "callbacks", "ZPP_CbType"];
- c.callbacks.ZPP_CbType.setlt = function (a,
- b) {
- return a.id < b.id
- };
- c.callbacks.ZPP_CbType.prototype = {
- invalidateconstraint: function () {
- for (var a = this.cbsets.head; null != a;) a.elt.zip_conlisteners = !0, a = a.next
- },
- removeconstraint: function (a) {
- this.conlisteners.remove(a);
- this.invalidateconstraint()
- },
- addconstraint: function (a) {
- for (var b = null, d = this.conlisteners.head; null != d;) {
- var c = d.elt;
- if (a.precedence > c.precedence || a.precedence == c.precedence && a.id > c.id) break;
- b = d;
- d = d.next
- }
- this.conlisteners.inlined_insert(b, a);
- this.invalidateconstraint()
- },
- invalidatebody: function () {
- for (var a =
- this.cbsets.head; null != a;) a.elt.zip_bodylisteners = !0, a = a.next
- },
- removebody: function (a) {
- this.bodylisteners.remove(a);
- this.invalidatebody()
- },
- addbody: function (a) {
- for (var b = null, d = this.bodylisteners.head; null != d;) {
- var c = d.elt;
- if (a.precedence > c.precedence || a.precedence == c.precedence && a.id > c.id) break;
- b = d;
- d = d.next
- }
- this.bodylisteners.inlined_insert(b, a);
- this.invalidatebody()
- },
- invalidateint: function () {
- for (var a = this.cbsets.head; null != a;) {
- var b = a.elt;
- b.zip_listeners = !0;
- b.invalidate_pairs();
- a = a.next
- }
- },
- removeint: function (a) {
- this.listeners.remove(a);
- this.invalidateint()
- },
- addint: function (a) {
- for (var b = null, d = this.listeners.head; null != d;) {
- var c = d.elt;
- if (a.precedence > c.precedence || a.precedence == c.precedence && a.id > c.id) break;
- b = d;
- d = d.next
- }
- this.listeners.inlined_insert(b, a);
- this.invalidateint()
- },
- remInteractor: function (a) {
- this.interactors.remove(a)
- },
- remConstraint: function (a) {
- this.constraints.remove(a)
- },
- addInteractor: function (a) {
- this.interactors.add(a)
- },
- addConstraint: function (a) {
- this.constraints.add(a)
- },
- __class__: c.callbacks.ZPP_CbType
- };
- c.util.ZPP_Flags =
- function () {};
- s["zpp_nape.util.ZPP_Flags"] = c.util.ZPP_Flags;
- c.util.ZPP_Flags.__name__ = ["zpp_nape", "util", "ZPP_Flags"];
- c.callbacks.ZPP_Listener = function () {
- this.body = this.constraint = this.interaction = this.space = null;
- this.id = this.type = this.event = this.precedence = 0;
- this.outer = null;
- this.id = c.ZPP_ID.Listener()
- };
- s["zpp_nape.callbacks.ZPP_Listener"] = c.callbacks.ZPP_Listener;
- c.callbacks.ZPP_Listener.__name__ = ["zpp_nape", "callbacks", "ZPP_Listener"];
- c.callbacks.ZPP_Listener.setlt = function (a, b) {
- return a.precedence >
- b.precedence || a.precedence == b.precedence && a.id > b.id
- };
- c.callbacks.ZPP_Listener.prototype = {
- removedFromSpace: function () {},
- addedToSpace: function () {},
- invalidate_precedence: function () {},
- swapEvent: function (a) {},
- __class__: c.callbacks.ZPP_Listener
- };
- c.callbacks.ZPP_BodyListener = function (a, b, d) {
- this.outer_zn = this.options = this.handler = null;
- c.callbacks.ZPP_Listener.call(this);
- this.event = b;
- this.handler = d;
- this.body = this;
- this.type = c.util.ZPP_Flags.id_ListenerType_BODY;
- this.options = a.zpp_inner
- };
- s["zpp_nape.callbacks.ZPP_BodyListener"] =
- c.callbacks.ZPP_BodyListener;
- c.callbacks.ZPP_BodyListener.__name__ = ["zpp_nape", "callbacks", "ZPP_BodyListener"];
- c.callbacks.ZPP_BodyListener.__super__ = c.callbacks.ZPP_Listener;
- c.callbacks.ZPP_BodyListener.prototype = I(c.callbacks.ZPP_Listener.prototype, {
- swapEvent: function (a) {
- 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";
- this.removedFromSpace();
- this.event = a;
- this.addedToSpace()
- },
- invalidate_precedence: function () {
- null !=
- this.space && (this.removedFromSpace(), this.addedToSpace())
- },
- cbtype_change: function (a, b, d) {
- this.removedFromSpace();
- this.options.effect_change(a, b, d);
- this.addedToSpace()
- },
- removedFromSpace: function () {
- for (var a = this.options.includes.head; null != a;) {
- var b = a.elt;
- b.bodylisteners.remove(this);
- b.invalidatebody();
- a = a.next
- }
- this.options.handler = null
- },
- addedToSpace: function () {
- this.options.handler = A(this, this.cbtype_change);
- for (var a = this.options.includes.head; null != a;) a.elt.addbody(this), a = a.next
- },
- immutable_options: function () {
- if (null !=
- this.space && this.space.midstep) throw "Error: Cannot change listener type options during space.step()";
- },
- __class__: c.callbacks.ZPP_BodyListener
- });
- c.callbacks.ZPP_ConstraintListener = function (a, b, d) {
- this.outer_zn = this.options = this.handler = null;
- c.callbacks.ZPP_Listener.call(this);
- this.event = b;
- this.handler = d;
- this.constraint = this;
- this.type = c.util.ZPP_Flags.id_ListenerType_CONSTRAINT;
- this.options = a.zpp_inner
- };
- s["zpp_nape.callbacks.ZPP_ConstraintListener"] = c.callbacks.ZPP_ConstraintListener;
- c.callbacks.ZPP_ConstraintListener.__name__ = ["zpp_nape", "callbacks", "ZPP_ConstraintListener"];
- c.callbacks.ZPP_ConstraintListener.__super__ = c.callbacks.ZPP_Listener;
- c.callbacks.ZPP_ConstraintListener.prototype = I(c.callbacks.ZPP_Listener.prototype, {
- swapEvent: function (a) {
- 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";
- this.removedFromSpace();
- this.event = a;
- this.addedToSpace()
- },
- invalidate_precedence: function () {
- null !=
- this.space && (this.removedFromSpace(), this.addedToSpace())
- },
- cbtype_change: function (a, b, d) {
- this.removedFromSpace();
- this.options.effect_change(a, b, d);
- this.addedToSpace()
- },
- removedFromSpace: function () {
- for (var a = this.options.includes.head; null != a;) {
- var b = a.elt;
- b.conlisteners.remove(this);
- b.invalidateconstraint();
- a = a.next
- }
- this.options.handler = null
- },
- addedToSpace: function () {
- this.options.handler = A(this, this.cbtype_change);
- for (var a = this.options.includes.head; null != a;) a.elt.addconstraint(this), a = a.next
- },
- immutable_options: function () {
- if (null !=
- this.space && this.space.midstep) throw "Error: Cannot change listener type options during space.step()";
- },
- __class__: c.callbacks.ZPP_ConstraintListener
- });
- c.util.ZNPList_ZPP_CbType = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_CbType"] = c.util.ZNPList_ZPP_CbType;
- c.util.ZNPList_ZPP_CbType.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CbType"];
- c.util.ZNPList_ZPP_CbType.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b =
- this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CbType.zpp_pool;
- c.util.ZNPNode_ZPP_CbType.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CbType.zpp_pool;
- c.util.ZNPNode_ZPP_CbType.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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 =
- d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head =
- b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_CbType
- };
- c.callbacks.ZPP_InteractionListener = function (a, b, d, g) {
- this.handlerp = null;
- this.allowSleepingCallbacks = this.pure = !1;
- this.options1 = this.options2 = this.handleri = null;
- this.itype = 0;
- this.outer_zni = this.outer_znp = null;
- c.callbacks.ZPP_Listener.call(this);
- this.type = g;
- this.interaction = this;
- this.event = d;
- this.options1 = a.zpp_inner;
- this.options2 = b.zpp_inner;
- this.allowSleepingCallbacks = !1
- };
- s["zpp_nape.callbacks.ZPP_InteractionListener"] = c.callbacks.ZPP_InteractionListener;
- c.callbacks.ZPP_InteractionListener.__name__ = ["zpp_nape", "callbacks", "ZPP_InteractionListener"];
- c.callbacks.ZPP_InteractionListener.__super__ = c.callbacks.ZPP_Listener;
- c.callbacks.ZPP_InteractionListener.prototype = I(c.callbacks.ZPP_Listener.prototype, {
- swapEvent: function (a) {
- if (this.type == c.util.ZPP_Flags.id_ListenerType_PRE) throw "Error: PreListener event can only be PRE";
- 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";
- this.removedFromSpace();
- this.event = a;
- this.addedToSpace()
- },
- cbtype_change: function (a, b, d, c) {
- this.removedFromSpace();
- a.effect_change(b, d, c);
- this.addedToSpace();
- null
- },
- cbtype_change2: function (a, b, d) {
- this.cbtype_change(this.options2, a, b, d)
- },
- cbtype_change1: function (a, b, d) {
- this.cbtype_change(this.options1, a, b, d)
- },
- invalidate_precedence: function () {
- var a =
- this;
- if (null != this.space) {
- var b = this.type == c.util.ZPP_Flags.id_ListenerType_PRE;
- this.with_union(function (d) {
- d.listeners.remove(a);
- d.invalidateint();
- d.addint(a);
- if (b)
- for (d = d.interactors.head; null != d;) d.elt.wake(), d = d.next
- })
- }
- },
- removedFromSpace: function () {
- var a = this;
- this.with_uniquesets(!1);
- var b = this.type == c.util.ZPP_Flags.id_ListenerType_PRE;
- this.with_union(function (d) {
- d.listeners.remove(a);
- d.invalidateint();
- if (b)
- for (d = d.interactors.head; null != d;) d.elt.wake(), d = d.next
- });
- this.options1.handler = null;
- this.options2.handler = null
- },
- addedToSpace: function () {
- var a = this,
- b = this.type == c.util.ZPP_Flags.id_ListenerType_PRE;
- this.with_union(function (d) {
- d.addint(a);
- if (b)
- for (d = d.interactors.head; null != d;) d.elt.wake(), d = d.next
- });
- this.options1.handler = A(this, this.cbtype_change1);
- this.options2.handler = A(this, this.cbtype_change2);
- this.with_uniquesets(!0)
- },
- with_union: function (a) {
- for (var b = this.options1.includes.head, d = this.options2.includes.head; null != b && null != d;) {
- var c = b.elt,
- e = d.elt;
- c == e ? (a(c), b = b.next, d = d.next) :
- c.id < e.id ? (a(c), b = b.next) : (a(e), d = d.next)
- }
- for (; null != b;) a(b.elt), b = b.next;
- for (; null != d;) a(d.elt), d = d.next
- },
- with_uniquesets: function (a) {
- var b = this,
- d;
- 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);
- null;
- d.lt = c.callbacks.ZPP_CbSetPair.setlt;
- this.CbTypeset(this.options1.includes, this.options2.includes, function (a, g) {
- b.CbSetset(a.cbsets, g.cbsets, function (a, e) {
- a.validate();
- e.validate();
- c.callbacks.ZPP_CbSet.single_intersection(a, e, b) && d.try_insert(c.callbacks.ZPP_CbSetPair.get(a, e))
- })
- });
- d.clear_with(function (d) {
- a ? b.space.freshListenerType(d.a, d.b) : b.space.nullListenerType(d.a, d.b);
- d.a = d.b = null;
- d.listeners.clear();
- d.next = c.callbacks.ZPP_CbSetPair.zpp_pool;
- c.callbacks.ZPP_CbSetPair.zpp_pool = d
- });
- var g = d;
- g.data = null;
- g.lt = null;
- g.swapped = null;
- g.next = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool;
- c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = g
- },
- CbTypeset: function (a, b, d) {
- var g = c.callbacks.ZPP_InteractionListener.UCbType,
- e = c.callbacks.ZPP_InteractionListener.VCbType,
- f = c.callbacks.ZPP_InteractionListener.WCbType;
- a = a.head;
- for (var l = b.head; null != a && null != l;) {
- var m = a.elt,
- h = l.elt;
- 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)
- }
- for (; null != a;) g.inlined_add(a.elt), a = a.next;
- for (; null != l;) e.inlined_add(l.elt), l = l.next;
- for (; null != g.head;)
- for (a = g.pop_unsafe(), l = b.head; null != l;) m = l.elt, d(a, m), l = l.next;
- for (; null != e.head;)
- for (a = e.pop_unsafe(), l = f.head; null != l;) m = l.elt,
- d(a, m), l = l.next;
- for (; null != f.head;)
- for (a = f.pop_unsafe(), d(a, a), l = f.head; null != l;) m = l.elt, d(a, m), l = l.next
- },
- CbSetset: function (a, b, d) {
- var g = c.callbacks.ZPP_InteractionListener.UCbSet,
- e = c.callbacks.ZPP_InteractionListener.VCbSet,
- f = c.callbacks.ZPP_InteractionListener.WCbSet;
- a = a.head;
- for (var l = b.head; null != a && null != l;) {
- var m = a.elt,
- h = l.elt;
- 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)
- }
- for (; null != a;) g.inlined_add(a.elt),
- a = a.next;
- for (; null != l;) e.inlined_add(l.elt), l = l.next;
- for (; null != g.head;)
- for (a = g.pop_unsafe(), l = b.head; null != l;) m = l.elt, d(a, m), l = l.next;
- for (; null != e.head;)
- for (a = e.pop_unsafe(), l = f.head; null != l;) m = l.elt, d(a, m), l = l.next;
- for (; null != f.head;)
- for (a = f.pop_unsafe(), d(a, a), l = f.head; null != l;) m = l.elt, d(a, m), l = l.next
- },
- wake: function () {
- this.with_union(function (a) {
- for (a = a.interactors.head; null != a;) a.elt.wake(), a = a.next
- })
- },
- setInteractionType: function (a) {
- this.itype = a
- },
- __class__: c.callbacks.ZPP_InteractionListener
- });
- c.callbacks.ZPP_OptionType = function () {
- this.outer = this.handler = this.includes = this.excludes = this.wrap_includes = this.wrap_excludes = null;
- this.includes = new c.util.ZNPList_ZPP_CbType;
- this.excludes = new c.util.ZNPList_ZPP_CbType
- };
- s["zpp_nape.callbacks.ZPP_OptionType"] = c.callbacks.ZPP_OptionType;
- c.callbacks.ZPP_OptionType.__name__ = ["zpp_nape", "callbacks", "ZPP_OptionType"];
- c.callbacks.ZPP_OptionType.argument = function (a) {
- return null == a ? new h.callbacks.OptionType : F.Boot.__instanceof(a, h.callbacks.OptionType) ?
- a : (new h.callbacks.OptionType).including(a)
- };
- c.callbacks.ZPP_OptionType.prototype = {
- append: function (a, b) {
- if (null == b) throw "Error: Cannot append null, only CbType and CbType list values";
- if (F.Boot.__instanceof(b, h.callbacks.CbType)) {
- var d;
- this.append_type(a, b.zpp_inner)
- } else if (F.Boot.__instanceof(b, h.callbacks.CbTypeList)) {
- var c = b;
- c.zpp_inner.valmod();
- for (c = h.callbacks.CbTypeIterator.get(c); c.hasNext();) d = c.next(), this.append_type(a, d.zpp_inner)
- } else if (F.Boot.__instanceof(b, Array))
- for (var c = b, e = 0; e <
- c.length;) {
- d = c[e];
- ++e;
- if (!F.Boot.__instanceof(d, h.callbacks.CbType)) throw "Error: Cannot append non-CbType or CbType list value";
- this.append_type(a, d.zpp_inner)
- } else throw "Error: Cannot append non-CbType or CbType list value";
- },
- set: function (a) {
- if (a != this) {
- for (; null != this.includes.head;) this.append_type(this.excludes, this.includes.head.elt);
- for (; null != this.excludes.head;) this.append_type(this.includes, this.excludes.head.elt);
- for (var b = a.excludes.head; null != b;) {
- var d = b.elt;
- this.append_type(this.excludes,
- d);
- b = b.next
- }
- for (b = a.includes.head; null != b;) d = b.elt, this.append_type(this.includes, d), b = b.next
- }
- return this
- },
- append_type: function (a, b) {
- 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))
- },
- effect_change: function (a, b, d) {
- if (b)
- if (d) {
- b = null;
- for (d = this.includes.head; null != d;) {
- var c = d.elt;
- if (a.id < c.id) break;
- b = d;
- d = d.next
- }
- this.includes.inlined_insert(b, a)
- } else this.includes.remove(a);
- else if (d) {
- b = null;
- for (d = this.excludes.head; null != d;) {
- c = d.elt;
- if (a.id < c.id) break;
- b = d;
- d = d.next
- }
- this.excludes.inlined_insert(b, a)
- } else this.excludes.remove(a)
- },
- nonemptyintersection: function (a, b) {
- for (var d = !1, c = a.head, e = b.head; null != e && null != c;) {
- var f = e.elt,
- l = c.elt;
- if (f == l) {
- d = !0;
- break
- } else f.id < l.id ? e = e.next :
- c = c.next
- }
- return d
- },
- compatible: function (a) {
- return this.nonemptyintersection(a, this.includes) && !this.nonemptyintersection(a, this.excludes)
- },
- included: function (a) {
- return this.nonemptyintersection(a, this.includes)
- },
- excluded: function (a) {
- return this.nonemptyintersection(a, this.excludes)
- },
- setup_excludes: function () {
- this.wrap_excludes = c.util.ZPP_CbTypeList.get(this.excludes, !0)
- },
- setup_includes: function () {
- this.wrap_includes = c.util.ZPP_CbTypeList.get(this.includes, !0)
- },
- __class__: c.callbacks.ZPP_OptionType
- };
- c.constraint = {};
- c.constraint.ZPP_Constraint = function () {
- this.pre_dt = 0;
- this.cbTypes = this.cbSet = this.wrap_cbTypes = null;
- this.ignore = this.__velocity = !1;
- this.component = null;
- this.breakUnderForce = this.breakUnderError = this.removeOnBreak = !1;
- this.frequency = this.damping = this.maxForce = this.maxError = 0;
- this.active = this.stiff = !1;
- this.userData = this.compound = this.space = null;
- this.id = 0;
- this.outer = null;
- this.__velocity = !1;
- this.id = c.ZPP_ID.Constraint();
- this.active = this.stiff = !0;
- this.ignore = !1;
- this.frequency = 10;
- this.damping = 1;
- this.maxError =
- this.maxForce = Math.POSITIVE_INFINITY;
- this.breakUnderForce = !1;
- this.removeOnBreak = !0;
- this.pre_dt = -1;
- this.cbTypes = new c.util.ZNPList_ZPP_CbType
- };
- s["zpp_nape.constraint.ZPP_Constraint"] = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_Constraint.__name__ = ["zpp_nape", "constraint", "ZPP_Constraint"];
- c.constraint.ZPP_Constraint.prototype = {
- copyto: function (a) {
- var b = this.outer;
- null == b.zpp_inner.wrap_cbTypes && b.zpp_inner.setupcbTypes();
- for (var d = b.zpp_inner.wrap_cbTypes.iterator(); d.hasNext();) {
- var c = d.next();
- null ==
- a.zpp_inner.wrap_cbTypes && a.zpp_inner.setupcbTypes();
- a.zpp_inner.wrap_cbTypes.add(c)
- }
- a.zpp_inner.removeOnBreak = b.zpp_inner.removeOnBreak;
- a.zpp_inner.removeOnBreak;
- a.set_breakUnderError(b.zpp_inner.breakUnderError);
- a.set_breakUnderForce(b.zpp_inner.breakUnderForce);
- a.set_maxError(b.zpp_inner.maxError);
- a.set_maxForce(b.zpp_inner.maxForce);
- a.set_damping(b.zpp_inner.damping);
- a.set_frequency(b.zpp_inner.frequency);
- a.set_stiff(b.zpp_inner.stiff);
- a.set_ignore(b.zpp_inner.ignore);
- a.set_active(b.zpp_inner.active)
- },
- copy: function (a, b) {
- return null
- },
- draw: function (a) {},
- wake: function () {
- null != this.space && this.space.wake_constraint(this)
- },
- applyImpulsePos: function () {
- return !1
- },
- applyImpulseVel: function () {
- return !1
- },
- preStep: function (a) {
- return !1
- },
- warmStart: function () {},
- broken: function () {},
- pair_exists: function (a, b) {
- return !1
- },
- forest: function () {},
- wake_connected: function () {},
- validate: function () {},
- clearcache: function () {},
- inactiveBodies: function () {},
- activeBodies: function () {},
- inactiveOrOutSpace: function () {
- this.dealloc_cbSet();
- var a = this.component;
- a.body = null;
- a.constraint = null;
- null;
- a.next = c.space.ZPP_Component.zpp_pool;
- c.space.ZPP_Component.zpp_pool = a;
- this.component = null
- },
- activeInSpace: function () {
- this.alloc_cbSet();
- 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);
- null;
- this.component.isBody = !1;
- this.component.constraint = this
- },
- removedFromSpace: function () {
- this.active && this.inactiveOrOutSpace();
- this.inactiveBodies();
- for (var a = this.cbTypes.head; null != a;) a.elt.constraints.remove(this), a = a.next
- },
- addedToSpace: function () {
- this.active && this.activeInSpace();
- this.activeBodies();
- for (var a = this.cbTypes.head; null != a;) a.elt.constraints.add(this), a = a.next
- },
- deactivate: function () {
- null != this.space && this.inactiveOrOutSpace()
- },
- activate: function () {
- null != this.space && this.activeInSpace()
- },
- dealloc_cbSet: function () {
- if (null != this.cbSet) {
- this.cbSet.constraints.remove(this);
- if (0 == --this.cbSet.count) {
- this.space.cbsets.remove(this.cbSet);
- var a = this.cbSet;
- a.free();
- a.next = c.callbacks.ZPP_CbSet.zpp_pool;
- c.callbacks.ZPP_CbSet.zpp_pool = a
- }
- this.cbSet = null
- }
- },
- alloc_cbSet: function () {
- null != (this.cbSet = this.space.cbsets.get(this.cbTypes)) && (this.cbSet.count++, this.cbSet.constraints.add(this))
- },
- insert_cbtype: function (a) {
- if (!this.cbTypes.has(a)) {
- null != this.space && (this.dealloc_cbSet(), a.constraints.add(this));
- for (var b = null, d = this.cbTypes.head; null != d && !(a.id < d.elt.id);) b = d, d = d.next;
- this.cbTypes.inlined_insert(b, a);
- null != this.space && (this.alloc_cbSet(),
- this.wake())
- }
- },
- wrap_cbTypes_adder: function (a) {
- this.insert_cbtype(a.zpp_inner);
- return !1
- },
- wrap_cbTypes_subber: function (a) {
- a = a.zpp_inner;
- 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()))
- },
- immutable_cbTypes: function () {
- this.immutable_midstep("Constraint::cbTypes")
- },
- setupcbTypes: function () {
- this.wrap_cbTypes = c.util.ZPP_CbTypeList.get(this.cbTypes);
- this.wrap_cbTypes.zpp_inner.adder = A(this, this.wrap_cbTypes_adder);
- this.wrap_cbTypes.zpp_inner.subber = A(this, this.wrap_cbTypes_subber);
- this.wrap_cbTypes.zpp_inner.dontremove = !0;
- this.wrap_cbTypes.zpp_inner._modifiable = A(this, this.immutable_cbTypes)
- },
- immutable_midstep: function (a) {
- if (null != this.space && this.space.midstep) throw "Error: Constraint::" + a + " cannot be set during space step()";
- },
- clear: function () {},
- __class__: c.constraint.ZPP_Constraint
- };
- c.constraint.ZPP_AngleJoint = function () {
- this.stepped = !1;
- this.kMass = this.jAcc = this.jMax = this.gamma = this.bias = 0;
- this.b1 = this.b2 =
- null;
- this.scale = 0;
- this.slack = this.equal = !1;
- this.ratio = this.jointMin = this.jointMax = 0;
- this.outer_zn = null;
- c.constraint.ZPP_Constraint.call(this);
- this.ratio = 1;
- this.jAcc = 0;
- this.slack = !1;
- this.jMax = Math.POSITIVE_INFINITY;
- this.stepped = !1
- };
- s["zpp_nape.constraint.ZPP_AngleJoint"] = c.constraint.ZPP_AngleJoint;
- c.constraint.ZPP_AngleJoint.__name__ = ["zpp_nape", "constraint", "ZPP_AngleJoint"];
- c.constraint.ZPP_AngleJoint.__super__ = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_AngleJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- draw: function (a) {
- var b = this.outer_zn,
- d = 5 / Math.PI / 2;
- 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) {
- 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,
- e = b.zpp_inner_zn.ratio * (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - this.jointMax;
- if (g > e) var f = g,
- g = e,
- e = f;
- (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot >
- g ? (f = function (a) {
- a = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot;
- var d = e;
- return a < d ? a : d
- }(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,
- 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);
- (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot < e ? (f = function (a) {
- a = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot;
- var d = g;
- return a > d ? a : d
- }(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 >
- 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);
- 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 -
- g) * d, 255)
- }(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) {
- a = (null == b.zpp_inner_zn.b2 ?
- null : b.zpp_inner_zn.b2.outer).zpp_inner.rot;
- var d = e;
- return a < d ? a : d
- }(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 ==
- 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) {
- a = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot;
- var d = g;
- return a > d ? a : d
- }(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 >
- 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 -
- g) * d, 16711680))
- },
- applyImpulsePos: function () {
- var a, b;
- a = this.ratio * this.b2.rot - this.b1.rot;
- 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);
- if (!b) {
- if (this.breakUnderError && a * a > this.maxError * this.maxError) return !0;
- b = -(0.5 * a) * this.kMass;
- 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)
- }
- return !1
- },
- applyImpulseVel: function () {
- if (this.slack) return !1;
- 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,
- b = this.jAcc;
- this.jAcc += a;
- !this.equal && 0 < this.jAcc && (this.jAcc = 0);
- if (this.breakUnderForce && (this.jAcc > this.jMax || this.jAcc < -this.jMax)) return !0;
- this.stiff || (this.jAcc > this.jMax ? this.jAcc = this.jMax : this.jAcc < -this.jMax && (this.jAcc = -this.jMax));
- a = this.jAcc - b;
- this.b1.angvel -= this.scale * this.b1.iinertia * a;
- this.b2.angvel +=
- this.ratio * this.scale * this.b2.iinertia * a;
- return !1
- },
- warmStart: function () {
- this.slack || (this.b1.angvel -= this.scale * this.b1.iinertia * this.jAcc, this.b2.angvel += this.ratio * this.scale * this.b2.iinertia * this.jAcc)
- },
- preStep: function (a) {
- -1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.stepped = !0;
- this.equal = this.jointMin == this.jointMax;
- var d = function (a) {
- var b = a.ratio * a.b2.rot - a.b1.rot;
- 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 ?
- (b -= a.jointMax, a.scale = 1, a.slack = !1) : (b = a.scale = 0, a.slack = !0);
- return b
- }(this);
- if (!this.slack) {
- this.kMass = this.b1.sinertia + this.ratio * this.ratio * this.b2.sinertia;
- 0 != this.kMass ? this.kMass = 1 / this.kMass : this.jAcc = 0;
- if (this.stiff) this.gamma = this.bias = 0;
- else {
- if (this.breakUnderError && d * d > this.maxError * this.maxError) return !0;
- var c;
- this.kMass *= function (b) {
- var d = 2 * Math.PI * b.frequency;
- b.gamma = 1 / (a * d * (2 * b.damping + d * a));
- var l = 1 / (1 + b.gamma);
- c = a * d * d * b.gamma;
- b.gamma *= l;
- return l
- }(this);
- this.bias = -d * c;
- this.bias < -this.maxError ?
- this.bias = -this.maxError : this.bias > this.maxError && (this.bias = this.maxError)
- }
- this.jAcc *= b;
- this.jMax = this.maxForce * a
- }
- return !1
- },
- clearcache: function () {
- this.jAcc = 0;
- this.pre_dt = -1;
- this.slack = !1
- },
- pair_exists: function (a, b) {
- return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
- },
- forest: function () {
- if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
- a = a.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent =
- b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this);
- a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
- }
- this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
- a = a.b2.component;
- for (var b =
- null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
- },
- wake_connected: function () {
- null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
- null !=
- this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
- },
- validate: function () {
- if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
- if (this.b1 == this.b2) throw "Error: AngleJoint cannot be simulated with body1 == body2";
- 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";
- if (this.jointMin > this.jointMax) throw "Error: AngleJoint must have jointMin <= jointMax";
- 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";
- },
- copy: function (a, b) {
- var d = new h.constraint.AngleJoint(null, null, this.jointMin, this.jointMax, this.ratio);
- this.copyto(d);
- if (null != a && null != this.b1) {
- for (var g = null, e = 0; e < a.length;) {
- var f = a[e];
- ++e;
- if (f.id == this.b1.id) {
- g = f.bc;
- break
- }
- }
- null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
- d.zpp_inner_zn.b1 =
- a.zpp_inner
- }))
- }
- if (null != a && null != this.b2) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b2.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
- d.zpp_inner_zn.b2 = a.zpp_inner
- }))
- }
- return d
- },
- inactiveBodies: function () {
- null != this.b1 && this.b1.constraints.remove(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
- },
- activeBodies: function () {
- null != this.b1 && this.b1.constraints.add(this);
- this.b2 != this.b1 && null != this.b2 &&
- this.b2.constraints.add(this)
- },
- bodyImpulse: function (a) {
- 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)
- },
- is_slack: function () {
- var a, b = this.ratio * this.b2.rot - this.b1.rot;
- 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);
- b;
- return a
- },
- __class__: c.constraint.ZPP_AngleJoint
- });
- c.constraint.ZPP_AngleDraw =
- function () {};
- s["zpp_nape.constraint.ZPP_AngleDraw"] = c.constraint.ZPP_AngleDraw;
- c.constraint.ZPP_AngleDraw.__name__ = ["zpp_nape", "constraint", "ZPP_AngleDraw"];
- c.constraint.ZPP_AngleDraw.indicator = function (a, b, d, c, e) {
- d = h.geom.Vec2.get(Math.cos(d), Math.sin(d), null);
- a.drawFilledCircle(b.add(d.mul(c, !0), !0), 2, e);
- d.dispose()
- };
- c.constraint.ZPP_AngleDraw.drawSpiralSpring = function (a, b, d, g, e, f, l, m) {
- null == m && (m = 4);
- if (d > g) {
- var u = d;
- d = g;
- g = u;
- u = e;
- e = f;
- f = u
- }
- if (d != g) {
- var p = f - e,
- k = g - d;
- g = function (a) {
- a = 2 * Math.PI * p / k;
- return 0 >
- a ? -a : a
- }(this);
- f = function (a) {
- a = Math.ceil(3 * (k / c.constraint.ZPP_AngleDraw.maxarc));
- var b = 4 * m;
- return a > b ? a : b
- }(this);
- 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) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this) + q * w, function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this) +
- 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;) {
- var B = x++;
- d += r;
- var v = Math.cos(d),
- t = Math.sin(d),
- H = e + p * (B + 1) * n + 0.75 * g * Math.sin(2 * m * Math.PI * (B + 1) * n);
- q.setxy(function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this) + H * v, function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this) + H * t);
- u = p + 1.5 * m * g * Math.PI * Math.cos(2 * m * Math.PI * (B + 1) * n);
- B = u * v - H * k * t;
- H = u * t + H * k * v;
- u = z * H - w * B;
- if (u * u < h.Config.epsilon || 0 >= z * B + w * H || 0.999 < z * B + w * H) a.drawLine(s, q, l);
- else {
- var A;
- if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- q.zpp_inner.validate();
- A = q.zpp_inner.x;
- if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- s.zpp_inner.validate();
- A = (A - s.zpp_inner.x) * H;
- if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- s.zpp_inner.validate();
- var D = s.zpp_inner.y;
- if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- q.zpp_inner.validate();
- u = (A + (D - q.zpp_inner.y) * B) / u;
- 0 >= u ? a.drawLine(s, q, l) : (y.set_x(function (a) {
- if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- s.zpp_inner.validate();
- return s.zpp_inner.x
- }(this) + z * u), y.set_y(function (a) {
- if (null != s && s.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- s.zpp_inner.validate();
- return s.zpp_inner.y
- }(this) +
- w * u), a.drawCurve(s, y, q, l))
- }
- w = v;
- z = B;
- w = H;
- s.set(q)
- }
- s.dispose();
- q.dispose();
- y.dispose()
- }
- };
- c.constraint.ZPP_AngleDraw.drawSpiral = function (a, b, d, g, e, f, l) {
- if (d > g) {
- var m = d;
- d = g;
- g = m;
- m = e;
- e = f;
- f = m
- }
- if (d != g) {
- f -= e;
- g -= d;
- 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) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this) + e * r, function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(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;) {
- y++;
- e += p;
- d += k;
- var z = Math.cos(d),
- n = Math.sin(d);
- q.setxy(function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.x
- }(this) + e * z, function (a) {
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- return b.zpp_inner.y
- }(this) +
- e * n);
- var x = f * z - e * g * n,
- B = f * n + e * g * z,
- m = t * B - r * x;
- if (m * m < h.Config.epsilon) a.drawLine(w, q, l);
- else {
- if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- q.zpp_inner.validate();
- var v = q.zpp_inner.x;
- if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- w.zpp_inner.validate();
- var v = (v - w.zpp_inner.x) * B,
- H;
- if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- w.zpp_inner.validate();
- H = w.zpp_inner.y;
- if (null != q && q.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- q.zpp_inner.validate();
- m = (v + (H - q.zpp_inner.y) * x) / m;
- 0 >= m ? a.drawLine(w, q, l) : (s.set_x(function (a) {
- if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- w.zpp_inner.validate();
- return w.zpp_inner.x
- }(this) + t * m), s.set_y(function (a) {
- if (null != w && w.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- w.zpp_inner.validate();
- return w.zpp_inner.y
- }(this) + r * m), a.drawCurve(w, s, q, l))
- }
- r = z;
- t = x;
- r = B;
- w.set(q)
- }
- w.dispose();
- q.dispose();
- s.dispose()
- }
- };
- c.constraint.ZPP_CopyHelper = function () {
- this.bc =
- this.cb = null;
- this.id = 0
- };
- s["zpp_nape.constraint.ZPP_CopyHelper"] = c.constraint.ZPP_CopyHelper;
- c.constraint.ZPP_CopyHelper.__name__ = ["zpp_nape", "constraint", "ZPP_CopyHelper"];
- c.constraint.ZPP_CopyHelper.dict = function (a, b) {
- var d = new c.constraint.ZPP_CopyHelper;
- d.id = a;
- d.bc = b;
- return d
- };
- c.constraint.ZPP_CopyHelper.todo = function (a, b) {
- var d = new c.constraint.ZPP_CopyHelper;
- d.id = a;
- d.cb = b;
- return d
- };
- c.constraint.ZPP_CopyHelper.prototype = {
- __class__: c.constraint.ZPP_CopyHelper
- };
- c.constraint.ZPP_DistanceJoint = function () {
- this.stepped = !1;
- this.kMass = this.jAcc = this.jMax = this.gamma = this.bias = 0;
- this.wrap_a2 = null;
- this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
- this.wrap_a1 = this.b2 = null;
- this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
- this.b1 = null;
- this.nx = this.ny = this.cx1 = this.cx2 = 0;
- this.slack = this.equal = !1;
- this.jointMin = this.jointMax = 0;
- this.outer_zn = null;
- c.constraint.ZPP_Constraint.call(this);
- this.jAcc = this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx = 0;
- this.jMax = Math.POSITIVE_INFINITY;
- this.stepped = !1;
- this.cx1 = this.cx2 = 0
- };
- s["zpp_nape.constraint.ZPP_DistanceJoint"] = c.constraint.ZPP_DistanceJoint;
- c.constraint.ZPP_DistanceJoint.__name__ = ["zpp_nape", "constraint", "ZPP_DistanceJoint"];
- c.constraint.ZPP_DistanceJoint.__super__ = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_DistanceJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- draw: function (a) {
- var b = this.outer_zn,
- d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a1 &&
- b.zpp_inner_zn.setup_a1();
- return b.zpp_inner_zn.wrap_a1
- }(this)),
- c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
- return b.zpp_inner_zn.wrap_a2
- }(this)),
- e = c.sub(d),
- f = function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) *
- function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) + function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a))
- }(this);
- if (0 != f) {
- e.muleq(1 / f);
- var l = d.add(c).muleq(0.5),
- m = l.sub(e.mul(0.5 * this.jointMin, !0)),
- h = l.add(e.mul(0.5 * this.jointMin, !0)),
- p = l.sub(e.mul(0.5 * this.jointMax, !0)),
- k = l.add(e.mul(0.5 * this.jointMax, !0));
- a.drawLine(m, h, 16776960);
- a.drawLine(p, m, 65535);
- a.drawLine(k, h, 65535);
- 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)));
- l.dispose();
- m.dispose();
- h.dispose();
- p.dispose();
- k.dispose()
- }
- a.drawFilledCircle(d, 2, 255);
- a.drawFilledCircle(c, 2, 16711680);
- d.dispose();
- c.dispose();
- e.dispose()
- },
- applyImpulsePos: function () {
- var a,
- b, d = 0,
- c = 0,
- d = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
- c = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
- e = 0,
- f = 0,
- e = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
- f = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
- l, m = 0,
- u = 0;
- a = function (a) {
- m = a.b2.posx + e - (a.b1.posx + d);
- u = a.b2.posy + f - (a.b1.posy + c);
- var b = m * m + u * u;
- if (b < h.Config.epsilon) b = u = m = 0, l = !0;
- else {
- var b = Math.sqrt(b),
- p = 1 / b;
- m *= p;
- u *= p;
- 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)
- }
- return b
- }(this);
- if (!l) {
- if (this.breakUnderError && a * a > this.maxError * this.maxError) return !0;
- if (a * a < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
- a *= 0.5;
- 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) {
- m = a.b2.posx + e - (a.b1.posx + d);
- u = a.b2.posy + f - (a.b1.posy + c);
- var b = m * m + u * u;
- if (b < h.Config.epsilon) b =
- u = m = 0, l = !0;
- else {
- var b = Math.sqrt(b),
- p = 1 / b;
- m *= p;
- u *= p;
- 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)
- }
- return b
- }(this), a *= 0.5);
- var p, k;
- p = u * d - m * c;
- k = u * e - m * f;
- b = this.b1.smass + this.b2.smass + p * p * this.b1.sinertia + k * k * this.b2.sinertia;
- 0 != b && (b = 1 / b);
- b *= -a;
- 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 *
- this.b2.iinertia * b)
- }
- return !1
- },
- applyImpulseVel: function () {
- if (this.slack) return !1;
- 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,
- b = this.jAcc;
- this.jAcc += a;
- !this.equal && 0 < this.jAcc && (this.jAcc = 0);
- if (this.breakUnderForce && this.jAcc < -this.jMax) return !0;
- !this.stiff && this.jAcc < -this.jMax &&
- (this.jAcc = -this.jMax);
- a = this.jAcc - b;
- b = this.b1.imass * a;
- this.b1.velx -= this.nx * b;
- this.b1.vely -= this.ny * b;
- b = this.b2.imass * a;
- this.b2.velx += this.nx * b;
- this.b2.vely += this.ny * b;
- this.b1.angvel -= this.cx1 * this.b1.iinertia * a;
- this.b2.angvel += this.cx2 * this.b2.iinertia * a;
- return !1
- },
- warmStart: function () {
- if (!this.slack) {
- var a = this.b1.imass * this.jAcc;
- this.b1.velx -= this.nx * a;
- this.b1.vely -= this.ny * a;
- a = this.b2.imass * this.jAcc;
- this.b2.velx += this.nx * a;
- this.b2.vely += this.ny * a;
- this.b1.angvel -= this.cx1 * this.b1.iinertia * this.jAcc;
- this.b2.angvel += this.cx2 * this.b2.iinertia * this.jAcc
- }
- },
- preStep: function (a) {
- -1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.stepped = !0;
- this.equal = this.jointMin == this.jointMax;
- this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
- this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
- this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
- this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
- var d = function (a) {
- a.nx = a.b2.posx +
- a.a2relx - (a.b1.posx + a.a1relx);
- a.ny = a.b2.posy + a.a2rely - (a.b1.posy + a.a1rely);
- var b = a.nx * a.nx + a.ny * a.ny;
- if (b < h.Config.epsilon) a.nx = 0, b = a.ny = 0, a.slack = !0;
- else {
- var b = Math.sqrt(b),
- d = 1 / b;
- a.nx *= d;
- a.ny *= d;
- 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)
- }
- return b
- }(this);
- if (!this.slack) {
- this.cx1 = this.ny * this.a1relx - this.nx * this.a1rely;
- this.cx2 = this.ny * this.a2relx - this.nx * this.a2rely;
- this.kMass =
- this.b1.smass + this.b2.smass + this.cx1 * this.cx1 * this.b1.sinertia + this.cx2 * this.cx2 * this.b2.sinertia;
- 0 != this.kMass ? this.kMass = 1 / this.kMass : this.jAcc = 0;
- if (this.stiff) this.gamma = this.bias = 0;
- else {
- if (this.breakUnderError && d * d > this.maxError * this.maxError) return !0;
- var c;
- this.kMass *= function (b) {
- var d = 2 * Math.PI * b.frequency;
- b.gamma = 1 / (a * d * (2 * b.damping + d * a));
- var l = 1 / (1 + b.gamma);
- c = a * d * d * b.gamma;
- b.gamma *= l;
- return l
- }(this);
- this.bias = -d * c;
- this.bias < -this.maxError ? this.bias = -this.maxError : this.bias > this.maxError &&
- (this.bias = this.maxError)
- }
- this.jAcc *= b;
- this.jMax = this.maxForce * a
- }
- return !1
- },
- clearcache: function () {
- this.jAcc = 0;
- this.pre_dt = -1
- },
- pair_exists: function (a, b) {
- return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
- },
- forest: function () {
- if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
- a = a.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this);
- a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
- }
- this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
- a = a.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c =
- b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
- },
- wake_connected: function () {
- null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
- null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
- },
- validate: function () {
- if (null == this.b1 || null == this.b2) throw "Error: DistanceJoint cannot be simulated null bodies";
- if (this.b1 == this.b2) throw "Error: DistanceJoint cannot be simulated with body1 == body2";
- 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";
- if (this.jointMin > this.jointMax) throw "Error: DistanceJoint must have jointMin <= jointMax";
- 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";
- },
- copy: function (a, b) {
- var d = new h.constraint.DistanceJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2(), this.jointMin, this.jointMax);
- this.copyto(d);
- if (null != a && null != this.b1) {
- for (var g = null, e = 0; e < a.length;) {
- var f = a[e];
- ++e;
- if (f.id == this.b1.id) {
- g = f.bc;
- break
- }
- }
- null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
- d.zpp_inner_zn.b1 =
- a.zpp_inner
- }))
- }
- if (null != a && null != this.b2) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b2.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
- d.zpp_inner_zn.b2 = a.zpp_inner
- }))
- }
- return d
- },
- setup_a2: function () {
- this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
- this.wrap_a2.zpp_inner._inuse = !0;
- this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
- this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
- },
- invalidate_a2: function (a) {
- this.immutable_midstep("Constraint::a2");
- this.a2localx = a.x;
- this.a2localy = a.y;
- this.wake()
- },
- validate_a2: function () {
- this.wrap_a2.zpp_inner.x = this.a2localx;
- this.wrap_a2.zpp_inner.y = this.a2localy
- },
- setup_a1: function () {
- this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
- this.wrap_a1.zpp_inner._inuse = !0;
- this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
- this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
- },
- invalidate_a1: function (a) {
- this.immutable_midstep("Constraint::a1");
- this.a1localx = a.x;
- this.a1localy = a.y;
- this.wake()
- },
- validate_a1: function () {
- this.wrap_a1.zpp_inner.x = this.a1localx;
- this.wrap_a1.zpp_inner.y = this.a1localy
- },
- inactiveBodies: function () {
- null != this.b1 && this.b1.constraints.remove(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
- },
- activeBodies: function () {
- null != this.b1 && this.b1.constraints.add(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
- },
- bodyImpulse: function (a) {
- return this.stepped ? a == this.b1 ? h.geom.Vec3.get(-this.jAcc * this.nx, -this.jAcc * this.ny, -this.cx1 * this.jAcc) :
- h.geom.Vec3.get(this.jAcc * this.nx, this.jAcc * this.ny, this.cx2 * this.jAcc) : h.geom.Vec3.get(0, 0, 0)
- },
- is_slack: function () {
- var a;
- this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
- this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
- this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
- this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
- var b = a = 0;
- a = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx);
- b = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
- b = a * a + b * b;
- 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));
- b;
- return a
- },
- __class__: c.constraint.ZPP_DistanceJoint
- });
- c.constraint.ZPP_LineJoint = function () {
- this.kMassa = this.kMassb = this.kMassc = this.jAccx = this.jAccy = this.biasx = this.biasy = 0;
- this.wrap_n = null;
- this.nlocalx = this.nlocaly = this.nrelx = this.nrely = 0;
- this.wrap_a2 = null;
- this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
- this.wrap_a1 =
- null;
- this.dot1 = this.dot2 = this.cx1 = this.cx2 = this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
- this.equal = !1;
- this.scale = this.jointMin = this.jointMax = 0;
- this.outer_zn = null;
- c.constraint.ZPP_Constraint.call(this);
- 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;
- this.jMax = Math.POSITIVE_INFINITY;
- this.jointMin = Math.NEGATIVE_INFINITY;
- this.jointMax = Math.POSITIVE_INFINITY;
- this.stepped = !1
- };
- s["zpp_nape.constraint.ZPP_LineJoint"] = c.constraint.ZPP_LineJoint;
- c.constraint.ZPP_LineJoint.__name__ = ["zpp_nape", "constraint", "ZPP_LineJoint"];
- c.constraint.ZPP_LineJoint.__super__ = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_LineJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- draw: function (a) {
- var b = this.outer_zn,
- d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
- return b.zpp_inner_zn.wrap_a1
- }(this)),
- c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
- return b.zpp_inner_zn.wrap_a2
- }(this)),
- e = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localVectorToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_n && b.zpp_inner_zn.setup_n();
- return b.zpp_inner_zn.wrap_n
- }(this));
- e.muleq(1 / function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != e &&
- e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) + function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a))
- }(this));
- var f = b.zpp_inner_zn.jointMin,
- l = b.zpp_inner_zn.jointMax;
- f <= Math.NEGATIVE_INFINITY && (f = -1E3);
- l >= Math.POSITIVE_INFINITY && (l = 1E3);
- var m = c.sub(d),
- u = m.dot(e);
- m.dispose();
- var p = d.add(e.mul(f, !0)),
- k = d.add(e.mul(l, !0));
- u > f && a.drawLine(p, d.add(e.mul(function (a) {
- a = l;
- return u < a ? u : a
- }(this), !0), !0), 16776960);
- u < l && a.drawLine(d.add(e.mul(function (a) {
- a = f;
- return u > a ? u : a
- }(this), !0), !0), k, 65535);
- this.stiff || (m = u < this.jointMin ? function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.x
- }(a), function (a) {
- if (null != p && p.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- p.zpp_inner.validate();
- return p.zpp_inner.y
- }(a), !1)
- }(this) : u > this.jointMax ? function (a) {
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return h.geom.Vec2.get(function (a) {
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- return k.zpp_inner.x
- }(a), function (a) {
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- return k.zpp_inner.y
- }(a), !1)
- }(this) : d.add(e.mul(u, !0)), a.drawSpring(m, c, 16711935), m.dispose());
- a.drawFilledCircle(d, 2, 255);
- a.drawFilledCircle(c, 2, 16711680);
- d.dispose();
- c.dispose();
- p.dispose();
- k.dispose()
- },
- applyImpulsePos: function () {
- var a = 0,
- b = 0,
- a = this.b1.axisy * this.nlocalx - this.b1.axisx * this.nlocaly,
- b = this.nlocalx * this.b1.axisx + this.nlocaly *
- this.b1.axisy,
- d = 0,
- c = 0,
- d = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
- c = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
- e = 0,
- f = 0,
- e = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
- f = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
- l = 0,
- m = 0,
- u, p = 0,
- k = 0,
- l = this.b2.posx + e - this.b1.posx - d,
- m = this.b2.posy + f - this.b1.posy - c,
- p = m * a - l * b,
- k = a * l + b * m;
- 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;
- if (this.breakUnderError &&
- p * p + k * k > this.maxError * this.maxError) return !0;
- if (p * p + k * k < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
- var r = 0,
- n = 0,
- w = 0.5,
- p = p * w,
- k = k * w;
- 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,
- 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));
- var t = 0,
- q = 0,
- r = w = w = 0,
- w = l + d,
- r = m + c,
- d = a * w + b * r,
- l = r * a - w * b,
- c = a * e + b * f,
- e = f * a - e * b,
- t = this.b1.smass + this.b2.smass + d * d * this.b1.sinertia + c * c * this.b2.sinertia,
- q = -u * (d * l * this.b1.sinertia + c * e * this.b2.sinertia),
- w = u * u * (this.b1.smass + this.b2.smass + l * l * this.b1.sinertia + e * e * this.b2.sinertia),
- r = -p,
- n = -k,
- f = t * w - q * q;
- 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);
- 0 < n && (n = 0);
- f = u * a * n - b * r;
- a = a * r + u * b * n;
- w = this.b1.imass;
- this.b1.posx -= f * w;
- this.b1.posy -= a * w;
- w = this.b2.imass;
- this.b2.posx += f * w;
- this.b2.posy += a * w;
- this.b1.delta_rot((u * l * n - d * r) * this.b1.iinertia);
- this.b2.delta_rot((c * r - u * e * n) * this.b2.iinertia);
- return !1
- },
- applyImpulseVel: function () {
- var a = 0,
- b = 0,
- d = 0,
- c = 0,
- d = this.b2.velx - this.b1.velx,
- c = this.b2.vely - this.b1.vely,
- d = d + (this.b2.kinvelx - this.b1.kinvelx),
- c = c + (this.b2.kinvely - this.b1.kinvely),
- a = c * this.nrelx - d * this.nrely + (this.b2.angvel + this.b2.kinangvel) * this.dot2 - (this.b1.angvel + this.b1.kinangvel) * this.dot1,
- b = this.scale *
- (this.nrelx * d + this.nrely * c - (this.b2.angvel + this.b2.kinangvel) * this.cx2 + (this.b1.angvel + this.b1.kinangvel) * this.cx1),
- c = d = 0,
- d = this.biasx - a,
- c = this.biasy - b,
- a = this.kMassa * d + this.kMassb * c,
- c = this.kMassb * d + this.kMassc * c,
- d = a,
- a = this.gamma,
- d = d - this.jAccx * a,
- c = c - this.jAccy * a,
- e = b = 0,
- b = this.jAccx,
- e = this.jAccy,
- a = 1;
- this.jAccx += d * a;
- this.jAccy += c * a;
- 0 < this.jAccy && (this.jAccy = 0);
- if (this.breakUnderForce) {
- if (this.jAccx * this.jAccx + this.jAccy * this.jAccy > this.jMax * this.jMax) return !0
- } else this.stiff || (a = this.jMax, d = this.jAccx *
- this.jAccx + this.jAccy * this.jAccy, d > a * a && (d = a * (1 / Math.sqrt(d)), this.jAccx *= d, this.jAccy *= d));
- d = this.jAccx - b;
- c = this.jAccy - e;
- b = this.scale * this.nrelx * c - this.nrely * d;
- e = this.nrelx * d + this.scale * this.nrely * c;
- a = this.b1.imass;
- this.b1.velx -= b * a;
- this.b1.vely -= e * a;
- a = this.b2.imass;
- this.b2.velx += b * a;
- this.b2.vely += e * a;
- this.b1.angvel += (this.scale * this.cx1 * c - this.dot1 * d) * this.b1.iinertia;
- this.b2.angvel += (this.dot2 * d - this.scale * this.cx2 * c) * this.b2.iinertia;
- return !1
- },
- warmStart: function () {
- var a = this.scale * this.nrelx *
- this.jAccy - this.nrely * this.jAccx,
- b = this.nrelx * this.jAccx + this.scale * this.nrely * this.jAccy,
- d = this.b1.imass;
- this.b1.velx -= a * d;
- this.b1.vely -= b * d;
- d = this.b2.imass;
- this.b2.velx += a * d;
- this.b2.vely += b * d;
- this.b1.angvel += (this.scale * this.cx1 * this.jAccy - this.dot1 * this.jAccx) * this.b1.iinertia;
- this.b2.angvel += (this.dot2 * this.jAccx - this.scale * this.cx2 * this.jAccy) * this.b2.iinertia
- },
- preStep: function (a) {
- -1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.equal = this.jointMin == this.jointMax;
- this.stepped = !0;
- this.validate_norm();
- this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
- this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
- this.nrelx = this.b1.axisy * this.nlocalx - this.b1.axisx * this.nlocaly;
- this.nrely = this.nlocalx * this.b1.axisx + this.nlocaly * this.b1.axisy;
- this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
- this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
- var d = 0,
- c = 0,
- e = 0,
- f = 0,
- d = this.b2.posx + this.a2relx - this.b1.posx - this.a1relx,
- c = this.b2.posy +
- this.a2rely - this.b1.posy - this.a1rely,
- e = c * this.nrelx - d * this.nrely,
- f = this.nrelx * d + this.nrely * c;
- 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;
- var l = 0,
- m = 0,
- l = d + this.a1relx,
- m = c + this.a1rely;
- this.dot1 = this.nrelx * l + this.nrely * m;
- this.cx1 = m * this.nrelx - l * this.nrely;
- this.dot2 = this.nrelx * this.a2relx + this.nrely * this.a2rely;
- this.cx2 = this.a2rely * this.nrelx - this.a2relx * this.nrely;
- this.kMassa = this.b1.smass +
- this.b2.smass + this.dot1 * this.dot1 * this.b1.sinertia + this.dot2 * this.dot2 * this.b2.sinertia;
- this.kMassb = -this.scale * (this.dot1 * this.cx1 * this.b1.sinertia + this.dot2 * this.cx2 * this.b2.sinertia);
- 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);
- d = function (a) {
- var b = a.kMassa * a.kMassc - a.kMassb * a.kMassb;
- b != b ? (a.kMassa = a.kMassb = a.kMassc = 0, a = 3) : a = 0 == b ? function (a) {
- var b = 0;
- 0 != a.kMassa ? a.kMassa = 1 / a.kMassa : (a.kMassa = 0, b |= 1);
- 0 != a.kMassc ?
- a.kMassc = 1 / a.kMassc : (a.kMassc = 0, b |= 2);
- a.kMassb = 0;
- return b
- }(a) : function (a) {
- b = 1 / b;
- var d = a.kMassc * b;
- a.kMassc = a.kMassa * b;
- a.kMassa = d;
- a.kMassb *= -b;
- return 0
- }(a);
- return a
- }(this);
- 0 != (d & 1) && (this.jAccx = 0);
- 0 != (d & 2) && (this.jAccy = 0);
- if (this.stiff) this.biasy = this.biasx = this.gamma = 0;
- else {
- if (this.breakUnderError && e * e + f * f > this.maxError * this.maxError) return !0;
- var h, d = function (b) {
- var d = 2 * Math.PI * b.frequency;
- b.gamma = 1 / (a * d * (2 * b.damping + d * a));
- var c = 1 / (1 + b.gamma);
- h = a * d * d * b.gamma;
- b.gamma *= c;
- return c
- }(this);
- this.kMassa *=
- d;
- this.kMassb *= d;
- this.kMassc *= d;
- this.biasx = e;
- this.biasy = f;
- e = -h;
- this.biasx *= e;
- this.biasy *= e;
- e = this.maxError;
- f = this.biasx * this.biasx + this.biasy * this.biasy;
- f > e * e && (e *= 1 / Math.sqrt(f), this.biasx *= e, this.biasy *= e)
- }
- e = b;
- this.jAccx *= e;
- this.jAccy *= e;
- this.jMax = this.maxForce * a;
- return !1
- },
- clearcache: function () {
- this.jAccy = this.jAccx = 0;
- this.pre_dt = -1
- },
- pair_exists: function (a, b) {
- return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
- },
- forest: function () {
- if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var a =
- this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
- a = a.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this);
- a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
- }
- this.b2.type ==
- c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
- a = a.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent =
- a : (b.parent = a, a.rank++)))
- },
- wake_connected: function () {
- null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
- null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
- },
- validate: function () {
- if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
- if (this.b1 == this.b2) throw "Error: DistanceJoint cannot be simulated with body1 == body2";
- 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";
- if (this.jointMin > this.jointMax) throw "Error: DistanceJoint must have jointMin <= jointMax";
- if (this.nlocalx * this.nlocalx + this.nlocaly * this.nlocaly < h.Config.epsilon) throw "Error: DistanceJoint direction must be non-degenerate";
- 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";
- },
- copy: function (a, b) {
- var d = new h.constraint.LineJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2(),
- this.outer_zn.get_direction(), this.jointMin, this.jointMax);
- this.copyto(d);
- if (null != a && null != this.b1) {
- for (var g = null, e = 0; e < a.length;) {
- var f = a[e];
- ++e;
- if (f.id == this.b1.id) {
- g = f.bc;
- break
- }
- }
- null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
- d.zpp_inner_zn.b1 = a.zpp_inner
- }))
- }
- if (null != a && null != this.b2) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b2.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id,
- function (a) {
- d.zpp_inner_zn.b2 = a.zpp_inner
- }))
- }
- return d
- },
- validate_norm: function () {
- if (this.zip_n) {
- this.zip_n = !1;
- var a = 1 / Math.sqrt(this.nlocalx * this.nlocalx + this.nlocaly * this.nlocaly);
- this.nlocalx *= a;
- this.nlocaly *= a
- }
- },
- setup_n: function () {
- this.wrap_n = h.geom.Vec2.get(this.nlocalx, this.nlocaly, null);
- this.wrap_n.zpp_inner._inuse = !0;
- this.wrap_n.zpp_inner._validate = A(this, this.validate_n);
- this.wrap_n.zpp_inner._invalidate = A(this, this.invalidate_n)
- },
- invalidate_n: function (a) {
- this.immutable_midstep("Constraint::n");
- this.nlocalx = a.x;
- this.nlocaly = a.y;
- this.zip_n = !0;
- this.wake()
- },
- validate_n: function () {
- this.wrap_n.zpp_inner.x = this.nlocalx;
- this.wrap_n.zpp_inner.y = this.nlocaly
- },
- setup_a2: function () {
- this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
- this.wrap_a2.zpp_inner._inuse = !0;
- this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
- this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
- },
- invalidate_a2: function (a) {
- this.immutable_midstep("Constraint::a2");
- this.a2localx = a.x;
- this.a2localy = a.y;
- this.wake()
- },
- validate_a2: function () {
- this.wrap_a2.zpp_inner.x = this.a2localx;
- this.wrap_a2.zpp_inner.y = this.a2localy
- },
- setup_a1: function () {
- this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
- this.wrap_a1.zpp_inner._inuse = !0;
- this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
- this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
- },
- invalidate_a1: function (a) {
- this.immutable_midstep("Constraint::a1");
- this.a1localx = a.x;
- this.a1localy = a.y;
- this.wake()
- },
- validate_a1: function () {
- this.wrap_a1.zpp_inner.x =
- this.a1localx;
- this.wrap_a1.zpp_inner.y = this.a1localy
- },
- inactiveBodies: function () {
- null != this.b1 && this.b1.constraints.remove(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
- },
- activeBodies: function () {
- null != this.b1 && this.b1.constraints.add(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
- },
- bodyImpulse: function (a) {
- if (this.stepped) {
- var b = this.scale * this.nrelx * this.jAccy - this.nrely * this.jAccx,
- d = this.nrelx * this.jAccx + this.scale * this.nrely * this.jAccy;
- return a == this.b1 ?
- 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)
- }
- return h.geom.Vec3.get(0, 0, 0)
- },
- __class__: c.constraint.ZPP_LineJoint
- });
- c.constraint.ZPP_MotorJoint = function () {
- this.stepped = !1;
- this.kMass = this.jAcc = this.jMax = 0;
- this.b1 = this.b2 = null;
- this.ratio = this.rate = 0;
- this.outer_zn = null;
- c.constraint.ZPP_Constraint.call(this);
- this.jAcc = 0;
- this.stepped = !1;
- this.__velocity = !0
- };
- s["zpp_nape.constraint.ZPP_MotorJoint"] = c.constraint.ZPP_MotorJoint;
- c.constraint.ZPP_MotorJoint.__name__ = ["zpp_nape", "constraint", "ZPP_MotorJoint"];
- c.constraint.ZPP_MotorJoint.__super__ = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_MotorJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- applyImpulsePos: function () {
- return !1
- },
- applyImpulseVel: function () {
- var a = -this.kMass * (this.ratio * (this.b2.angvel + this.b2.kinangvel) - this.b1.angvel - this.b1.kinangvel - this.rate),
- b = this.jAcc;
- this.jAcc += a;
- if (this.breakUnderForce) {
- if (this.jAcc > this.jMax || this.jAcc < -this.jMax) return !0
- } else this.jAcc < -this.jMax ? this.jAcc = -this.jMax : this.jAcc > this.jMax && (this.jAcc = this.jMax);
- a = this.jAcc - b;
- this.b1.angvel -= this.b1.iinertia * a;
- this.b2.angvel += this.ratio * this.b2.iinertia * a;
- return !1
- },
- warmStart: function () {
- this.b1.angvel -= this.b1.iinertia * this.jAcc;
- this.b2.angvel += this.ratio * this.b2.iinertia * this.jAcc
- },
- preStep: function (a) {
- -1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.stepped = !0;
- this.kMass = this.b1.sinertia + this.ratio * this.ratio * this.b2.sinertia;
- this.kMass = 1 / this.kMass;
- this.jAcc *= b;
- this.jMax = this.maxForce *
- a;
- return !1
- },
- clearcache: function () {
- this.jAcc = 0;
- this.pre_dt = -1
- },
- pair_exists: function (a, b) {
- return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
- },
- forest: function () {
- if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
- a = a.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- b = this.component == this.component.parent ? this.component : function (a) {
- a =
- a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this);
- a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
- }
- this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
- a = a.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ?
- this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
- },
- wake_connected: function () {
- null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
- null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
- },
- validate: function () {
- if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
- if (this.b1 == this.b2) throw "Error: MotorJoint cannot be simulated with body1 == body2";
- 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";
- 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";
- },
- copy: function (a, b) {
- var d = new h.constraint.MotorJoint(null, null, this.rate, this.ratio);
- this.copyto(d);
- if (null != a && null != this.b1) {
- for (var g = null, e = 0; e < a.length;) {
- var f = a[e];
- ++e;
- if (f.id == this.b1.id) {
- g = f.bc;
- break
- }
- }
- null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
- d.zpp_inner_zn.b1 = a.zpp_inner
- }))
- }
- if (null != a && null != this.b2) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b2.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
- d.zpp_inner_zn.b2 = a.zpp_inner
- }))
- }
- return d
- },
- inactiveBodies: function () {
- null != this.b1 && this.b1.constraints.remove(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
- },
- activeBodies: function () {
- null != this.b1 && this.b1.constraints.add(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
- },
- bodyImpulse: function (a) {
- 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)
- },
- __class__: c.constraint.ZPP_MotorJoint
- });
- c.constraint.ZPP_PivotJoint = function () {
- this.stepped = !1;
- this.kMassa = this.kMassb = this.kMassc = this.jAccx = this.jAccy = this.jMax = this.gamma = this.biasx = this.biasy = 0;
- this.wrap_a2 = null;
- this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
- this.wrap_a1 = this.b2 = null;
- this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
- this.outer_zn = this.b1 = null;
- c.constraint.ZPP_Constraint.call(this);
- this.stepped = !1;
- this.jAccy = this.jAccx = 0;
- this.jMax = Math.POSITIVE_INFINITY;
- this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx =
- 0
- };
- s["zpp_nape.constraint.ZPP_PivotJoint"] = c.constraint.ZPP_PivotJoint;
- c.constraint.ZPP_PivotJoint.__name__ = ["zpp_nape", "constraint", "ZPP_PivotJoint"];
- c.constraint.ZPP_PivotJoint.__super__ = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_PivotJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- draw: function (a) {
- var b = this.outer_zn,
- d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
- return b.zpp_inner_zn.wrap_a1
- }(this)),
- c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
- return b.zpp_inner_zn.wrap_a2
- }(this));
- if (!this.stiff) {
- var e = c.sub(d);
- 0 != function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) + function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a))
- }(this) && a.drawSpring(d, c, 16711935);
- e.dispose()
- }
- a.drawFilledCircle(d, 2, 255);
- a.drawFilledCircle(c, 2, 16711680);
- d.dispose();
- c.dispose()
- },
- applyImpulsePos: function () {
- var a = 0,
- b = 0,
- a = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
- b = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
- d = 0,
- c = 0,
- d = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
- c = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
- e = 0,
- f = 0,
- e = this.b2.posx + d - (this.b1.posx + a),
- f = this.b2.posy + c - (this.b1.posy + b);
- if (this.breakUnderError && e * e + f * f > this.maxError * this.maxError) return !0;
- if (e * e + f * f < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
- var l = 0.5,
- e = e * l,
- f = f * l,
- m = 0,
- u = 0;
- if (6 <
- e * e + f * f) {
- var p = this.b1.smass + this.b2.smass;
- 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)
- }
- var k = p = 0,
- r = 0,
- p = r = this.b1.smass + this.b2.smass,
- k = 0;
- 0 != this.b1.sinertia && (m = a * this.b1.sinertia, u = b * this.b1.sinertia, p += u * b, k += -u * a, r += m * a);
- 0 != this.b2.sinertia && (m = d * this.b2.sinertia,
- u = c * this.b2.sinertia, p += u * c, k += -u * d, r += m * d);
- m = -e;
- u = -f;
- l = 6;
- e = m * m + u * u;
- e > l * l && (e = l * (1 / Math.sqrt(e)), m *= e, u *= e);
- e = p * r - k * k;
- 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);
- 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;
- this.b1.delta_rot(-(u * a - m * b) * this.b1.iinertia);
- this.b2.delta_rot((u * d - m * c) * this.b2.iinertia);
- return !1
- },
- applyImpulseVel: function () {
- var a = 0,
- b = 0,
- 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)),
- 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)),
- d = 0,
- c = 0,
- d = this.biasx - a,
- c = this.biasy - b,
- e = this.kMassa * d + this.kMassb * c,
- c = this.kMassb * d + this.kMassc * c,
- d = e,
- e = this.gamma,
- d = d - this.jAccx * e,
- c = c - this.jAccy * e,
- b = a = 0,
- a = this.jAccx,
- b = this.jAccy,
- e = 1;
- this.jAccx += d * e;
- this.jAccy += c * e;
- if (this.breakUnderForce) {
- if (this.jAccx *
- this.jAccx + this.jAccy * this.jAccy > this.jMax * this.jMax) return !0
- } 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));
- d = this.jAccx - a;
- c = this.jAccy - b;
- e = this.b1.imass;
- this.b1.velx -= d * e;
- this.b1.vely -= c * e;
- e = this.b2.imass;
- this.b2.velx += d * e;
- this.b2.vely += c * e;
- this.b1.angvel -= (c * this.a1relx - d * this.a1rely) * this.b1.iinertia;
- this.b2.angvel += (c * this.a2relx - d * this.a2rely) * this.b2.iinertia;
- return !1
- },
- warmStart: function () {
- var a = this.b1.imass;
- this.b1.velx -= this.jAccx * a;
- this.b1.vely -= this.jAccy * a;
- a = this.b2.imass;
- this.b2.velx += this.jAccx * a;
- this.b2.vely += this.jAccy * a;
- this.b1.angvel -= (this.jAccy * this.a1relx - this.jAccx * this.a1rely) * this.b1.iinertia;
- this.b2.angvel += (this.jAccy * this.a2relx - this.jAccx * this.a2rely) * this.b2.iinertia
- },
- preStep: function (a) {
- -1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.stepped = !0;
- this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
- this.a1rely = this.a1localx * this.b1.axisx + this.a1localy *
- this.b1.axisy;
- this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
- this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
- var d = this.b1.smass + this.b2.smass;
- this.kMassa = d;
- this.kMassb = 0;
- this.kMassc = d;
- if (0 != this.b1.sinertia) {
- var d = this.a1relx * this.b1.sinertia,
- c = this.a1rely * this.b1.sinertia;
- this.kMassa += c * this.a1rely;
- this.kMassb += -c * this.a1relx;
- this.kMassc += d * this.a1relx
- }
- 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.kMassc += d * this.a2relx);
- d = function (a) {
- var b = a.kMassa * a.kMassc - a.kMassb * a.kMassb;
- b != b ? (a.kMassa = a.kMassb = a.kMassc = 0, a = 3) : a = 0 == b ? function (a) {
- var b = 0;
- 0 != a.kMassa ? a.kMassa = 1 / a.kMassa : (a.kMassa = 0, b |= 1);
- 0 != a.kMassc ? a.kMassc = 1 / a.kMassc : (a.kMassc = 0, b |= 2);
- a.kMassb = 0;
- return b
- }(a) : function (a) {
- b = 1 / b;
- var d = a.kMassc * b;
- a.kMassc = a.kMassa * b;
- a.kMassa = d;
- a.kMassb *= -b;
- return 0
- }(a);
- return a
- }(this);
- 0 != (d & 1) && (this.jAccx = 0);
- 0 != (d & 2) && (this.jAccy = 0);
- if (this.stiff) this.gamma = this.biasy = this.biasx =
- 0;
- else {
- var e, d = function (b) {
- var d = 2 * Math.PI * b.frequency;
- b.gamma = 1 / (a * d * (2 * b.damping + d * a));
- var c = 1 / (1 + b.gamma);
- e = a * d * d * b.gamma;
- b.gamma *= c;
- return c
- }(this);
- this.kMassa *= d;
- this.kMassb *= d;
- this.kMassc *= d;
- this.biasx = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx);
- this.biasy = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
- if (this.breakUnderError && this.biasx * this.biasx + this.biasy * this.biasy > this.maxError * this.maxError) return !0;
- d = -e;
- this.biasx *= d;
- this.biasy *= d;
- d = this.maxError;
- c = this.biasx * this.biasx +
- this.biasy * this.biasy;
- c > d * d && (d *= 1 / Math.sqrt(c), this.biasx *= d, this.biasy *= d)
- }
- d = b;
- this.jAccx *= d;
- this.jAccy *= d;
- this.jMax = this.maxForce * a;
- return !1
- },
- clearcache: function () {
- this.jAccy = this.jAccx = 0;
- this.pre_dt = -1
- },
- pair_exists: function (a, b) {
- return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
- },
- forest: function () {
- if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
- a = a.b1.component;
- for (var b = null; a != a.parent;) {
- var c =
- a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this);
- a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
- }
- this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ? this.b2.component : function (a) {
- a = a.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
- },
- wake_connected: function () {
- null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
- null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
- },
- validate: function () {
- if (null == this.b1 || null == this.b2) throw "Error: PivotJoint cannot be simulated null bodies";
- if (this.b1 == this.b2) throw "Error: PivotJoint cannot be simulated with body1 == body2 (body1=body2=" + this.b1.outer.toString() + ")";
- 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() +
- ", body2=" + this.b2.outer.toString() + ")";
- 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() + ")";
- },
- copy: function (a, b) {
- var d = new h.constraint.PivotJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2());
- this.copyto(d);
- if (null != a && null != this.b1) {
- for (var g = null, e = 0; e < a.length;) {
- var f = a[e];
- ++e;
- if (f.id ==
- this.b1.id) {
- g = f.bc;
- break
- }
- }
- null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
- d.zpp_inner_zn.b1 = a.zpp_inner
- }))
- }
- if (null != a && null != this.b2) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b2.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
- d.zpp_inner_zn.b2 = a.zpp_inner
- }))
- }
- return d
- },
- setup_a2: function () {
- this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
- this.wrap_a2.zpp_inner._inuse = !0;
- this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
- this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
- },
- invalidate_a2: function (a) {
- this.immutable_midstep("Constraint::a2");
- this.a2localx = a.x;
- this.a2localy = a.y;
- this.wake()
- },
- validate_a2: function () {
- this.wrap_a2.zpp_inner.x = this.a2localx;
- this.wrap_a2.zpp_inner.y = this.a2localy
- },
- setup_a1: function () {
- this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
- this.wrap_a1.zpp_inner._inuse = !0;
- this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
- this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
- },
- invalidate_a1: function (a) {
- this.immutable_midstep("Constraint::a1");
- this.a1localx = a.x;
- this.a1localy = a.y;
- this.wake()
- },
- validate_a1: function () {
- this.wrap_a1.zpp_inner.x = this.a1localx;
- this.wrap_a1.zpp_inner.y = this.a1localy
- },
- inactiveBodies: function () {
- null != this.b1 && this.b1.constraints.remove(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
- },
- activeBodies: function () {
- null != this.b1 && this.b1.constraints.add(this);
- this.b2 != this.b1 &&
- null != this.b2 && this.b2.constraints.add(this)
- },
- bodyImpulse: function (a) {
- 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)
- },
- __class__: c.constraint.ZPP_PivotJoint
- });
- c.constraint.ZPP_PulleyJoint = function () {
- this.stepped = !1;
- this.kMass = this.jAcc = this.jMax = this.gamma = this.bias = 0;
- this.wrap_a4 = null;
- this.a4localx = this.a4localy = this.a4relx =
- this.a4rely = 0;
- this.wrap_a3 = this.b4 = null;
- this.a3localx = this.a3localy = this.a3relx = this.a3rely = 0;
- this.wrap_a2 = this.b3 = null;
- this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
- this.wrap_a1 = this.b2 = null;
- this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
- this.b1 = null;
- this.n12x = this.n12y = this.n34x = this.n34y = this.cx1 = this.cx2 = this.cx3 = this.cx4 = 0;
- this.slack = this.equal = !1;
- this.jointMin = this.jointMax = 0;
- this.ratio = 1;
- this.outer_zn = null;
- c.constraint.ZPP_Constraint.call(this);
- this.a4rely = this.a4relx = this.a4localy =
- 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;
- this.n12x = 1;
- this.n12y = 0;
- this.n34x = 1;
- this.jAcc = this.n34y = 0;
- this.jMax = Math.POSITIVE_INFINITY;
- this.stepped = !1;
- this.cx1 = this.cx2 = this.cx3 = this.cx4 = 0
- };
- s["zpp_nape.constraint.ZPP_PulleyJoint"] = c.constraint.ZPP_PulleyJoint;
- c.constraint.ZPP_PulleyJoint.__name__ = ["zpp_nape", "constraint", "ZPP_PulleyJoint"];
- c.constraint.ZPP_PulleyJoint.__super__ =
- c.constraint.ZPP_Constraint;
- c.constraint.ZPP_PulleyJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- drawLink: function (a, b, d, c, e, f, l, m, h) {
- if (0 != e) {
- c.muleq(1 / e);
- var p = b.add(d).muleq(0.5),
- k = (this.jointMin - f) * l;
- 0 > k && (k = 0);
- f = (this.jointMax - f) * l;
- 0 > f && (f = 0);
- l = p.sub(c.mul(0.5 * k, !0));
- var r = p.add(c.mul(0.5 * k, !0)),
- n = p.sub(c.mul(0.5 * f, !0));
- c = p.add(c.mul(0.5 * f, !0));
- a.drawLine(l, r, m);
- a.drawLine(n, l, h);
- a.drawLine(c, r, h);
- this.stiff || (e > f ? (a.drawSpring(n, b, h), a.drawSpring(c, d, h)) : e < k && (a.drawSpring(l, b, m),
- a.drawSpring(r, d, m)));
- p.dispose();
- l.dispose();
- r.dispose();
- n.dispose();
- c.dispose()
- }
- },
- draw: function (a) {
- var b = this.outer_zn,
- d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
- return b.zpp_inner_zn.wrap_a1
- }(this)),
- c = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
- return b.zpp_inner_zn.wrap_a2
- }(this)),
- e = (null == b.zpp_inner_zn.b3 ?
- null : b.zpp_inner_zn.b3.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a3 && b.zpp_inner_zn.setup_a3();
- return b.zpp_inner_zn.wrap_a3
- }(this)),
- f = (null == b.zpp_inner_zn.b4 ? null : b.zpp_inner_zn.b4.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a4 && b.zpp_inner_zn.setup_a4();
- return b.zpp_inner_zn.wrap_a4
- }(this)),
- l = c.sub(d),
- m = f.sub(e),
- h = function (a) {
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- return l.zpp_inner.x
- }(a) * function (a) {
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- return l.zpp_inner.x
- }(a) + function (a) {
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- return l.zpp_inner.y
- }(a) * function (a) {
- if (null != l && l.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- l.zpp_inner.validate();
- return l.zpp_inner.y
- }(a))
- }(this),
- p = function (a) {
- if (null != m &&
- m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(a) * function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.x
- }(a) + function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(a) *
- function (a) {
- if (null != m && m.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- m.zpp_inner.validate();
- return m.zpp_inner.y
- }(a))
- }(this);
- this.drawLink(a, d, c, l, h, p * this.ratio, 1, 16776960, 65535);
- this.drawLink(a, e, f, m, p, h, 1 / this.ratio, 65535, 16711935);
- a.drawFilledCircle(d, 2, 255);
- a.drawFilledCircle(c, 2, 16711680);
- a.drawFilledCircle(e, 2, 65280);
- a.drawFilledCircle(f, 2, 16711935);
- d.dispose();
- c.dispose();
- e.dispose();
- f.dispose();
- l.dispose();
- m.dispose()
- },
- applyImpulsePos: function () {
- var a, b, d = 0,
- c = 0,
- d = this.b1.axisy *
- this.a1localx - this.b1.axisx * this.a1localy,
- c = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy,
- e = 0,
- f = 0,
- e = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
- f = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
- l = 0,
- m = 0,
- l = this.b3.axisy * this.a3localx - this.b3.axisx * this.a3localy,
- m = this.a3localx * this.b3.axisx + this.a3localy * this.b3.axisy,
- u = 0,
- p = 0,
- u = this.b4.axisy * this.a4localx - this.b4.axisx * this.a4localy,
- p = this.a4localx * this.b4.axisx + this.a4localy * this.b4.axisy,
- k, r = 0,
- n = 0,
- w = 0,
- t = 0,
- r = this.n12x,
- n = this.n12y,
- w = this.n34x,
- t = this.n34y;
- a = function (a) {
- var b = 0,
- h = 0,
- q = 0,
- s = 0,
- b = a.b2.posx + e - (a.b1.posx + d),
- h = a.b2.posy + f - (a.b1.posy + c),
- q = a.b4.posx + u - (a.b3.posx + l),
- s = a.b4.posy + p - (a.b3.posy + m),
- z = Math.sqrt(b * b + h * h),
- V = Math.sqrt(q * q + s * s);
- if (0 != z) {
- var y = 1 / z;
- r = b * y;
- n = h * y
- }
- 0 != V ? (y = 1 / V, w = q * y, t = s * y, y = a.ratio) : y = a.ratio / Math.sqrt(w * w + t * t);
- w *= y;
- t *= y;
- b = z + a.ratio * V;
- 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);
- return b
- }(this);
- if (!k) {
- if (this.breakUnderError &&
- a * a > this.maxError * this.maxError) return !0;
- if (a * a < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
- a *= 0.5;
- 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) {
- var b = 0,
- h = 0,
- q = 0,
- s = 0,
- b = a.b2.posx + e - (a.b1.posx + d),
- h = a.b2.posy +
- f - (a.b1.posy + c),
- q = a.b4.posx + u - (a.b3.posx + l),
- s = a.b4.posy + p - (a.b3.posy + m),
- z = Math.sqrt(b * b + h * h),
- V = Math.sqrt(q * q + s * s);
- if (0 != z) {
- var y = 1 / z;
- r = b * y;
- n = h * y
- }
- 0 != V ? (y = 1 / V, w = q * y, t = s * y, y = a.ratio) : y = a.ratio / Math.sqrt(w * w + t * t);
- w *= y;
- t *= y;
- b = z + a.ratio * V;
- 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);
- return b
- }(this), a *= 0.5);
- var q, s, y, z;
- b = function (a) {
- q = n * d - r * c;
- s = n * e - r * f;
- y = t * l - w * m;
- z = t * u - w * p;
- var b = a.b1.smass + a.b2.smass + a.ratio * a.ratio *
- (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;
- a.b1 == a.b4 && (b -= 2 * ((r * w + n * t) * a.b1.smass + q * z * a.b1.sinertia));
- a.b1 == a.b3 && (b += 2 * ((r * w + n * t) * a.b1.smass + q * y * a.b1.sinertia));
- a.b2 == a.b3 && (b -= 2 * ((r * w + n * t) * a.b2.smass + s * y * a.b2.sinertia));
- a.b2 == a.b4 && (b += 2 * ((r * w + n * t) * a.b2.smass + s * z * a.b2.sinertia));
- return b
- }(this);
- 0 != b && (b = 1 / b);
- b *= -a;
- 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 =
- 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)
- }
- return !1
- },
- applyImpulseVel: function () {
- if (this.slack) return !1;
- 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 *
- (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,
- b = this.jAcc;
- this.jAcc += a;
- !this.equal && 0 < this.jAcc && (this.jAcc = 0);
- if (this.breakUnderForce && this.jAcc < -this.jMax) return !0;
- !this.stiff && this.jAcc < -this.jMax && (this.jAcc = -this.jMax);
- a = this.jAcc - b;
- b = this.b1.imass * a;
- this.b1.velx -= this.n12x * b;
- this.b1.vely -= this.n12y * b;
- b = this.b2.imass * a;
- this.b2.velx += this.n12x * b;
- this.b2.vely += this.n12y * b;
- b = this.b3.imass * a;
- this.b3.velx -= this.n34x * b;
- this.b3.vely -= this.n34y * b;
- b = this.b4.imass * a;
- this.b4.velx += this.n34x * b;
- this.b4.vely += this.n34y * b;
- this.b1.angvel -= this.cx1 * this.b1.iinertia * a;
- this.b2.angvel += this.cx2 * this.b2.iinertia * a;
- this.b3.angvel -= this.cx3 * this.b3.iinertia * a;
- this.b4.angvel += this.cx4 * this.b4.iinertia * a;
- return !1
- },
- warmStart: function () {
- if (!this.slack) {
- var a =
- this.b1.imass * this.jAcc;
- this.b1.velx -= this.n12x * a;
- this.b1.vely -= this.n12y * a;
- a = this.b2.imass * this.jAcc;
- this.b2.velx += this.n12x * a;
- this.b2.vely += this.n12y * a;
- a = this.b3.imass * this.jAcc;
- this.b3.velx -= this.n34x * a;
- this.b3.vely -= this.n34y * a;
- a = this.b4.imass * this.jAcc;
- this.b4.velx += this.n34x * a;
- this.b4.vely += this.n34y * a;
- this.b1.angvel -= this.cx1 * this.b1.iinertia * this.jAcc;
- this.b2.angvel += this.cx2 * this.b2.iinertia * this.jAcc;
- this.b3.angvel -= this.cx3 * this.b3.iinertia * this.jAcc;
- this.b4.angvel += this.cx4 * this.b4.iinertia *
- this.jAcc
- }
- },
- preStep: function (a) {
- -1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.stepped = !0;
- this.equal = this.jointMin == this.jointMax;
- this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
- this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
- this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
- this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
- this.a3relx = this.b3.axisy * this.a3localx - this.b3.axisx * this.a3localy;
- this.a3rely =
- this.a3localx * this.b3.axisx + this.a3localy * this.b3.axisy;
- this.a4relx = this.b4.axisy * this.a4localx - this.b4.axisx * this.a4localy;
- this.a4rely = this.a4localx * this.b4.axisx + this.a4localy * this.b4.axisy;
- var d = function (a) {
- var b = 0,
- d = 0,
- c = 0,
- g = 0,
- b = a.b2.posx + a.a2relx - (a.b1.posx + a.a1relx),
- d = a.b2.posy + a.a2rely - (a.b1.posy + a.a1rely),
- c = a.b4.posx + a.a4relx - (a.b3.posx + a.a3relx),
- g = a.b4.posy + a.a4rely - (a.b3.posy + a.a3rely),
- h = Math.sqrt(b * b + d * d),
- k = Math.sqrt(c * c + g * g);
- if (0 != h) {
- var r = 1 / h;
- a.n12x = b * r;
- a.n12y = d * r
- }
- 0 != k ? (r = 1 / k, a.n34x = c *
- r, a.n34y = g * r, r = a.ratio) : r = a.ratio / Math.sqrt(a.n34x * a.n34x + a.n34y * a.n34y);
- a.n34x *= r;
- a.n34y *= r;
- b = h + a.ratio * k;
- 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);
- return b
- }(this);
- if (!this.slack) {
- this.kMass = function (a) {
- a.cx1 = a.n12y * a.a1relx - a.n12x * a.a1rely;
- a.cx2 = a.n12y * a.a2relx - a.n12x * a.a2rely;
- a.cx3 = a.n34y * a.a3relx - a.n34x * a.a3rely;
- a.cx4 = a.n34y * a.a4relx - a.n34x * a.a4rely;
- 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;
- a.b1 == a.b4 && (b -= 2 * ((a.n12x * a.n34x + a.n12y * a.n34y) * a.b1.smass + a.cx1 * a.cx4 * a.b1.sinertia));
- a.b1 == a.b3 && (b += 2 * ((a.n12x * a.n34x + a.n12y * a.n34y) * a.b1.smass + a.cx1 * a.cx3 * a.b1.sinertia));
- a.b2 == a.b3 && (b -= 2 * ((a.n12x * a.n34x + a.n12y * a.n34y) * a.b2.smass + a.cx2 * a.cx3 * a.b2.sinertia));
- a.b2 == a.b4 && (b += 2 * ((a.n12x *
- a.n34x + a.n12y * a.n34y) * a.b2.smass + a.cx2 * a.cx4 * a.b2.sinertia));
- return b
- }(this);
- 0 != this.kMass ? this.kMass = 1 / this.kMass : this.jAcc = 0;
- if (this.stiff) this.gamma = this.bias = 0;
- else {
- if (this.breakUnderError && d * d > this.maxError * this.maxError) return !0;
- var c;
- this.kMass *= function (b) {
- var d = 2 * Math.PI * b.frequency;
- b.gamma = 1 / (a * d * (2 * b.damping + d * a));
- var l = 1 / (1 + b.gamma);
- c = a * d * d * b.gamma;
- b.gamma *= l;
- return l
- }(this);
- this.bias = -d * c;
- this.bias < -this.maxError ? this.bias = -this.maxError : this.bias > this.maxError && (this.bias = this.maxError)
- }
- this.jAcc *=
- b;
- this.jMax = this.maxForce * a
- }
- return !1
- },
- clearcache: function () {
- this.jAcc = 0;
- this.pre_dt = -1
- },
- pair_exists: function (a, b) {
- 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)
- },
- forest: function () {
- if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var a = this.b1.component == this.b1.component.parent ? this.b1.component :
- function (a) {
- a = a.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this);
- a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
- }
- this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component ==
- this.b2.component.parent ? this.b2.component : function (a) {
- a = a.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)));
- this.b3.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC &&
- (a = this.b3.component == this.b3.component.parent ? this.b3.component : function (a) {
- a = a.b3.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)));
- this.b4.type ==
- c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b4.component == this.b4.component.parent ? this.b4.component : function (a) {
- a = a.b4.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent =
- a : (b.parent = a, a.rank++)))
- },
- wake_connected: function () {
- null != this.b1 && this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
- null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake();
- null != this.b3 && this.b3.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b3.wake();
- null != this.b4 && this.b4.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b4.wake()
- },
- validate: function () {
- if (null == this.b1 || null == this.b2 || null == this.b3 || null == this.b4) throw "Error: PulleyJoint cannot be simulated with null bodies";
- if (this.b1 == this.b2 || this.b3 == this.b4) throw "Error: PulleyJoint cannot have body1==body2 or body3==body4";
- 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";
- if (this.jointMin > this.jointMax) throw "Error: PulleyJoint must have jointMin <= jointMax";
- 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";
- 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";
- },
- copy: function (a, b) {
- 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);
- this.copyto(d);
- if (null != a && null != this.b1) {
- for (var g = null, e = 0; e < a.length;) {
- var f = a[e];
- ++e;
- if (f.id == this.b1.id) {
- g = f.bc;
- break
- }
- }
- null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
- d.zpp_inner_zn.b1 = a.zpp_inner
- }))
- }
- if (null != a && null != this.b2) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b2.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
- d.zpp_inner_zn.b2 = a.zpp_inner
- }))
- }
- if (null != a && null != this.b3) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b3.id) {
- g = f.bc;
- break
- }
- null !=
- g ? d.zpp_inner_zn.b3 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b3.id, function (a) {
- d.zpp_inner_zn.b3 = a.zpp_inner
- }))
- }
- if (null != a && null != this.b4) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b4.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b4 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b4.id, function (a) {
- d.zpp_inner_zn.b4 = a.zpp_inner
- }))
- }
- return d
- },
- setup_a4: function () {
- this.wrap_a4 = h.geom.Vec2.get(this.a4localx, this.a4localy, null);
- this.wrap_a4.zpp_inner._inuse = !0;
- this.wrap_a4.zpp_inner._validate =
- A(this, this.validate_a4);
- this.wrap_a4.zpp_inner._invalidate = A(this, this.invalidate_a4)
- },
- invalidate_a4: function (a) {
- this.immutable_midstep("Constraint::a4");
- this.a4localx = a.x;
- this.a4localy = a.y;
- this.wake()
- },
- validate_a4: function () {
- this.wrap_a4.zpp_inner.x = this.a4localx;
- this.wrap_a4.zpp_inner.y = this.a4localy
- },
- setup_a3: function () {
- this.wrap_a3 = h.geom.Vec2.get(this.a3localx, this.a3localy, null);
- this.wrap_a3.zpp_inner._inuse = !0;
- this.wrap_a3.zpp_inner._validate = A(this, this.validate_a3);
- this.wrap_a3.zpp_inner._invalidate =
- A(this, this.invalidate_a3)
- },
- invalidate_a3: function (a) {
- this.immutable_midstep("Constraint::a3");
- this.a3localx = a.x;
- this.a3localy = a.y;
- this.wake()
- },
- validate_a3: function () {
- this.wrap_a3.zpp_inner.x = this.a3localx;
- this.wrap_a3.zpp_inner.y = this.a3localy
- },
- setup_a2: function () {
- this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
- this.wrap_a2.zpp_inner._inuse = !0;
- this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
- this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
- },
- invalidate_a2: function (a) {
- this.immutable_midstep("Constraint::a2");
- this.a2localx = a.x;
- this.a2localy = a.y;
- this.wake()
- },
- validate_a2: function () {
- this.wrap_a2.zpp_inner.x = this.a2localx;
- this.wrap_a2.zpp_inner.y = this.a2localy
- },
- setup_a1: function () {
- this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
- this.wrap_a1.zpp_inner._inuse = !0;
- this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
- this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
- },
- invalidate_a1: function (a) {
- this.immutable_midstep("Constraint::a1");
- this.a1localx = a.x;
- this.a1localy = a.y;
- this.wake()
- },
- validate_a1: function () {
- this.wrap_a1.zpp_inner.x = this.a1localx;
- this.wrap_a1.zpp_inner.y = this.a1localy
- },
- inactiveBodies: function () {
- null != this.b1 && this.b1.constraints.remove(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this);
- this.b3 != this.b1 && this.b3 != this.b2 && null != this.b3 && this.b3.constraints.remove(this);
- this.b4 != this.b1 && this.b4 != this.b2 && this.b4 != this.b3 && null != this.b4 && this.b4.constraints.remove(this)
- },
- activeBodies: function () {
- null != this.b1 && this.b1.constraints.add(this);
- this.b2 !=
- this.b1 && null != this.b2 && this.b2.constraints.add(this);
- this.b3 != this.b1 && this.b3 != this.b2 && null != this.b3 && this.b3.constraints.add(this);
- this.b4 != this.b1 && this.b4 != this.b2 && this.b4 != this.b3 && null != this.b4 && this.b4.constraints.add(this)
- },
- bodyImpulse: function (a) {
- if (this.stepped) {
- var b = h.geom.Vec3.get();
- if (a == this.b1) {
- var d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- var c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.x = d.zpp_inner.x - this.jAcc * this.n12x;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.x;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.y = d.zpp_inner.y - this.jAcc * this.n12y;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.y;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.z = d.zpp_inner.z - this.cx1 * this.jAcc;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.z
- }
- if (a == this.b2) {
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.x = d.zpp_inner.x + this.jAcc * this.n12x;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.x;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.y = d.zpp_inner.y + this.jAcc * this.n12y;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.y;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.z = d.zpp_inner.z + this.cx2 * this.jAcc;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.z
- }
- if (a == this.b3) {
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.x = d.zpp_inner.x - this.jAcc * this.n34x;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.x;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.y = d.zpp_inner.y - this.jAcc * this.n34y;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.y;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- c = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.z = d.zpp_inner.z - this.cx3 * this.jAcc;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.z
- }
- if (a == this.b4) {
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- a = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- a.x = d.zpp_inner.x + this.jAcc * this.n34x;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.x;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- a = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- a.y = d.zpp_inner.y + this.jAcc * this.n34y;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.y;
- d = b;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- if (d.zpp_inner.immutable) throw "Error: Vec3 is immutable";
- a = d.zpp_inner;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- a.z = d.zpp_inner.z + this.cx4 * this.jAcc;
- if (null != d && d.zpp_disp) throw "Error: Vec3 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d.zpp_inner.z
- }
- return b
- }
- return h.geom.Vec3.get(0, 0, 0)
- },
- is_slack: function () {
- var a;
- this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
- this.a1rely = this.a1localx * this.b1.axisx +
- this.a1localy * this.b1.axisy;
- this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
- this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
- this.a3relx = this.b3.axisy * this.a3localx - this.b3.axisx * this.a3localy;
- this.a3rely = this.a3localx * this.b3.axisx + this.a3localy * this.b3.axisy;
- this.a4relx = this.b4.axisy * this.a4localx - this.b4.axisx * this.a4localy;
- this.a4rely = this.a4localx * this.b4.axisx + this.a4localy * this.b4.axisy;
- var b = 0,
- d = 0,
- c = a = 0,
- b = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx),
- d = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
- a = this.b4.posx + this.a4relx - (this.b3.posx + this.a3relx);
- c = this.b4.posy + this.a4rely - (this.b3.posy + this.a3rely);
- b = Math.sqrt(b * b + d * d);
- a = Math.sqrt(a * a + c * c);
- 0 == a && Math.sqrt(0);
- c = b + this.ratio * a;
- 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);
- c;
- return a
- },
- __class__: c.constraint.ZPP_PulleyJoint
- });
- c.constraint.ZPP_UserConstraint = function (a, b) {
- this.Keff = this.vec3 = this.J = this.jOld =
- null;
- this.jMax = 0;
- this.velonly = !1;
- this.soft = this.gamma = 0;
- this.L = this.y = null;
- this.stepped = !1;
- this.jAcc = this.bias = null;
- this.dim = 0;
- this.outer_zn = this.bodies = null;
- c.constraint.ZPP_Constraint.call(this);
- this.bodies = [];
- this.dim = a;
- this.velonly = b;
- this.jAcc = [];
- this.bias = [];
- this.L = [];
- this.J = [];
- this.jOld = [];
- this.y = [];
- this.Keff = [];
- this.vec3 = h.geom.Vec3.get(0, 0, 0);
- for (var d = 0; d < a;)
- for (var g = d++, e = this.jAcc[g] = this.bias[g] = this.J[g] = this.jOld[g] = this.y[g] = 0; e < a;) {
- var f = e++;
- this.L[g * a + f] = 0
- }
- this.stepped = !1
- };
- s["zpp_nape.constraint.ZPP_UserConstraint"] =
- c.constraint.ZPP_UserConstraint;
- c.constraint.ZPP_UserConstraint.__name__ = ["zpp_nape", "constraint", "ZPP_UserConstraint"];
- c.constraint.ZPP_UserConstraint.__super__ = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_UserConstraint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- draw: function (a) {
- this.outer_zn.__draw(a)
- },
- applyImpulsePos: function () {
- if (this.velonly) return !1;
- this.outer_zn.__prepare();
- this.outer_zn.__position(this.J);
- var a = this.lsq(this.J);
- if (this.breakUnderError && a > this.maxError * this.maxError) return !0;
- if (a < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop) return !1;
- for (var a = 0, b = this.dim; a < b;) {
- var d = a++;
- this.J[d] *= -1
- }
- this.outer_zn.__eff_mass(this.Keff);
- this.transform(this.solve(this.Keff), this.J);
- this.outer_zn.__clamp(this.J);
- b = 0;
- for (a = this.bodies; b < a.length;) {
- d = a[b];
- ++b;
- d = d.body;
- this.outer_zn.__impulse(this.J, d.outer, this.vec3);
- var c = d.imass;
- d.posx += this.vec3.get_x() * c;
- d.posy += this.vec3.get_y() * c;
- d.delta_rot(this.vec3.get_z() * d.iinertia)
- }
- return !1
- },
- applyImpulseVel: function () {
- this.outer_zn.__velocity(this.J);
- for (var a = 0, b = this.dim; a < b;) {
- var d = a++;
- this.J[d] = this.bias[d] - this.J[d]
- }
- this.transform(this.L, this.J);
- a = 0;
- 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;
- this.outer_zn.__clamp(this.jAcc);
- if ((this.breakUnderForce || !this.stiff) && this.lsq(this.jAcc) > this.jMax * this.jMax) {
- if (this.breakUnderForce) return !0;
- this.stiff || this._clamp(this.jAcc, this.jMax)
- }
- a = 0;
- for (b = this.dim; a < b;) d = a++, this.J[d] = this.jAcc[d] - this.jOld[d];
- b = 0;
- for (a = this.bodies; b <
- a.length;) {
- d = a[b];
- ++b;
- d = d.body;
- this.outer_zn.__impulse(this.J, d.outer, this.vec3);
- var c = d.imass;
- d.velx += this.vec3.get_x() * c;
- d.vely += this.vec3.get_y() * c;
- d.angvel += this.vec3.get_z() * d.iinertia
- }
- return !1
- },
- warmStart: function () {
- for (var a = 0, b = this.bodies; a < b.length;) {
- var d = b[a];
- ++a;
- d = d.body;
- this.outer_zn.__impulse(this.jAcc, d.outer, this.vec3);
- var c = d.imass;
- d.velx += this.vec3.get_x() * c;
- d.vely += this.vec3.get_y() * c;
- d.angvel += this.vec3.get_z() * d.iinertia
- }
- },
- preStep: function (a) {
- -1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.stepped = !0;
- this.outer_zn.__prepare();
- this.outer_zn.__eff_mass(this.Keff);
- this.L = this.solve(this.Keff);
- if (this.stiff || this.velonly) {
- c = 0;
- for (e = this.dim; c < e;) f = c++, this.bias[f] = 0;
- this.gamma = 0;
- this.soft = 1
- } else {
- var d;
- d = 2 * Math.PI * this.frequency;
- this.gamma = 1 / (a * d * (2 * this.damping + d * a));
- c = 1 / (1 + this.gamma);
- d = a * d * d * this.gamma;
- this.gamma *= c;
- this.soft = c;
- this.outer_zn.__position(this.bias);
- if (this.breakUnderError && this.lsq(this.bias) > this.maxError * this.maxError) return !0;
- for (var c =
- 0, e = this.dim; c < e;) {
- var f = c++;
- this.bias[f] *= -d
- }
- this._clamp(this.bias, this.maxError)
- }
- c = 0;
- for (e = this.dim; c < e;) f = c++, this.jAcc[f] *= b;
- this.jMax = this.maxForce * a;
- return !1
- },
- transform: function (a, b) {
- for (var d = 0, c = this.dim; d < c;) {
- var e = d++,
- f = b[e],
- l = a[e * this.dim + e];
- if (0 != l) {
- for (var m = 0; m < e;) var h = m++,
- f = f - a[e * this.dim + h] * this.y[h];
- this.y[e] = f / l
- } else this.y[e] = 0
- }
- d = 0;
- for (c = this.dim; d < c;)
- if (e = d++, e = this.dim - 1 - e, l = a[e * this.dim + e], 0 != l) {
- for (var f = this.y[e], p = e + 1, m = this.dim; p < m;) h = p++, f -= a[h * this.dim + e] * b[h];
- b[e] = f /
- l
- } else b[e] = 0
- },
- solve: function (a) {
- for (var b = 0, d = 0, c = this.dim; d < c;) {
- for (var e = d++, f = 0, l = 0, m = e - 1; l < m;) var h = l++,
- f = f + this.L[e * this.dim + h] * this.L[e * this.dim + h];
- f = Math.sqrt(a[b++] - f);
- this.L[e * this.dim + e] = f;
- if (0 != f)
- for (f = 1 / f, l = e + 1, m = this.dim; l < m;) {
- 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];
- this.L[p * this.dim + e] = f * (a[b++] - k)
- } else {
- l = e + 1;
- for (m = this.dim; l < m;) p = l++, this.L[p * this.dim + e] = 0;
- b += this.dim - e - 1
- }
- }
- return this.L
- },
- _clamp: function (a, b) {
- var d = this.lsq(a);
- if (d > b * b)
- for (var d =
- b / Math.sqrt(d), c = 0, e = this.dim; c < e;) {
- var f = c++;
- a[f] *= d
- }
- },
- lsq: function (a) {
- for (var b = 0, d = 0, c = this.dim; d < c;) var e = d++,
- b = b + a[e] * a[e];
- return b
- },
- clearcache: function () {
- for (var a = 0, b = this.dim; a < b;) {
- var d = a++;
- this.jAcc[d] = 0
- }
- this.pre_dt = -1
- },
- broken: function () {
- this.outer_zn.__broken()
- },
- pair_exists: function (a, b) {
- for (var d = !1, c = this.bodies.length | 0, e = 0; e < c;) {
- for (var f = e++, l = this.bodies[f].body, f = f + 1; f < c;) {
- var m = f++,
- m = this.bodies[m].body;
- if (l.id == a && m.id == b || l.id == b && m.id == a) {
- d = !0;
- break
- }
- }
- if (d) break
- }
- return d
- },
- forest: function () {
- for (var a =
- 0, b = this.bodies; a < b.length;) {
- var d = b[a];
- ++a;
- if (d.body.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var g = d.body.component == d.body.component.parent ? d.body.component : function (a) {
- a = d.body.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- e = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this);
- g != e && (g.rank < e.rank ? g.parent = e : g.rank > e.rank ? e.parent = g : (e.parent = g, g.rank++))
- }
- }
- },
- wake_connected: function () {
- for (var a = 0, b = this.bodies; a < b.length;) {
- var d = b[a];
- ++a;
- d.body.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && d.body.wake()
- }
- },
- validate: function () {
- for (var a = 0, b = this.bodies; a < b.length;) {
- var d = b[a];
- ++a;
- if (d.body.space != this.space) throw "Error: Constraints must have each body within the same sapce to which the constraint has been assigned";
- }
- this.outer_zn.__validate()
- },
- copy: function (a, b) {
- var d = this.outer_zn.__copy();
- this.copyto(d);
- throw "not done yet";
- },
- inactiveBodies: function () {
- for (var a = 0, b = this.bodies; a < b.length;) {
- var d = b[a];
- ++a;
- null != d.body && d.body.constraints.remove(this)
- }
- },
- activeBodies: function () {
- for (var a = 0, b = this.bodies; a < b.length;) {
- var d = b[a];
- ++a;
- null != d.body && d.body.constraints.add(this)
- }
- },
- bodyImpulse: function (a) {
- for (var b = 0, d = this.dim; b < d;) {
- var c = b++;
- this.J[c] = this.jAcc[c]
- }
- b = h.geom.Vec3.get(0, 0, 0);
- this.stepped && this.outer_zn.__impulse(this.J, a.outer, b);
- return b
- },
- remBody: function (a) {
- for (var b = null, d =
- this.bodies.length | 0, c = 0; c < d;) {
- var e = this.bodies[c];
- if (e.body == a) {
- e.cnt--;
- 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));
- b = e;
- break
- }
- c++
- }
- return null != b
- },
- addBody: function (a) {
- for (var b = null, d = 0, g = this.bodies; d < g.length;) {
- var e = g[d];
- ++d;
- if (e.body == a) {
- b = e;
- break
- }
- }
- 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++
- },
- bindVec2_invalidate: function (a) {
- this.outer_zn.__invalidate()
- },
- __class__: c.constraint.ZPP_UserConstraint
- });
- c.constraint.ZPP_UserBody = function (a, b) {
- this.body = null;
- this.cnt = 0;
- this.cnt = a;
- this.body = b
- };
- s["zpp_nape.constraint.ZPP_UserBody"] = c.constraint.ZPP_UserBody;
- c.constraint.ZPP_UserBody.__name__ = ["zpp_nape", "constraint", "ZPP_UserBody"];
- c.constraint.ZPP_UserBody.prototype = {
- __class__: c.constraint.ZPP_UserBody
- };
- c.constraint.ZPP_WeldJoint = function () {
- this.stepped = !1;
- this.phase = this.kMassa = this.kMassb = this.kMassd = this.kMassc = this.kMasse = this.kMassf = this.jAccx = this.jAccy =
- this.jAccz = this.jMax = this.gamma = this.biasx = this.biasy = this.biasz = 0;
- this.wrap_a2 = null;
- this.a2localx = this.a2localy = this.a2relx = this.a2rely = 0;
- this.wrap_a1 = this.b2 = null;
- this.a1localx = this.a1localy = this.a1relx = this.a1rely = 0;
- this.outer_zn = this.b1 = null;
- c.constraint.ZPP_Constraint.call(this);
- this.jAccz = this.jAccy = this.jAccx = this.phase = 0;
- this.jMax = Math.POSITIVE_INFINITY;
- this.stepped = !1;
- this.a2rely = this.a2relx = this.a2localy = this.a2localx = this.a1rely = this.a1relx = this.a1localy = this.a1localx = 0
- };
- s["zpp_nape.constraint.ZPP_WeldJoint"] =
- c.constraint.ZPP_WeldJoint;
- c.constraint.ZPP_WeldJoint.__name__ = ["zpp_nape", "constraint", "ZPP_WeldJoint"];
- c.constraint.ZPP_WeldJoint.__super__ = c.constraint.ZPP_Constraint;
- c.constraint.ZPP_WeldJoint.prototype = I(c.constraint.ZPP_Constraint.prototype, {
- draw: function (a) {
- var b = this.outer_zn,
- d = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).localPointToWorld(function (a) {
- null == b.zpp_inner_zn.wrap_a1 && b.zpp_inner_zn.setup_a1();
- return b.zpp_inner_zn.wrap_a1
- }(this)),
- g = (null == b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).localPointToWorld(function (a) {
- null ==
- b.zpp_inner_zn.wrap_a2 && b.zpp_inner_zn.setup_a2();
- return b.zpp_inner_zn.wrap_a2
- }(this));
- if (!this.stiff) {
- var e = g.sub(d);
- 0 != function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- return Math.sqrt(function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.x
- }(a) +
- function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a) * function (a) {
- if (null != e && e.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- e.zpp_inner.validate();
- return e.zpp_inner.y
- }(a))
- }(this) && a.drawSpring(d, g, 16711935);
- e.dispose();
- var f = 5 / Math.PI / 2;
- 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) {
- var l = (null ==
- b.zpp_inner_zn.b2 ? null : b.zpp_inner_zn.b2.outer).zpp_inner.rot - b.zpp_inner_zn.phase,
- m = (null == b.zpp_inner_zn.b1 ? null : b.zpp_inner_zn.b1.outer).zpp_inner.rot;
- if (m > l) var h = m,
- m = l,
- l = h;
- 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);
- 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 - m) * f, 16711808)
- }(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(),
- 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))
- }
- a.drawFilledCircle(d, 2, 255);
- a.drawFilledCircle(g, 2, 16711680);
- d.dispose();
- g.dispose()
- },
- applyImpulsePos: function () {
- var a = 0,
- b = 0,
- a = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy,
- b = this.a1localx * this.b1.axisx +
- this.a1localy * this.b1.axisy,
- d = 0,
- g = 0,
- d = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy,
- g = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy,
- e = 0,
- f = 0,
- l = 0,
- 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,
- m = 0,
- u = 0,
- p = 0;
- if (this.breakUnderError && e * e + f * f + l * l > this.maxError * this.maxError) return !0;
- m = !0;
- e * e + f * f < h.Config.constraintLinearSlop * h.Config.constraintLinearSlop && (m = !1, f = e = 0);
- if (l * l < c.util.ZPP_Math.sqr(h.Config.constraintAngularSlop))
- if (m) l =
- 0;
- else return !1;
- var k = 0.5,
- r = k,
- e = e * r,
- f = f * r,
- l = l * k;
- if (6 < e * e + f * f) {
- var n = this.b1.smass + this.b2.smass;
- 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)
- }
- var w = n = 0,
- t = 0,
- q = 0,
- s = 0,
- y = 0,
- n = m = this.b1.smass + this.b2.smass,
- w = 0,
- t = m,
- y = s = q = 0;
- 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);
- 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);
- m = -e;
- u = -f;
- p = -l;
- k = 6;
- e = m * m + u * u;
- e > k * k && (r = k * (1 / Math.sqrt(e)), m *= r, u *= r);
- c.util.ZPP_Math.clamp(p, -0.25, 0.25);
- e = n * (t * y - s * s) + w * (q * s - w * y) + q * (w * s - q * t);
- 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),
- 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);
- 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;
- this.b1.delta_rot(-(u * a - m * b + p) * this.b1.iinertia);
- this.b2.delta_rot((u * d - m * g + p) * this.b2.iinertia);
- return !1
- },
- applyImpulseVel: function () {
- var a = 0,
- b = 0,
- d = 0,
- 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)),
- 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)),
- d = this.b2.angvel + this.b2.kinangvel - this.b1.angvel - this.b1.kinangvel,
- c = 0,
- e = 0,
- f = 0,
- c = this.biasx - a,
- e = this.biasy - b,
- f = this.biasz - d,
- d = this.kMassa * c + this.kMassb * e + this.kMassc * f,
- l = this.kMassb * c + this.kMassd * e + this.kMasse * f,
- f = this.kMassc * c + this.kMasse * e + this.kMassf * f,
- b = a = this.gamma,
- c = d - this.jAccx * b,
- e = l - this.jAccy * b,
- f = f - this.jAccz * a,
- m = l = d = 0,
- d = this.jAccx,
- l = this.jAccy,
- m = this.jAccz,
- b = a = 1;
- this.jAccx += c * b;
- this.jAccy += e * b;
- this.jAccz += f * a;
- if (this.breakUnderForce) {
- if (this.jAccx * this.jAccx + this.jAccy * this.jAccy + this.jAccz * this.jAccz > this.jMax * this.jMax) return !0
- } 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));
- c = this.jAccx - d;
- e = this.jAccy - l;
- f = this.jAccz - m;
- a = this.b1.imass;
- this.b1.velx -= c * a;
- this.b1.vely -= e * a;
- a = this.b2.imass;
- this.b2.velx += c * a;
- this.b2.vely += e * a;
- this.b1.angvel -=
- (e * this.a1relx - c * this.a1rely + f) * this.b1.iinertia;
- this.b2.angvel += (e * this.a2relx - c * this.a2rely + f) * this.b2.iinertia;
- return !1
- },
- warmStart: function () {
- var a = this.b1.imass;
- this.b1.velx -= this.jAccx * a;
- this.b1.vely -= this.jAccy * a;
- a = this.b2.imass;
- this.b2.velx += this.jAccx * a;
- this.b2.vely += this.jAccy * a;
- this.b1.angvel -= (this.jAccy * this.a1relx - this.jAccx * this.a1rely + this.jAccz) * this.b1.iinertia;
- this.b2.angvel += (this.jAccy * this.a2relx - this.jAccx * this.a2rely + this.jAccz) * this.b2.iinertia
- },
- preStep: function (a) {
- -1 == this.pre_dt &&
- (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- this.stepped = !0;
- this.a1relx = this.b1.axisy * this.a1localx - this.b1.axisx * this.a1localy;
- this.a1rely = this.a1localx * this.b1.axisx + this.a1localy * this.b1.axisy;
- this.a2relx = this.b2.axisy * this.a2localx - this.b2.axisx * this.a2localy;
- this.a2rely = this.a2localx * this.b2.axisx + this.a2localy * this.b2.axisy;
- var d = this.b1.smass + this.b2.smass;
- this.kMassa = d;
- this.kMassb = 0;
- this.kMassd = d;
- this.kMassf = this.kMasse = this.kMassc = 0;
- if (0 != this.b1.sinertia) {
- var d = this.a1relx * this.b1.sinertia,
- c = this.a1rely * this.b1.sinertia;
- this.kMassa += c * this.a1rely;
- this.kMassb += -c * this.a1relx;
- this.kMassd += d * this.a1relx;
- this.kMassc += -c;
- this.kMasse += d;
- this.kMassf += this.b1.sinertia
- }
- 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);
- d = function (a) {
- var b = a.kMassa * (a.kMassd * a.kMassf - a.kMasse * a.kMasse) + a.kMassb * (a.kMassc * a.kMasse - a.kMassb *
- a.kMassf) + a.kMassc * (a.kMassb * a.kMasse - a.kMassc * a.kMassd);
- return b != b ? function (a) {
- a.kMassa = 0;
- a.kMassb = 0;
- a.kMassd = 0;
- a.kMassc = 0;
- a.kMasse = 0;
- a.kMassf = 0;
- return 7
- }(a) : 0 == b ? function (a) {
- var b = 0;
- 0 != a.kMassa ? a.kMassa = 1 / a.kMassa : (a.kMassa = 0, b |= 1);
- 0 != a.kMassd ? a.kMassd = 1 / a.kMassd : (a.kMassd = 0, b |= 2);
- 0 != a.kMassf ? a.kMassf = 1 / a.kMassf : (a.kMassf = 0, b |= 4);
- a.kMassb = a.kMassc = a.kMasse = 0;
- return b
- }(a) : function (a) {
- b = 1 / b;
- var d = b * (a.kMasse * a.kMassc - a.kMassb * a.kMassf),
- c = b * (a.kMassa * a.kMassf - a.kMassc * a.kMassc),
- e = b * (a.kMassb * a.kMasse -
- a.kMassc * a.kMassd),
- g = b * (a.kMassb * a.kMassc - a.kMassa * a.kMasse),
- f = b * (a.kMassa * a.kMassd - a.kMassb * a.kMassb);
- a.kMassa = b * (a.kMassd * a.kMassf - a.kMasse * a.kMasse);
- a.kMassb = d;
- a.kMassd = c;
- a.kMassc = e;
- a.kMasse = g;
- a.kMassf = f;
- return 0
- }(a)
- }(this);
- 0 != (d & 1) && (this.jAccx = 0);
- 0 != (d & 2) && (this.jAccy = 0);
- 0 != (d & 4) && (this.jAccz = 0);
- if (this.stiff) this.gamma = this.biasz = this.biasy = this.biasx = 0;
- else {
- var e, d = function (b) {
- var d = 2 * Math.PI * b.frequency;
- b.gamma = 1 / (a * d * (2 * b.damping + d * a));
- var c = 1 / (1 + b.gamma);
- e = a * d * d * b.gamma;
- b.gamma *= c;
- return c
- }(this);
- this.kMassa *= d;
- this.kMassb *= d;
- this.kMassd *= d;
- this.kMassc *= d;
- this.kMasse *= d;
- this.kMassf *= d;
- this.biasx = this.b2.posx + this.a2relx - (this.b1.posx + this.a1relx);
- this.biasy = this.b2.posy + this.a2rely - (this.b1.posy + this.a1rely);
- this.biasz = this.b2.rot - this.b1.rot - this.phase;
- if (this.breakUnderError && this.biasx * this.biasx + this.biasy * this.biasy + this.biasz * this.biasz > this.maxError * this.maxError) return !0;
- c = d = -e;
- this.biasx *= c;
- this.biasy *= c;
- this.biasz *= d;
- d = this.maxError;
- c = this.biasx * this.biasx + this.biasy * this.biasy +
- this.biasz * this.biasz;
- c > d * d && (d = c = d * (1 / Math.sqrt(c)), this.biasx *= d, this.biasy *= d, this.biasz *= c)
- }
- c = d = b;
- this.jAccx *= c;
- this.jAccy *= c;
- this.jAccz *= d;
- this.jMax = this.maxForce * a;
- return !1
- },
- clearcache: function () {
- this.jAccz = this.jAccy = this.jAccx = 0;
- this.pre_dt = -1
- },
- pair_exists: function (a, b) {
- return this.b1.id == a && this.b2.id == b || this.b1.id == b && this.b2.id == a
- },
- forest: function () {
- if (this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC) {
- var a = this.b1.component == this.b1.component.parent ? this.b1.component : function (a) {
- a =
- a.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this);
- a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++))
- }
- this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && (a = this.b2.component == this.b2.component.parent ?
- this.b2.component : function (a) {
- a = a.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), b = this.component == this.component.parent ? this.component : function (a) {
- a = a.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), a != b && (a.rank < b.rank ? a.parent = b : a.rank > b.rank ? b.parent = a : (b.parent = a, a.rank++)))
- },
- wake_connected: function () {
- null != this.b1 && this.b1.type ==
- c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b1.wake();
- null != this.b2 && this.b2.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && this.b2.wake()
- },
- validate: function () {
- if (null == this.b1 || null == this.b2) throw "Error: AngleJoint cannot be simulated null bodies";
- if (this.b1 == this.b2) throw "Error: WeldJoint cannot be simulated with body1 == body2";
- 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";
- 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";
- },
- copy: function (a, b) {
- var d = new h.constraint.PivotJoint(null, null, this.outer_zn.get_anchor1(), this.outer_zn.get_anchor2());
- this.copyto(d);
- if (null != a && null != this.b1) {
- for (var g = null, e = 0; e < a.length;) {
- var f = a[e];
- ++e;
- if (f.id == this.b1.id) {
- g = f.bc;
- break
- }
- }
- null != g ? d.zpp_inner_zn.b1 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b1.id, function (a) {
- d.zpp_inner_zn.b1 =
- a.zpp_inner
- }))
- }
- if (null != a && null != this.b2) {
- g = null;
- for (e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == this.b2.id) {
- g = f.bc;
- break
- }
- null != g ? d.zpp_inner_zn.b2 = g.zpp_inner : b.push(c.constraint.ZPP_CopyHelper.todo(this.b2.id, function (a) {
- d.zpp_inner_zn.b2 = a.zpp_inner
- }))
- }
- return d
- },
- setup_a2: function () {
- this.wrap_a2 = h.geom.Vec2.get(this.a2localx, this.a2localy, null);
- this.wrap_a2.zpp_inner._inuse = !0;
- this.wrap_a2.zpp_inner._validate = A(this, this.validate_a2);
- this.wrap_a2.zpp_inner._invalidate = A(this, this.invalidate_a2)
- },
- invalidate_a2: function (a) {
- this.immutable_midstep("Constraint::a2");
- this.a2localx = a.x;
- this.a2localy = a.y;
- this.wake()
- },
- validate_a2: function () {
- this.wrap_a2.zpp_inner.x = this.a2localx;
- this.wrap_a2.zpp_inner.y = this.a2localy
- },
- setup_a1: function () {
- this.wrap_a1 = h.geom.Vec2.get(this.a1localx, this.a1localy, null);
- this.wrap_a1.zpp_inner._inuse = !0;
- this.wrap_a1.zpp_inner._validate = A(this, this.validate_a1);
- this.wrap_a1.zpp_inner._invalidate = A(this, this.invalidate_a1)
- },
- invalidate_a1: function (a) {
- this.immutable_midstep("Constraint::a1");
- this.a1localx = a.x;
- this.a1localy = a.y;
- this.wake()
- },
- validate_a1: function () {
- this.wrap_a1.zpp_inner.x = this.a1localx;
- this.wrap_a1.zpp_inner.y = this.a1localy
- },
- inactiveBodies: function () {
- null != this.b1 && this.b1.constraints.remove(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.remove(this)
- },
- activeBodies: function () {
- null != this.b1 && this.b1.constraints.add(this);
- this.b2 != this.b1 && null != this.b2 && this.b2.constraints.add(this)
- },
- bodyImpulse: function (a) {
- return this.stepped ? a == this.b1 ? h.geom.Vec3.get(-this.jAccx, -this.jAccy, -(this.jAccy * this.a1relx - this.jAccx *
- 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)
- },
- __class__: c.constraint.ZPP_WeldJoint
- });
- c.dynamics = {};
- c.dynamics.ZPP_Arbiter = function () {
- this.colarb = this.fluidarb = this.sensorarb = null;
- this.type = 0;
- this.b1 = this.b2 = this.ws1 = this.ws2 = this.pair = null;
- this.invalidated = !1;
- this.immState = 0;
- this.intchange = this.presentable = this.continuous = this.fresh = !1;
- this.present = 0;
- this.active = this.cleared = this.sleeping = !1;
- this.id =
- this.di = this.stamp = this.up_stamp = this.sleep_stamp = this.endGenerated = 0;
- this.outer = this.hnext = null
- };
- s["zpp_nape.dynamics.ZPP_Arbiter"] = c.dynamics.ZPP_Arbiter;
- c.dynamics.ZPP_Arbiter.__name__ = ["zpp_nape", "dynamics", "ZPP_Arbiter"];
- c.dynamics.ZPP_Arbiter.prototype = {
- sup_retire: function () {
- 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));
- this.b1 = this.b2 = null;
- this.intchange = this.active = !1
- },
- sup_assign: function (a,
- b, d, c) {
- this.b1 = a.body;
- this.ws1 = a;
- this.b2 = b.body;
- this.ws2 = b;
- this.id = d;
- this.di = c;
- this.b1.arbiters.inlined_add(this);
- this.b2.arbiters.inlined_add(this);
- this.active = !0;
- this.present = 0;
- this.presentable = this.fresh = this.sleeping = this.cleared = !1
- },
- lazyRetire: function (a, b) {
- this.cleared = !0;
- null != b && this.b2 != b || this.b1.arbiters.inlined_try_remove(this);
- null != b && this.b1 != b || this.b2.arbiters.inlined_try_remove(this);
- null != this.pair && (this.pair = this.pair.arb = null);
- this.active = !1;
- a.f_arbiters.modified = !0
- },
- swap_features: function () {
- var a =
- this.b1;
- this.b1 = this.b2;
- this.b2 = a;
- a = this.ws1;
- this.ws1 = this.ws2;
- this.ws2 = a;
- a = this.colarb.s1;
- this.colarb.s1 = this.colarb.s2;
- this.colarb.s2 = a
- },
- acting: function () {
- return this.active && 0 != (this.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT)
- },
- inactiveme: function () {
- return !this.active
- },
- wrapper: function () {
- 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 ?
- (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);
- return this.outer
- },
- __class__: c.dynamics.ZPP_Arbiter
- };
- c.dynamics.ZPP_SensorArbiter = function () {
- this.next = null;
- c.dynamics.ZPP_Arbiter.call(this);
- this.type = c.dynamics.ZPP_Arbiter.SENSOR;
- this.sensorarb = this
- };
- s["zpp_nape.dynamics.ZPP_SensorArbiter"] = c.dynamics.ZPP_SensorArbiter;
- c.dynamics.ZPP_SensorArbiter.__name__ = ["zpp_nape",
- "dynamics", "ZPP_SensorArbiter"
- ];
- c.dynamics.ZPP_SensorArbiter.__super__ = c.dynamics.ZPP_Arbiter;
- c.dynamics.ZPP_SensorArbiter.prototype = I(c.dynamics.ZPP_Arbiter.prototype, {
- makeimmutable: function () {},
- makemutable: function () {},
- retire: function () {
- 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));
- this.b1 = this.b2 = null;
- this.intchange = this.active = !1;
- this.next = c.dynamics.ZPP_SensorArbiter.zpp_pool;
- c.dynamics.ZPP_SensorArbiter.zpp_pool =
- this
- },
- assign: function (a, b, d, c) {
- this.b1 = a.body;
- this.ws1 = a;
- this.b2 = b.body;
- this.ws2 = b;
- this.id = d;
- this.di = c;
- this.b1.arbiters.inlined_add(this);
- this.b2.arbiters.inlined_add(this);
- this.active = !0;
- this.present = 0;
- this.presentable = this.fresh = this.sleeping = this.cleared = !1
- },
- free: function () {},
- alloc: function () {},
- __class__: c.dynamics.ZPP_SensorArbiter
- });
- c.dynamics.ZPP_FluidArbiter = function () {
- this.pre_dt = 0;
- this.mutable = !1;
- this.wrap_position = null;
- this.wMass = this.adamp = this.agamma = this.vMassa = this.vMassb = this.vMassc =
- this.dampx = this.dampy = this.lgamma = this.nx = this.ny = this.buoyx = this.buoyy = 0;
- this.nodrag = !1;
- this.centroidx = this.centroidy = this.overlap = this.r1x = this.r1y = this.r2x = this.r2y = 0;
- this.outer_zn = this.next = null;
- c.dynamics.ZPP_Arbiter.call(this);
- this.type = c.dynamics.ZPP_Arbiter.FLUID;
- this.fluidarb = this;
- this.buoyy = this.buoyx = 0;
- this.pre_dt = -1
- };
- s["zpp_nape.dynamics.ZPP_FluidArbiter"] = c.dynamics.ZPP_FluidArbiter;
- c.dynamics.ZPP_FluidArbiter.__name__ = ["zpp_nape", "dynamics", "ZPP_FluidArbiter"];
- c.dynamics.ZPP_FluidArbiter.__super__ =
- c.dynamics.ZPP_Arbiter;
- c.dynamics.ZPP_FluidArbiter.prototype = I(c.dynamics.ZPP_Arbiter.prototype, {
- applyImpulseVel: function () {
- if (!this.nodrag) {
- var a = this.b1.angvel + this.b1.kinangvel,
- b = this.b2.angvel + this.b2.kinangvel,
- d = this.b1.velx + this.b1.kinvelx - this.r1y * a - (this.b2.velx + this.b2.kinvelx - this.r2y * b),
- c = this.b1.vely + this.b1.kinvely + this.r1x * a - (this.b2.vely + this.b2.kinvely + this.r2x * b),
- e = this.vMassa * d + this.vMassb * c,
- c = this.vMassb * d + this.vMassc * c,
- d = e,
- e = this.lgamma,
- d = d - this.dampx * e,
- c = c - this.dampy * e,
- e = 1;
- this.dampx +=
- d * e;
- this.dampy += c * e;
- e = this.b1.imass;
- this.b1.velx -= d * e;
- this.b1.vely -= c * e;
- e = this.b2.imass;
- this.b2.velx += d * e;
- this.b2.vely += c * e;
- this.b1.angvel -= this.b1.iinertia * (c * this.r1x - d * this.r1y);
- this.b2.angvel += this.b2.iinertia * (c * this.r2x - d * this.r2y);
- a = (a - b) * this.wMass - this.adamp * this.agamma;
- this.adamp += a;
- this.b1.angvel -= a * this.b1.iinertia;
- this.b2.angvel += a * this.b2.iinertia
- }
- },
- warmStart: function () {
- var a = this.b1.imass;
- this.b1.velx -= this.dampx * a;
- this.b1.vely -= this.dampy * a;
- a = this.b2.imass;
- this.b2.velx += this.dampx *
- a;
- this.b2.vely += this.dampy * a;
- this.b1.angvel -= this.b1.iinertia * (this.dampy * this.r1x - this.dampx * this.r1y);
- this.b2.angvel += this.b2.iinertia * (this.dampy * this.r2x - this.dampx * this.r2y);
- this.b1.angvel -= this.adamp * this.b1.iinertia;
- this.b2.angvel += this.adamp * this.b2.iinertia
- },
- preStep: function (a, b) {
- -1 == this.pre_dt && (this.pre_dt = b);
- var d = b / this.pre_dt;
- this.pre_dt = b;
- this.r1x = this.centroidx - this.b1.posx;
- this.r1y = this.centroidy - this.b1.posy;
- this.r2x = this.centroidx - this.b2.posx;
- this.r2y = this.centroidy - this.b2.posy;
- var g = 0,
- e = 0;
- 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);
- var f = 0,
- l = 0;
- 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);
- var m = 0,
- u = 0;
- if (this.ws1.fluidEnabled && this.ws2.fluidEnabled) {
- var p = this.overlap * this.ws1.fluidProperties.density,
- k = this.overlap * this.ws2.fluidProperties.density;
- if (p > k) var r = p + k,
- m = m - g * r,
- u = u - e * r;
- else if (p < k) r = p + k, m += f * r, u += l * r;
- else {
- var n = 0,
- w = 0,
- r = 0.5,
- n = (g + f) * r,
- w = (e + l) * r;
- 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)
- }
- } 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);
- r = b;
- m *= r;
- u *= r;
- this.buoyx = m;
- this.buoyy = u;
- this.b1.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC &&
- (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);
- 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);
- if (this.ws1.fluidEnabled && 0 != this.ws1.fluidProperties.viscosity || this.ws2.fluidEnabled && 0 != this.ws2.fluidProperties.viscosity) {
- this.nodrag = !1;
- var t = 0;
- this.ws1.fluidEnabled && (this.ws2.validate_angDrag(), t += this.ws1.fluidProperties.viscosity *
- this.ws2.angDrag * this.overlap / this.ws2.area);
- this.ws2.fluidEnabled && (this.ws1.validate_angDrag(), t += this.ws2.fluidProperties.viscosity * this.ws1.angDrag * this.overlap / this.ws1.area);
- 0 != t ? (r = this.b1.sinertia + this.b2.sinertia, this.wMass = 0 != r ? 1 / r : 0, t *= 4E-4, this.wMass *= function (a) {
- var d = 2 * Math.PI * t;
- a.agamma = 1 / (b * d * (2 + d * b));
- d = 1 / (1 + a.agamma);
- a.agamma *= d;
- return d
- }(this)) : this.agamma = this.wMass = 0;
- g = this.b2.velx + this.b2.kinvelx - this.r2y * (this.b2.angvel + this.b2.kinangvel) - (this.b1.velx + this.b1.kinvelx - this.r1y *
- (this.b2.angvel + this.b2.kinangvel));
- 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));
- 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);
- var q = 0;
- if (this.ws1.fluidEnabled)
- 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 *
- Math.PI);
- else {
- f = this.ws2.polygon;
- e = g = 0;
- 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;
- q += e / g
- }
- if (this.ws2.fluidEnabled)
- 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);
- else {
- f = this.ws1.polygon;
- e = g = 0;
- 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;
- q += e / g
- }
- 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 ?
- 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) {
- var d = 2 * Math.PI * q;
- a.lgamma = 1 / (b * d * (2 + d * b));
- d = 1 / (1 + a.lgamma);
- a.lgamma *= d;
- return d
- }(this), this.vMassa *= r, this.vMassb *= r, this.vMassc *= r) : this.lgamma = this.vMassc = this.vMassb = this.vMassa = 0
- } else this.nodrag = !0, this.adamp = this.dampy = this.dampx = 0;
- r = d;
- this.dampx *= r;
- this.dampy *= r;
- this.adamp *= d
- },
- inject: function (a, b, d) {
- this.overlap = a;
- this.centroidx = b;
- this.centroidy = d
- },
- makeimmutable: function () {
- this.mutable = !1;
- null != this.wrap_position && (this.wrap_position.zpp_inner._immutable = !0)
- },
- makemutable: function () {
- this.mutable = !0;
- null != this.wrap_position && (this.wrap_position.zpp_inner._immutable = !1)
- },
- retire: function () {
- 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));
- this.b1 = this.b2 = null;
- this.intchange = this.active = !1;
- this.next = c.dynamics.ZPP_FluidArbiter.zpp_pool;
- c.dynamics.ZPP_FluidArbiter.zpp_pool = this;
- this.pre_dt = -1
- },
- assign: function (a, b, d, c) {
- this.b1 = a.body;
- this.ws1 = a;
- this.b2 = b.body;
- this.ws2 = b;
- this.id = d;
- this.di = c;
- this.b1.arbiters.inlined_add(this);
- this.b2.arbiters.inlined_add(this);
- this.active = !0;
- this.present = 0;
- this.presentable = this.fresh = this.sleeping = this.cleared = !1;
- this.nx = 0;
- this.ny = 1;
- this.adamp = this.dampy = this.dampx = 0
- },
- getposition: function () {
- this.wrap_position = h.geom.Vec2.get(null, null, null);
- this.wrap_position.zpp_inner._inuse = !0;
- this.wrap_position.zpp_inner._immutable = !this.mutable;
- this.wrap_position.zpp_inner._validate =
- A(this, this.position_validate);
- this.wrap_position.zpp_inner._invalidate = A(this, this.position_invalidate)
- },
- position_invalidate: function (a) {
- this.centroidx = a.x;
- this.centroidy = a.y
- },
- position_validate: function () {
- if (!this.active) throw "Error: Arbiter not currently in use";
- this.wrap_position.zpp_inner.x = this.centroidx;
- this.wrap_position.zpp_inner.y = this.centroidy
- },
- free: function () {},
- alloc: function () {},
- __class__: c.dynamics.ZPP_FluidArbiter
- });
- c.dynamics.ZPP_ColArbiter = function () {
- this.pre_dt = 0;
- this.stat = this.mutable = !1;
- this.next = null;
- this.hc2 = this.hpc2 = !1;
- this.c1 = this.oc1 = this.c2 = this.oc2 = null;
- this.__ref_vertex = 0;
- this.__ref_edge1 = this.__ref_edge2 = null;
- this.biasCoef = 0;
- this.rev = !1;
- 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;
- this.wrap_normal = null;
- this.nx = this.ny = 0;
- this.s1 = this.s2 = this.contacts =
- this.wrap_contacts = this.innards = null;
- this.userdef_dyn_fric = this.userdef_stat_fric = this.userdef_restitution = this.userdef_rfric = !1;
- this.dyn_fric = this.stat_fric = this.restitution = this.rfric = 0;
- this.outer_zn = null;
- c.dynamics.ZPP_Arbiter.call(this);
- this.pre_dt = -1;
- this.contacts = new c.dynamics.ZPP_Contact;
- this.innards = new c.dynamics.ZPP_IContact;
- this.type = c.dynamics.ZPP_Arbiter.COL;
- this.colarb = this
- };
- s["zpp_nape.dynamics.ZPP_ColArbiter"] = c.dynamics.ZPP_ColArbiter;
- c.dynamics.ZPP_ColArbiter.__name__ = ["zpp_nape",
- "dynamics", "ZPP_ColArbiter"
- ];
- c.dynamics.ZPP_ColArbiter.__super__ = c.dynamics.ZPP_Arbiter;
- c.dynamics.ZPP_ColArbiter.prototype = I(c.dynamics.ZPP_Arbiter.prototype, {
- applyImpulsePos: function () {
- if (2 == this.ptype) {
- var a = this.c1,
- b = 0,
- d = 0,
- b = this.b2.axisy * a.lr2x - this.b2.axisx * a.lr2y,
- d = a.lr2x * this.b2.axisx + a.lr2y * this.b2.axisy,
- c = 1,
- b = b + this.b2.posx * c,
- d = d + this.b2.posy * c,
- e = 0,
- f = 0,
- e = this.b1.axisy * a.lr1x - this.b1.axisx * a.lr1y,
- f = a.lr1x * this.b1.axisx + a.lr1y * this.b1.axisy,
- c = 1,
- e = e + this.b1.posx * c,
- f = f + this.b1.posy * c,
- l = a = 0,
- a = b - e,
- l = d - f,
- m = Math.sqrt(a * a + l * l),
- u = this.radius - h.Config.collisionSlop,
- c = m - u;
- 0 > a * this.nx + l * this.ny && (a = -a, l = -l, c -= this.radius);
- 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,
- 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))))
- } else {
- var p = f = a = l = 0,
- u = m = 0;
- 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 +=
- 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 =
- 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));
- c = f * l + p * a - b - this.radius;
- c += h.Config.collisionSlop;
- e = 0;
- this.hpc2 && (e = m * l + u * a - b - this.radius, e += h.Config.collisionSlop);
- if (0 > c || 0 > e) {
- this.rev && (l = -l, a = -a);
- var k = 0,
- r = 0,
- k = f - this.b1.posx,
- r = p - this.b1.posy,
- d = b = 0,
- b = f - this.b2.posx,
- d = p - this.b2.posy,
- n = 0,
- w = 0,
- p = f = 0;
- if (this.hpc2) {
- n = m - this.b1.posx;
- w = u - this.b1.posy;
- f = m - this.b2.posx;
- p = u - this.b2.posy;
- m = a * k - l * r;
- u = a * b -
- l * d;
- b = a * n - l * w;
- d = a * f - l * p;
- f = this.b1.smass + this.b2.smass;
- this.kMassa = f + this.b1.sinertia * m * m + this.b2.sinertia * u * u;
- this.kMassb = f + this.b1.sinertia * m * b + this.b2.sinertia * u * d;
- this.kMassc = f + this.b1.sinertia * b * b + this.b2.sinertia * d * d;
- var p = f = k = 0,
- k = this.kMassa,
- f = this.kMassb,
- p = this.kMassc,
- r = c * this.biasCoef,
- w = e * this.biasCoef,
- n = e = 0,
- e = -r,
- n = -w,
- t = this.kMassa * this.kMassc - this.kMassb * this.kMassb;
- 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),
- n = t * (this.kMassa * n - this.kMassb * e), e = c);
- 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))) :
- (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)))))
- } 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 +=
- u * c, this.b2.posy += d * c, this.b2.delta_rot(b * this.b2.iinertia * m))
- }
- }
- },
- applyImpulseVel: function () {
- var a, b, d, c, e;
- c = this.k1x + this.b2.velx - this.c1.r2y * this.b2.angvel - (this.b1.velx - this.c1.r1y * this.b1.angvel);
- var f = this.k1y + this.b2.vely + this.c1.r2x * this.b2.angvel - (this.b1.vely + this.c1.r1x * this.b1.angvel);
- d = (f * this.nx - c * this.ny + this.surfacex) * this.c1.tMass;
- c = this.c1.friction * this.c1.jnAcc;
- a = this.c1.jtAcc;
- e = a - d;
- e > c ? e = c : e < -c && (e = -c);
- d = e - a;
- this.c1.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.rt1b * d * this.b2.iinertia;
- this.b1.angvel -= this.rt1a * d * this.b1.iinertia;
- 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),
- 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 -
- 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 =
- 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,
- 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 *
- 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)
- },
- warmStart: function () {
- var a = this.nx * this.c1.jnAcc - this.ny * this.c1.jtAcc,
- b = this.ny * this.c1.jnAcc + this.nx * this.c1.jtAcc,
- d = this.b1.imass;
- this.b1.velx -= a * d;
- this.b1.vely -= b * d;
- this.b1.angvel -= this.b1.iinertia * (b * this.c1.r1x - a * this.c1.r1y);
- d = this.b2.imass;
- this.b2.velx += a * d;
- this.b2.vely += b * d;
- this.b2.angvel +=
- this.b2.iinertia * (b * this.c1.r2x - a * this.c1.r2y);
- 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));
- this.b2.angvel += this.jrAcc * this.b2.iinertia;
- this.b1.angvel -= this.jrAcc * this.b1.iinertia
- },
- preStep: function (a) {
- 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 >= 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))); - 1 == this.pre_dt && (this.pre_dt = a);
- var b = a / this.pre_dt;
- this.pre_dt = a;
- var d = this.b1.smass + this.b2.smass;
- this.hc2 = !1;
- a = !0;
- this.biasCoef = this.b1.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || this.b2.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC ? this.continuous ?
- h.Config.contactContinuousStaticBiasCoef : h.Config.contactStaticBiasCoef : this.continuous ? h.Config.contactContinuousBiasCoef : h.Config.contactBiasCoef;
- this.continuous = !1;
- for (var g = null, e = null, f = this.innards.next, l = this.contacts.next; null != l;) {
- var m = l;
- 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;
- else {
- g = m.inner;
- e = m.active;
- m.active = m.stamp == this.stamp;
- if (m.active) {
- a ? (a = !1, this.c1 = g, this.oc1 = m) : (this.hc2 = !0, this.c2 = g, this.oc2 = m);
- g.r2x = m.px - this.b2.posx;
- g.r2y = m.py - this.b2.posy;
- g.r1x = m.px - this.b1.posx;
- g.r1y = m.py - this.b1.posy;
- var u = d + this.b2.sinertia * c.util.ZPP_Math.sqr(g.r2x * this.nx + g.r2y * this.ny),
- u = u + this.b1.sinertia * c.util.ZPP_Math.sqr(g.r1x * this.nx + g.r1y * this.ny);
- g.tMass = u < h.Config.epsilon * h.Config.epsilon ? 0 : 1 / u;
- u = d + this.b2.sinertia * c.util.ZPP_Math.sqr(this.ny * g.r2x - this.nx * g.r2y);
- u += this.b1.sinertia * c.util.ZPP_Math.sqr(this.ny * g.r1x - this.nx * g.r1y);
- g.nMass = u < h.Config.epsilon * h.Config.epsilon ? 0 : 1 / u;
- var p = u = 0,
- k = this.b2.angvel + this.b2.kinangvel,
- u = this.b2.velx + this.b2.kinvelx - g.r2y * k,
- p = this.b2.vely + this.b2.kinvely + g.r2x * k,
- k = this.b1.angvel + this.b1.kinangvel,
- u = u - (this.b1.velx + this.b1.kinvelx - g.r1y * k),
- p = p - (this.b1.vely + this.b1.kinvely + g.r1x * k),
- k = this.nx * u + this.ny * p;
- m.elasticity = this.restitution;
- g.bounce = k * m.elasticity;
- g.bounce > -h.Config.elasticThreshold && (g.bounce = 0);
- k = p * this.nx - u * this.ny;
- u = h.Config.staticFrictionThreshold;
- g.friction = k * k > u * u ? this.dyn_fric :
- this.stat_fric;
- g.jnAcc *= b;
- g.jtAcc *= b
- }
- e != m.active && (this.contacts.modified = !0);
- g = l;
- e = f;
- f = f.next;
- l = l.next
- }
- }
- 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;
- this.jrAcc *= b;
- 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 +
- 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));
- 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 -
- 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 *
- (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 =
- this.c2, this.c2 = d), this.oc2.active = !1, this.contacts.modified = !0));
- this.surfacex = this.b2.svelx;
- this.surfacey = this.b2.svely;
- d = 1;
- this.surfacex += this.b1.svelx * d;
- this.surfacey += this.b1.svely * d;
- this.surfacex = -this.surfacex;
- this.surfacey = -this.surfacey;
- this.rMass = this.b1.sinertia + this.b2.sinertia;
- 0 != this.rMass && (this.rMass = 1 / this.rMass);
- return a
- },
- cleanupContacts: function () {
- var a = !0,
- b = null,
- d = null,
- g = this.innards.next;
- this.hc2 = !1;
- for (var e = this.contacts.next; null != e;) {
- var f = e;
- f.stamp + h.Config.arbiterExpirationDelay <
- 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)
- }
- 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 &&
- (this.hc2 = !1), this.oc1.posOnly && (a = !0)) : this.hpc2 = !1;
- return a
- },
- setupcontacts: function () {
- this.wrap_contacts = c.util.ZPP_ContactList.get(this.contacts, !0);
- this.wrap_contacts.zpp_inner.immutable = !this.mutable;
- this.wrap_contacts.zpp_inner.adder = A(this, this.contacts_adder);
- this.wrap_contacts.zpp_inner.dontremove = !0;
- this.wrap_contacts.zpp_inner.subber = A(this, this.contacts_subber)
- },
- contacts_subber: function (a) {
- for (var b = null, d = null, g = this.innards.next, e = this.contacts.next; null != e;) {
- var f = e;
- if (f == a.zpp_inner) {
- this.contacts.erase(b);
- this.innards.erase(d);
- a = f;
- a.arbiter = null;
- a.next = c.dynamics.ZPP_Contact.zpp_pool;
- c.dynamics.ZPP_Contact.zpp_pool = a;
- break
- }
- b = e;
- d = g;
- g = g.next;
- e = e.next
- }
- },
- contacts_adder: function (a) {
- throw "Error: Cannot add new contacts, information required is far too specific and detailed :)";
- },
- makeimmutable: function () {
- this.mutable = !1;
- null != this.wrap_normal && (this.wrap_normal.zpp_inner._immutable = !0);
- null != this.wrap_contacts && (this.wrap_contacts.zpp_inner.immutable = !0)
- },
- makemutable: function () {
- this.mutable = !0;
- null != this.wrap_normal &&
- (this.wrap_normal.zpp_inner._immutable = !1);
- null != this.wrap_contacts && (this.wrap_contacts.zpp_inner.immutable = !1)
- },
- retire: function () {
- 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));
- this.b1 = this.b2 = null;
- for (this.intchange = this.active = !1; null != this.contacts.next;) {
- var a = this.contacts.inlined_pop_unsafe();
- a.arbiter = null;
- a.next = c.dynamics.ZPP_Contact.zpp_pool;
- c.dynamics.ZPP_Contact.zpp_pool = a;
- this.innards.inlined_pop()
- }
- a =
- this;
- a.userdef_dyn_fric = !1;
- a.userdef_stat_fric = !1;
- a.userdef_restitution = !1;
- a.userdef_rfric = !1;
- a.__ref_edge1 = a.__ref_edge2 = null;
- a.next = c.dynamics.ZPP_ColArbiter.zpp_pool;
- c.dynamics.ZPP_ColArbiter.zpp_pool = a;
- this.pre_dt = -1
- },
- validate_props: function () {
- 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 >=
- 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)))
- },
- calcProperties: function () {
- 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 *
- 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))
- },
- assign: function (a, b, d, c) {
- this.b1 = a.body;
- this.ws1 = a;
- this.b2 = b.body;
- this.ws2 = b;
- this.id = d;
- this.di = c;
- this.b1.arbiters.inlined_add(this);
- this.b2.arbiters.inlined_add(this);
- this.active = !0;
- this.present = 0;
- this.presentable = this.fresh = this.sleeping =
- this.cleared = !1;
- this.s1 = a;
- this.s2 = b;
- 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 *
- 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))
- },
- injectContact: function (a, b, d, g, e, f, l) {
- null == l && (l = !1);
- for (var m = null, h = this.contacts.next; null != h;) {
- var p = h;
- if (f == p.hash) {
- m = p;
- break
- }
- h = h.next
- }
- null == m ? (null == c.dynamics.ZPP_Contact.zpp_pool ? m = new c.dynamics.ZPP_Contact : (m = c.dynamics.ZPP_Contact.zpp_pool,
- 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;
- m.px = a;
- m.py = b;
- this.nx = d;
- this.ny = g;
- m.dist = e;
- m.stamp = this.stamp;
- m.posOnly = l;
- return m
- },
- free: function () {
- this.userdef_rfric = this.userdef_restitution = this.userdef_stat_fric = this.userdef_dyn_fric = !1;
- this.__ref_edge1 = this.__ref_edge2 = null
- },
- alloc: function () {},
- getnormal: function () {
- this.wrap_normal = h.geom.Vec2.get(0,
- 0, null);
- this.wrap_normal.zpp_inner._immutable = !0;
- this.wrap_normal.zpp_inner._inuse = !0;
- this.wrap_normal.zpp_inner._validate = A(this, this.normal_validate)
- },
- normal_validate: function () {
- if (this.cleared) throw "Error: Arbiter not currently in use";
- this.wrap_normal.zpp_inner.x = this.nx;
- this.wrap_normal.zpp_inner.y = this.ny
- },
- __class__: c.dynamics.ZPP_ColArbiter
- });
- c.dynamics.ZPP_Contact = function () {
- this.length = 0;
- this._inuse = this.modified = this.pushmod = !1;
- this.next = null;
- this.dist = this.elasticity = 0;
- this.fresh = !1;
- this.stamp =
- this.hash = 0;
- this.active = this.posOnly = !1;
- this.wrap_position = this.arbiter = this.inner = null;
- this.px = this.py = 0;
- this.outer = null;
- this.inner = new c.dynamics.ZPP_IContact
- };
- s["zpp_nape.dynamics.ZPP_Contact"] = c.dynamics.ZPP_Contact;
- c.dynamics.ZPP_Contact.__name__ = ["zpp_nape", "dynamics", "ZPP_Contact"];
- c.dynamics.ZPP_Contact.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a : null
- },
- iterator_at: function (a) {
- for (var b = this.next; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.next, b =
- a; null != b;) a = b, b = b.next;
- return a
- },
- front: function () {
- return this.next
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.next; null != d;) {
- if (d == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.next
- },
- reverse: function () {
- for (var a = this.next, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.next = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {},
- clear: function () {},
- splice: function (a, b) {
- for (; 0 < b-- && null !=
- a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- b._inuse = !1;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.next;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.next;
- this.next = a.next;
- a._inuse = !1;
- null == this.next && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- b._inuse = !0;
- null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
- this.pushmod = this.modified = !0;
- this.length++;
- return b
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.next; null != a;) this.add(a), a = a.next
- },
- inlined_add: function (a) {
- a._inuse = !0;
- a.next = this.next;
- this.next = a;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.next = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.next
- },
- elem: function () {
- return this
- },
- alloc: function () {},
- free: function () {
- this.arbiter = null
- },
- inactiveme: function () {
- return !(this.active && null != this.arbiter && this.arbiter.active)
- },
- getposition: function () {
- this.wrap_position = h.geom.Vec2.get(null, null, null);
- this.wrap_position.zpp_inner._inuse = !0;
- this.wrap_position.zpp_inner._immutable = !0;
- this.wrap_position.zpp_inner._validate = A(this, this.position_validate)
- },
- position_validate: function () {
- if (this.inactiveme()) throw "Error: Contact not currently in use";
- this.wrap_position.zpp_inner.x = this.px;
- this.wrap_position.zpp_inner.y =
- this.py
- },
- wrapper: function () {
- 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);
- return this.outer
- },
- __class__: c.dynamics.ZPP_Contact
- };
- c.dynamics.ZPP_IContact = function () {
- this.length = 0;
- this._inuse = this.modified = this.pushmod = !1;
- this.next = null;
- 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
- };
- s["zpp_nape.dynamics.ZPP_IContact"] =
- c.dynamics.ZPP_IContact;
- c.dynamics.ZPP_IContact.__name__ = ["zpp_nape", "dynamics", "ZPP_IContact"];
- c.dynamics.ZPP_IContact.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a : null
- },
- iterator_at: function (a) {
- for (var b = this.next; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.next, b = a; null != b;) a = b, b = b.next;
- return a
- },
- front: function () {
- return this.next
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.next; null != d;) {
- if (d == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.next
- },
- reverse: function () {
- for (var a = this.next, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.next = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {},
- clear: function () {},
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- b._inuse = !1;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a =
- this.next;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.next;
- this.next = a.next;
- a._inuse = !1;
- null == this.next && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- b._inuse = !0;
- null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
- this.pushmod = this.modified = !0;
- this.length++;
- return b
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.next; null !=
- a;) this.add(a), a = a.next
- },
- inlined_add: function (a) {
- a._inuse = !0;
- a.next = this.next;
- this.next = a;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.next = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.next
- },
- elem: function () {
- return this
- },
- __class__: c.dynamics.ZPP_IContact
- };
- c.dynamics.ZPP_InteractionFilter = function () {
- this.collisionGroup = this.collisionMask = this.sensorGroup = this.sensorMask = this.fluidGroup = this.fluidMask = 0;
- this.next = this.userData =
- this.outer = this.shapes = this.wrap_shapes = null;
- this.shapes = new c.util.ZNPList_ZPP_Shape;
- this.collisionGroup = this.sensorGroup = this.fluidGroup = 1;
- this.collisionMask = this.sensorMask = this.fluidMask = -1
- };
- s["zpp_nape.dynamics.ZPP_InteractionFilter"] = c.dynamics.ZPP_InteractionFilter;
- c.dynamics.ZPP_InteractionFilter.__name__ = ["zpp_nape", "dynamics", "ZPP_InteractionFilter"];
- c.dynamics.ZPP_InteractionFilter.prototype = {
- invalidate: function () {
- for (var a = this.shapes.head; null != a;) a.elt.invalidate_filter(), a = a.next
- },
- shouldFlow: function (a) {
- return 0 != (this.fluidMask & a.fluidGroup) && 0 != (a.fluidMask & this.fluidGroup)
- },
- shouldSense: function (a) {
- return 0 != (this.sensorMask & a.sensorGroup) && 0 != (a.sensorMask & this.sensorGroup)
- },
- shouldCollide: function (a) {
- return 0 != (this.collisionMask & a.collisionGroup) && 0 != (a.collisionMask & this.collisionGroup)
- },
- copy: function () {
- var a;
- 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 =
- a.next, a.next = null);
- null;
- a.collisionGroup = this.collisionGroup;
- a.collisionMask = this.collisionMask;
- a.sensorGroup = this.sensorGroup;
- a.sensorMask = this.sensorMask;
- a.fluidGroup = this.fluidGroup;
- a.fluidMask = this.fluidMask;
- return a
- },
- remShape: function (a) {
- this.shapes.remove(a)
- },
- addShape: function (a) {
- this.shapes.add(a)
- },
- feature_cons: function () {
- this.shapes = new c.util.ZNPList_ZPP_Shape
- },
- alloc: function () {},
- free: function () {
- this.outer = null
- },
- wrapper: function () {
- if (null == this.outer) {
- this.outer = new h.dynamics.InteractionFilter;
- var a = this.outer.zpp_inner;
- a.outer = null;
- a.next = c.dynamics.ZPP_InteractionFilter.zpp_pool;
- c.dynamics.ZPP_InteractionFilter.zpp_pool = a;
- this.outer.zpp_inner = this
- }
- return this.outer
- },
- __class__: c.dynamics.ZPP_InteractionFilter
- };
- c.dynamics.ZPP_InteractionGroup = function () {
- this.depth = 0;
- this.group = this.groups = this.wrap_groups = this.interactors = this.wrap_interactors = null;
- this.ignore = !1;
- this.outer = null;
- this.depth = 0;
- this.groups = new c.util.ZNPList_ZPP_InteractionGroup;
- this.interactors = new c.util.ZNPList_ZPP_Interactor
- };
- s["zpp_nape.dynamics.ZPP_InteractionGroup"] = c.dynamics.ZPP_InteractionGroup;
- c.dynamics.ZPP_InteractionGroup.__name__ = ["zpp_nape", "dynamics", "ZPP_InteractionGroup"];
- c.dynamics.ZPP_InteractionGroup.prototype = {
- remInteractor: function (a, b) {
- this.interactors.remove(a)
- },
- addInteractor: function (a) {
- this.interactors.add(a)
- },
- remGroup: function (a) {
- this.groups.remove(a);
- a.depth = 0
- },
- addGroup: function (a) {
- this.groups.add(a);
- a.depth = this.depth + 1
- },
- invalidate: function (a) {
- null == a && (a = !1);
- if (a || this.ignore) {
- for (var b = this.interactors.head; null !=
- b;) {
- var d = b.elt;
- null != d.ibody ? d.ibody.wake() : null != d.ishape ? d.ishape.body.wake() : d.icompound.wake();
- b = b.next
- }
- for (b = this.groups.head; null != b;) b.elt.invalidate(a), b = b.next
- }
- },
- setGroup: function (a) {
- 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))
- },
- __class__: c.dynamics.ZPP_InteractionGroup
- };
- c.dynamics.ZPP_SpaceArbiterList = function () {
- this.at_index_0 =
- this.at_index_1 = this.at_index_2 = this.at_index_3 = 0;
- this.lengths = this.ite_0 = this.ite_1 = this.ite_2 = this.ite_3 = null;
- this.zip_length = !1;
- this._length = 0;
- this.space = null;
- h.dynamics.ArbiterList.call(this);
- this.at_index_3 = this.at_index_2 = this.at_index_1 = this.at_index_0 = 0;
- this.zip_length = !0;
- this._length = 0;
- this.lengths = [];
- for (var a = 0; 4 > a;) a++, this.lengths.push(0)
- };
- s["zpp_nape.dynamics.ZPP_SpaceArbiterList"] = c.dynamics.ZPP_SpaceArbiterList;
- c.dynamics.ZPP_SpaceArbiterList.__name__ = ["zpp_nape", "dynamics", "ZPP_SpaceArbiterList"];
- c.dynamics.ZPP_SpaceArbiterList.__super__ = h.dynamics.ArbiterList;
- c.dynamics.ZPP_SpaceArbiterList.prototype = I(h.dynamics.ArbiterList.prototype, {
- at: function (a) {
- this.zpp_vm();
- if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
- var b = null,
- d = 0;
- if (null == b)
- if (a < d + this.lengths[0]) {
- b = a - d;
- if (b < this.at_index_0 || null == this.ite_0)
- for (this.at_index_0 = 0, this.ite_0 = this.space.c_arbiters_true.head;;) {
- var c = this.ite_0.elt;
- if (c.active) break;
- this.ite_0 = this.ite_0.next
- }
- for (; this.at_index_0 != b;)
- for (this.at_index_0++,
- this.ite_0 = this.ite_0.next;;) {
- c = this.ite_0.elt;
- if (c.active) break;
- this.ite_0 = this.ite_0.next
- }
- b = this.ite_0.elt.wrapper()
- } else d += this.lengths[0];
- if (null == b)
- if (a < d + this.lengths[1]) {
- b = a - d;
- if (b < this.at_index_1 || null == this.ite_1)
- for (this.at_index_1 = 0, this.ite_1 = this.space.c_arbiters_false.head;;) {
- c = this.ite_1.elt;
- if (c.active) break;
- this.ite_1 = this.ite_1.next
- }
- for (; this.at_index_1 != b;)
- for (this.at_index_1++, this.ite_1 = this.ite_1.next;;) {
- c = this.ite_1.elt;
- if (c.active) break;
- this.ite_1 = this.ite_1.next
- }
- b = this.ite_1.elt.wrapper()
- } else d +=
- this.lengths[1];
- if (null == b)
- if (a < d + this.lengths[2]) {
- b = a - d;
- if (b < this.at_index_2 || null == this.ite_2)
- for (this.at_index_2 = 0, this.ite_2 = this.space.f_arbiters.head;;) {
- c = this.ite_2.elt;
- if (c.active) break;
- this.ite_2 = this.ite_2.next
- }
- for (; this.at_index_2 != b;)
- for (this.at_index_2++, this.ite_2 = this.ite_2.next;;) {
- c = this.ite_2.elt;
- if (c.active) break;
- this.ite_2 = this.ite_2.next
- }
- b = this.ite_2.elt.wrapper()
- } else d += this.lengths[2];
- if (null == b && a < d + this.lengths[3]) {
- b = a - d;
- if (b < this.at_index_3 || null == this.ite_3)
- for (this.at_index_3 =
- 0, this.ite_3 = this.space.s_arbiters.head;;) {
- c = this.ite_3.elt;
- if (c.active) break;
- this.ite_3 = this.ite_3.next
- }
- for (; this.at_index_3 != b;)
- for (this.at_index_3++, this.ite_3 = this.ite_3.next;;) {
- c = this.ite_3.elt;
- if (c.active) break;
- this.ite_3 = this.ite_3.next
- }
- b = this.ite_3.elt.wrapper()
- }
- return b
- },
- clear: function () {
- throw "Error: ArbiterList is immutable";
- },
- remove: function (a) {
- throw "Error: ArbiterList is immutable";
- },
- shift: function () {
- throw "Error: ArbiterList is immutable";
- },
- unshift: function (a) {
- throw "Error: ArbiterList is immutable";
- },
- pop: function () {
- throw "Error: ArbiterList is immutable";
- },
- push: function (a) {
- throw "Error: ArbiterList is immutable";
- },
- zpp_vm: function () {
- var a = !1;
- this.space.c_arbiters_true.modified && (a = !0, this.space.c_arbiters_true.modified = !1);
- this.space.c_arbiters_false.modified && (a = !0, this.space.c_arbiters_false.modified = !1);
- this.space.f_arbiters.modified && (a = !0, this.space.f_arbiters.modified = !1);
- this.space.s_arbiters.modified && (a = !0, this.space.s_arbiters.modified = !1);
- a && (this.zip_length = !0, this._length = 0, this.ite_3 =
- this.ite_2 = this.ite_1 = this.ite_0 = null)
- },
- zpp_gl: function () {
- this.zpp_vm();
- if (this.zip_length) {
- for (var a = this._length = 0, b = 0, d = this.space.c_arbiters_true.head; null != d;) {
- var c = d.elt;
- c.active && b++;
- d = d.next
- }
- this.lengths[a++] = b;
- this._length += b;
- b = 0;
- for (d = this.space.c_arbiters_false.head; null != d;) c = d.elt, c.active && b++, d = d.next;
- this.lengths[a++] = b;
- this._length += b;
- b = 0;
- for (d = this.space.f_arbiters.head; null != d;) c = d.elt, c.active && b++, d = d.next;
- this.lengths[a++] = b;
- this._length += b;
- b = 0;
- for (d = this.space.s_arbiters.head; null !=
- d;) c = d.elt, c.active && b++, d = d.next;
- this.lengths[a++] = b;
- this._length += b;
- this.zip_length = !1
- }
- return this._length
- },
- __class__: c.dynamics.ZPP_SpaceArbiterList
- });
- c.geom = {};
- c.geom.ZPP_AABB = function () {
- this.wrap_max = null;
- this.maxx = this.maxy = 0;
- this.wrap_min = null;
- this.minx = this.miny = 0;
- this.outer = this.next = null;
- this._immutable = !1;
- this._invalidate = this._validate = null
- };
- s["zpp_nape.geom.ZPP_AABB"] = c.geom.ZPP_AABB;
- c.geom.ZPP_AABB.__name__ = ["zpp_nape", "geom", "ZPP_AABB"];
- c.geom.ZPP_AABB.get = function (a, b, d, g) {
- var e;
- null ==
- 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);
- null;
- e.minx = a;
- e.miny = b;
- e.maxx = d;
- e.maxy = g;
- return e
- };
- c.geom.ZPP_AABB.prototype = {
- toString: function () {
- return "{ x: " + this.minx + " y: " + this.miny + " w: " + (this.maxx - this.minx) + " h: " + (this.maxy - this.miny) + " }"
- },
- setExpandPoint: function (a, b) {
- a < this.minx && (this.minx = a);
- a > this.maxx && (this.maxx = a);
- b < this.miny && (this.miny = b);
- b > this.maxy && (this.maxy = b)
- },
- setExpand: function (a, b) {
- this.minx = a.minx -
- b;
- this.miny = a.miny - b;
- this.maxx = a.maxx + b;
- this.maxy = a.maxy + b
- },
- setCombine: function (a, b) {
- this.minx = a.minx < b.minx ? a.minx : b.minx;
- this.miny = a.miny < b.miny ? a.miny : b.miny;
- this.maxx = a.maxx > b.maxx ? a.maxx : b.maxx;
- this.maxy = a.maxy > b.maxy ? a.maxy : b.maxy
- },
- containsPoint: function (a) {
- return a.x >= this.minx && a.x <= this.maxx && a.y >= this.miny && a.y <= this.maxy
- },
- contains: function (a) {
- return a.minx >= this.minx && a.miny >= this.miny && a.maxx <= this.maxx && a.maxy <= this.maxy
- },
- combine: function (a) {
- a.minx < this.minx && (this.minx = a.minx);
- a.maxx >
- this.maxx && (this.maxx = a.maxx);
- a.miny < this.miny && (this.miny = a.miny);
- a.maxy > this.maxy && (this.maxy = a.maxy)
- },
- intersect: function (a) {
- return a.miny <= this.maxy && this.miny <= a.maxy && a.minx <= this.maxx && this.minx <= a.maxx
- },
- intersectY: function (a) {
- return !(a.miny > this.maxy || this.miny > a.maxy)
- },
- intersectX: function (a) {
- return !(a.minx > this.maxx || this.minx > a.maxx)
- },
- mod_max: function (a) {
- if (a.x != this.maxx || a.y != this.maxy) this.maxx = a.x, this.maxy = a.y, null != this._invalidate && this._invalidate(this)
- },
- dom_max: function () {
- null !=
- this._validate && this._validate();
- this.wrap_max.zpp_inner.x = this.maxx;
- this.wrap_max.zpp_inner.y = this.maxy
- },
- getmax: function () {
- 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));
- return this.wrap_max
- },
- mod_min: function (a) {
- if (a.x != this.minx || a.y != this.miny) this.minx = a.x, this.miny =
- a.y, null != this._invalidate && this._invalidate(this)
- },
- dom_min: function () {
- null != this._validate && this._validate();
- this.wrap_min.zpp_inner.x = this.minx;
- this.wrap_min.zpp_inner.y = this.miny
- },
- getmin: function () {
- 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));
- return this.wrap_min
- },
- perimeter: function () {
- return 2 * (this.maxx - this.minx + (this.maxy - this.miny))
- },
- height: function () {
- return this.maxy - this.miny
- },
- width: function () {
- return this.maxx - this.minx
- },
- copy: function () {
- return c.geom.ZPP_AABB.get(this.minx, this.miny, this.maxx, this.maxy)
- },
- free: function () {
- null != this.outer && (this.outer = this.outer.zpp_inner = null);
- this._validate = this._invalidate = this.wrap_min = this.wrap_max = null
- },
- alloc: function () {},
- wrapper: function () {
- if (null == this.outer) {
- this.outer = new h.geom.AABB;
- var a = this.outer.zpp_inner;
- null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
- a.wrap_min = a.wrap_max = null;
- a._invalidate = null;
- a._validate = null;
- a.next = c.geom.ZPP_AABB.zpp_pool;
- c.geom.ZPP_AABB.zpp_pool = a;
- this.outer.zpp_inner = this
- }
- return this.outer
- },
- invalidate: function () {
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- null != this._validate && this._validate()
- },
- __class__: c.geom.ZPP_AABB
- };
- c.util.ZNPList_ZPP_Vec2 = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Vec2"] =
- c.util.ZNPList_ZPP_Vec2;
- c.util.ZNPList_ZPP_Vec2.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Vec2"];
- c.util.ZNPList_ZPP_Vec2.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Vec2.zpp_pool;
- c.util.ZNPNode_ZPP_Vec2.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b =
- null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Vec2.zpp_pool;
- c.util.ZNPNode_ZPP_Vec2.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_Vec2.zpp_pool ?
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Vec2
- };
- c.geom.ZPP_Collide = function () {};
- s["zpp_nape.geom.ZPP_Collide"] = c.geom.ZPP_Collide;
- c.geom.ZPP_Collide.__name__ = ["zpp_nape",
- "geom", "ZPP_Collide"
- ];
- c.geom.ZPP_Collide.circleContains = function (a, b) {
- var d = 0,
- c = 0,
- d = b.x - a.worldCOMx,
- c = b.y - a.worldCOMy;
- return d * d + c * c < a.radius * a.radius
- };
- c.geom.ZPP_Collide.polyContains = function (a, b) {
- var d;
- d = !0;
- for (var c = a.edges.head; null != c;) {
- var e = c.elt;
- if (e.gnormx * b.x + e.gnormy * b.y <= e.gprojection) c = c.next;
- else {
- d = !1;
- break
- }
- }
- return d
- };
- c.geom.ZPP_Collide.shapeContains = function (a, b) {
- 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,
- b)
- };
- c.geom.ZPP_Collide.bodyContains = function (a, b) {
- var d;
- d = !1;
- for (var g = a.shapes.head; null != g;) {
- if (c.geom.ZPP_Collide.shapeContains(g.elt, b)) {
- d = !0;
- break
- }
- g = g.next
- }
- return d
- };
- c.geom.ZPP_Collide.containTest = function (a, b) {
- 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) {
- d = a.circle.radius + -b.circle.radius;
- var c = 0,
- e = 0,
- c = b.circle.worldCOMx - a.circle.worldCOMx,
- e = b.circle.worldCOMy - a.circle.worldCOMy;
- return c * c + e * e <= d * d
- }(this) :
- function (d) {
- d = !0;
- for (var c = b.polygon.gverts.next; null != c;) {
- var e = c,
- f = void 0,
- f = a.circle.radius,
- l = 0,
- m = 0,
- l = e.x - a.circle.worldCOMx,
- m = e.y - a.circle.worldCOMy;
- if (f = l * l + m * m <= f * f) c = c.next;
- else {
- d = !1;
- break
- }
- }
- return d
- }(this) : b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? function (d) {
- d = !0;
- for (var c = a.polygon.edges.head; null != c;) {
- var e = c.elt;
- if (e.gnormx * b.circle.worldCOMx + e.gnormy * b.circle.worldCOMy + b.circle.radius <= e.gprojection) c = c.next;
- else {
- d = !1;
- break
- }
- }
- return d
- }(this) : function (d) {
- d = !0;
- for (var c = a.polygon.edges.head; null !=
- c;) {
- for (var e = c.elt, f = void 0, f = -1E100, l = b.polygon.gverts.next; null != l;) {
- var m = l,
- m = e.gnormx * m.x + e.gnormy * m.y;
- m > f && (f = m);
- l = l.next
- }
- if (f = f <= e.gprojection) c = c.next;
- else {
- d = !1;
- break
- }
- }
- return d
- }(this) : !1
- };
- c.geom.ZPP_Collide.contactCollide = function (a, b, d, g) {
- if (b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON)
- if (a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
- for (var e = !0, f = -1E100, l = -1, m = null, u = null, p = a.polygon.edges.head; null != p;) {
- for (var k = p.elt, r = 1E100, n = b.polygon.gverts.next; null != n;) {
- var w = n,
- w = k.gnormx * w.x +
- k.gnormy * w.y;
- w < r && (r = w);
- if (r - k.gprojection <= f) break;
- n = n.next
- }
- r -= k.gprojection;
- if (0 <= r) {
- e = !1;
- break
- }
- r > f && (f = r, m = k, l = 1);
- p = p.next
- }
- if (e) {
- for (p = b.polygon.edges.head; null != p;) {
- k = p.elt;
- r = 1E100;
- for (n = a.polygon.gverts.next; null != n;) {
- w = n;
- w = k.gnormx * w.x + k.gnormy * w.y;
- w < r && (r = w);
- if (r - k.gprojection <= f) break;
- n = n.next
- }
- r -= k.gprojection;
- if (0 <= r) {
- e = !1;
- break
- }
- r > f && (f = r, u = k, l = 2);
- p = p.next
- }
- if (e) {
- 1 == l ? (f = b.polygon, k = m, m = 1) : (f = a.polygon, k = u, m = -1);
- e = null;
- r = 1E100;
- for (p = f.edges.head; null != p;) u = p.elt, w = k.gnormx * u.gnormx + k.gnormy *
- u.gnormy, w < r && (r = w, e = u), p = p.next;
- var r = p = 0,
- p = e.gp0.x,
- r = e.gp0.y,
- u = w = 0,
- w = e.gp1.x,
- u = e.gp1.y,
- t = n = 0,
- n = w - p,
- t = u - r,
- q = k.gnormy * p - k.gnormx * r,
- s = k.gnormy * w - k.gnormx * u,
- y = 1 / (s - q),
- q = (-k.tp1 - q) * y;
- q > h.Config.epsilon && (p += n * q, r += t * q);
- q = (-k.tp0 - s) * y;
- q < -h.Config.epsilon && (w += n * q, u += t * q);
- t = n = 0;
- q = m;
- n = k.gnormx * q;
- t = k.gnormy * q;
- d.lnormx = k.lnormx;
- d.lnormy = k.lnormy;
- d.lproj = k.lprojection;
- d.radius = 0;
- d.rev = g != (-1 == m);
- d.ptype = d.rev ? 1 : 0;
- m = p * k.gnormx + r * k.gnormy - k.gprojection;
- s = w * k.gnormx + u * k.gnormy - k.gprojection;
- if (0 < m && 0 < s) return !1;
- g && (n = -n, t = -t);
- m = d.injectContact(p - 0.5 * k.gnormx * m, r - 0.5 * k.gnormy * m, n, t, m, d.rev ? 1 : 0, 0 < m);
- q = 1;
- p -= f.body.posx * q;
- r -= f.body.posy * q;
- m.inner.lr1x = p * f.body.axisy + r * f.body.axisx;
- m.inner.lr1y = r * f.body.axisy - p * f.body.axisx;
- m = d.injectContact(w - 0.5 * k.gnormx * s, u - 0.5 * k.gnormy * s, n, t, s, d.rev ? 0 : 1, 0 < s);
- q = 1;
- w -= f.body.posx * q;
- u -= f.body.posy * q;
- m.inner.lr1x = w * f.body.axisy + u * f.body.axisx;
- m.inner.lr1y = u * f.body.axisy - w * f.body.axisx;
- 1 == l ? (d.__ref_edge1 = k, d.__ref_edge2 = e) : (d.__ref_edge2 = k, d.__ref_edge1 = e);
- return !0
- }
- }
- } else {
- f = -1E100;
- e = !0;
- k = l = null;
- m = b.polygon.gverts.next;
- for (p = b.polygon.edges.head; null != p;) {
- r = p.elt;
- w = r.gnormx * a.circle.worldCOMx + r.gnormy * a.circle.worldCOMy - r.gprojection - a.circle.radius;
- if (0 < w) {
- e = !1;
- break
- }
- w > f && (f = w, l = r, k = m);
- m = m.next;
- p = p.next
- }
- if (e) {
- var z = k,
- x = null == k.next ? b.polygon.gverts.next : k.next,
- k = a.circle.worldCOMy * l.gnormx - a.circle.worldCOMx * l.gnormy;
- if (k <= z.y * l.gnormx - z.x * l.gnormy) return k = function (b) {
- b = a.circle.radius;
- var c = 0,
- e = 0,
- c = z.x - a.circle.worldCOMx,
- e = z.y - a.circle.worldCOMy,
- f = c * c + e * e;
- if (f > b * b) b = null;
- else if (f < h.Config.epsilon * h.Config.epsilon) b = d.injectContact(a.circle.worldCOMx, a.circle.worldCOMy, 1, 0, -b, 0, null);
- else {
- var f = 1 / Math.sqrt(f),
- l = f < h.Config.epsilon ? 1E100 : 1 / f,
- m = 0.5 + (a.circle.radius - 0.5 * b) * f;
- 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)
- }
- return b
- }(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;
- if (k >= x.y * l.gnormx - x.x * l.gnormy) return k = function (b) {
- b = a.circle.radius;
- var c = 0,
- e = 0,
- c = x.x - a.circle.worldCOMx,
- e = x.y - a.circle.worldCOMy,
- f = c * c + e * e;
- if (f > b * b) b = null;
- else if (f < h.Config.epsilon * h.Config.epsilon) b = d.injectContact(a.circle.worldCOMx, a.circle.worldCOMy, 1, 0, -b, 0, null);
- else {
- var f = 1 / Math.sqrt(f),
- l = f < h.Config.epsilon ? 1E100 : 1 / f,
- m = 0.5 + (a.circle.radius - 0.5 * b) * f;
- 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)
- }
- return b
- }(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 =
- 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;
- t = n = 0;
- q = a.circle.radius + 0.5 * f;
- n = l.gnormx * q;
- t = l.gnormy * q;
- e = k = 0;
- k = a.circle.worldCOMx - n;
- e = a.circle.worldCOMy - t;
- m = g ? d.injectContact(k,
- e, l.gnormx, l.gnormy, f, 0, null) : d.injectContact(k, e, -l.gnormx, -l.gnormy, f, 0, null);
- d.ptype = g ? 0 : 1;
- d.lnormx = l.lnormx;
- d.lnormy = l.lnormy;
- d.rev = !g;
- d.lproj = l.lprojection;
- d.radius = a.circle.radius;
- m.inner.lr1x = a.circle.localCOMx;
- m.inner.lr1y = a.circle.localCOMy;
- d.__ref_edge1 = l;
- d.__ref_vertex = 0;
- return !0
- }
- } else if (k = function (c) {
- c = a.circle.radius + b.circle.radius;
- var e = 0,
- f = 0,
- e = b.circle.worldCOMx - a.circle.worldCOMx,
- f = b.circle.worldCOMy - a.circle.worldCOMy,
- l = e * e + f * f;
- if (l > c * c) c = null;
- else if (l < h.Config.epsilon * h.Config.epsilon) c =
- d.injectContact(a.circle.worldCOMx, a.circle.worldCOMy, 1, 0, -c, 0, null);
- else {
- var l = 1 / Math.sqrt(l),
- m = l < h.Config.epsilon ? 1E100 : 1 / l,
- u = 0.5 + (a.circle.radius - 0.5 * c) * l;
- 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)
- }
- return c
- }(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,
- 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;
- return !1
- };
- c.geom.ZPP_Collide.testCollide_safe = function (a, b) {
- if (b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
- var d = a;
- a = b;
- b = d
- }
- return c.geom.ZPP_Collide.testCollide(a, b)
- };
- c.geom.ZPP_Collide.testCollide = function (a, b) {
- return b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? function (d) {
- d = !0;
- for (var c = a.polygon.edges.head; null != c;) {
- for (var e =
- c.elt, f = 1E100, l = b.polygon.gverts.next; null != l;) {
- var m = l,
- m = e.gnormx * m.x + e.gnormy * m.y;
- m < f && (f = m);
- l = l.next
- }
- f -= e.gprojection;
- if (0 < f) {
- d = !1;
- break
- }
- c = c.next
- }
- if (d)
- for (c = b.polygon.edges.head; null != c;) {
- e = c.elt;
- f = 1E100;
- 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;
- f -= e.gprojection;
- if (0 < f) {
- d = !1;
- break
- }
- c = c.next
- } else d = !1;
- return d
- }(this) : function (d) {
- for (var c = null, e = null, f = !0, l = -1E100, m = b.polygon.gverts.next, h = b.polygon.edges.head; null != h;) {
- var p = h.elt,
- k = p.gnormx * a.circle.worldCOMx +
- p.gnormy * a.circle.worldCOMy - p.gprojection - a.circle.radius;
- if (0 < k) {
- f = !1;
- break
- }
- k > l && (l = k, c = p, e = m);
- m = m.next;
- h = h.next
- }
- return f ? function (d) {
- var f = e,
- l = null == e.next ? b.polygon.gverts.next : e.next,
- m = a.circle.worldCOMy * c.gnormx - a.circle.worldCOMx * c.gnormy;
- return m <= f.y * c.gnormx - f.x * c.gnormy ? function (b) {
- b = a.circle.radius;
- var d = 0,
- c = 0,
- d = f.x - a.circle.worldCOMx,
- c = f.y - a.circle.worldCOMy;
- return d * d + c * c <= b * b
- }(d) : m >= l.y * c.gnormx - l.x * c.gnormy ? function (b) {
- b = a.circle.radius;
- var d = 0,
- c = 0,
- d = l.x - a.circle.worldCOMx,
- c = l.y - a.circle.worldCOMy;
- return d * d + c * c <= b * b
- }(d) : !0
- }(d) : !1
- }(this) : function (d) {
- d = a.circle.radius + b.circle.radius;
- var c = 0,
- e = 0,
- c = b.circle.worldCOMx - a.circle.worldCOMx,
- e = b.circle.worldCOMy - a.circle.worldCOMy;
- return c * c + e * e <= d * d
- }(this)
- };
- c.geom.ZPP_Collide.flowCollide = function (a, b, d) {
- return b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON ? function (g) {
- for (var e = [], f = [], l = !0, m = !0, u = a.polygon.edges.head; null != u;) {
- for (var p = u.elt, k = 1E100, r = 0, n = b.polygon.gverts.next; null != n;) {
- var w = n,
- w = p.gnormx *
- w.x + p.gnormy * w.y;
- w < k && (k = w);
- w >= p.gprojection + h.Config.epsilon && (f[r] = !0, m = !1);
- r++;
- n = n.next
- }
- k -= p.gprojection;
- if (0 < k) {
- l = !1;
- break
- }
- u = u.next
- }
- 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) {
- m = !0;
- for (var u = b.polygon.edges.head; null != u;) {
- for (var p = u.elt, k = 1E100, r = 0, n = a.polygon.gverts.next; null != n;) {
- var w = n,
- w = p.gnormx * w.x + p.gnormy * w.y;
- w < k && (k = w);
- w >= p.gprojection + h.Config.epsilon && (e[r] = !0, m = !1);
- r++;
- n = n.next
- }
- k -=
- p.gprojection;
- if (0 < k) {
- l = !1;
- break
- }
- u = u.next
- }
- 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) {
- for (; null != c.geom.ZPP_Collide.flowpoly.head;) {
- var l = c.geom.ZPP_Collide.flowpoly.pop_unsafe();
- 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)
- }
- for (var l = null, m = !1, u = a.polygon.gverts.next,
- p = 0, k = b.polygon.gverts.next, r = 0, n = 0, w = b.polygon.edgeCnt; n < w;) {
- var t = n++;
- if (f[t]) k = k.next;
- else {
- r = t;
- break
- }
- }
- if (null == k) {
- k = b.polygon.gverts.next;
- m = !0;
- n = 0;
- for (w = a.polygon.edgeCnt; n < w;)
- if (t = n++, e[t]) u = u.next;
- else {
- p = t;
- break
- }
- null == u ? u = a.polygon.gverts.next : (c.geom.ZPP_Collide.flowpoly.add(u), l = c.geom.ZPP_Collide.flowpoly.head.elt)
- } else c.geom.ZPP_Collide.flowpoly.add(k), l = c.geom.ZPP_Collide.flowpoly.head.elt;
- var q = 1;
- if (null == c.geom.ZPP_Collide.flowpoly.head) {
- for (var t = !0, C = n = a.polygon.gverts.next, q = n.next; null !=
- q;) {
- for (var s = q, w = 2, x = !0, Q = b.polygon.gverts.next, B = Q, z = Q.next; null != z;) {
- var y = z,
- V = 0;
- (function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y - B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y - B.y,
- g = c * e - d * f;
- 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;
- return a
- })(g) && V < w && (w = V, k = Q);
- Q = z;
- B = y;
- z = z.next
- }
- x && (y = z = b.polygon.gverts.next, V = 0, function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y -
- B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y - B.y,
- g = c * e - d * f;
- 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;
- return a
- }(g) && V < w && (w = V, k = Q));
- if (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;
- t = !1;
- break
- }
- n = q;
- C = s;
- q = q.next
- }
- if (t) {
- s = q = a.polygon.gverts.next;
- w = 2;
- x = !0;
- B = Q = b.polygon.gverts.next;
- for (z = Q.next; null != z;) y = z, V = 0,
- function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y - B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y - B.y,
- g = c * e - d * f;
- 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;
- return a
- }(g) && V < w && (w = V, k = Q), Q = z, B = y, z = z.next;
- x && (y = z = b.polygon.gverts.next, V = 0, function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y - B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y -
- B.y,
- g = c * e - d * f;
- 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;
- return a
- }(g) && V < w && (w = V, k = Q));
- 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)
- }
- q = 2
- }
- for (;;)
- if (m)
- if (u = u.next, p++, null == u && (u = a.polygon.gverts.next, p = 0), e[p]) {
- B = c.geom.ZPP_Collide.flowpoly.head.elt;
- y = u;
- C = k;
- z = k.next;
- null == z && (z =
- b.polygon.gverts.next);
- t = -1;
- n = null;
- x = w = 0;
- Q = z;
- do {
- s = z;
- V = 0;
- if (function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y - B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y - B.y,
- g = c * e - d * f;
- 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;
- return a
- }(g) && V >= t)
- if (n = k, w = r, ++x == q) {
- t = V;
- z = Q;
- break
- } else t = V;
- C = s;
- k = z;
- r++;
- r >= b.polygon.edgeCnt && (r = 0);
- z = z.next;
- null == z && (z = b.polygon.gverts.next)
- } while (0);
- for (; z != Q;) {
- s = z;
- V = 0;
- if (function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y - B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y - B.y,
- g = c * e - d * f;
- 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;
- return a
- }(g) && V >= t)
- if (n = k, w = r, ++x == q) {
- t = V;
- z = Q;
- break
- } else t = V;
- C = s;
- k = z;
- r++;
- r >= b.polygon.edgeCnt && (r = 0);
- z = z.next;
- null == z && (z = b.polygon.gverts.next)
- }
- if (null == n) break;
- Q = n;
- q = n.next;
- null == q &&
- (q = b.polygon.gverts.next);
- s = q;
- x = q = 0;
- q = Q.x + (s.x - Q.x) * t;
- x = Q.y + (s.y - Q.y) * t;
- if (null != l && c.geom.ZPP_VecMath.vec_dsq(q, x, l.x, l.y) < h.Config.epsilon) break;
- c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(q, x, null));
- null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
- k = n;
- r = w;
- m = !m;
- q = 2
- } else {
- n = u;
- if (null != l && c.geom.ZPP_VecMath.vec_dsq(n.x, n.y, l.x, l.y) < h.Config.epsilon) break;
- c.geom.ZPP_Collide.flowpoly.add(n);
- null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
- q = 1
- } else if (k = k.next, r++, null == k && (k = b.polygon.gverts.next,
- r = 0), f[r]) {
- B = c.geom.ZPP_Collide.flowpoly.head.elt;
- y = k;
- C = u;
- z = u.next;
- null == z && (z = a.polygon.gverts.next);
- t = -1;
- n = null;
- x = w = 0;
- Q = z;
- do {
- s = z;
- V = 0;
- if (function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y - B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y - B.y,
- g = c * e - d * f;
- 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;
- return a
- }(g) && V >= t)
- if (n = u, w = p, ++x == q) {
- t = V;
- z = Q;
- break
- } else t = V;
- C = s;
- u =
- z;
- p++;
- p >= a.polygon.edgeCnt && (p = 0);
- z = z.next;
- null == z && (z = a.polygon.gverts.next)
- } while (0);
- for (; z != Q;) {
- s = z;
- V = 0;
- if (function (a) {
- var b = a = 0;
- a = C.x - B.x;
- var b = C.y - B.y,
- d = 0,
- c = 0,
- d = s.x - C.x,
- c = s.y - C.y,
- e = 0,
- f = 0,
- e = y.x - B.x,
- f = y.y - B.y,
- g = c * e - d * f;
- 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;
- return a
- }(g) && V >= t)
- if (n = u, w = p, ++x == q) {
- t = V;
- z = Q;
- break
- } else t = V;
- C = s;
- u = z;
- p++;
- p >= a.polygon.edgeCnt &&
- (p = 0);
- z = z.next;
- null == z && (z = a.polygon.gverts.next)
- }
- if (null == n) break;
- Q = n;
- q = n.next;
- null == q && (q = a.polygon.gverts.next);
- s = q;
- x = q = 0;
- q = Q.x + (s.x - Q.x) * t;
- x = Q.y + (s.y - Q.y) * t;
- if (null != l && c.geom.ZPP_VecMath.vec_dsq(q, x, l.x, l.y) < h.Config.epsilon) break;
- c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(q, x, null));
- null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
- u = n;
- p = w;
- m = !m;
- q = 2
- } else {
- n = k;
- if (null != l && c.geom.ZPP_VecMath.vec_dsq(n.x, n.y, l.x, l.y) < h.Config.epsilon) break;
- c.geom.ZPP_Collide.flowpoly.add(n);
- null == l && (l =
- c.geom.ZPP_Collide.flowpoly.head.elt);
- q = 1
- }
- 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) {
- var b = a = 0,
- e = 0;
- a = e = b = 0;
- for (var f = c.geom.ZPP_Collide.flowpoly.head, g = f.elt, f = f.next, l = f.elt, f = f.next; null != f;) {
- var m = f.elt;
- a += l.x * (m.y - g.y);
- g = m.y * l.x - m.x * l.y;
- b += (l.x + m.x) * g;
- e += (l.y + m.y) * g;
- g = l;
- l = m;
- f = f.next
- }
- f = c.geom.ZPP_Collide.flowpoly.head;
- m = f.elt;
- a += l.x * (m.y - g.y);
- g = m.y * l.x - m.x * l.y;
- b += (l.x + m.x) * g;
- e += (l.y + m.y) *
- g;
- g = l;
- l = m;
- f = f.next;
- f = f.elt;
- a += l.x * (f.y - g.y);
- g = f.y * l.x - f.x * l.y;
- b += (l.x + f.x) * g;
- e += (l.y + f.y) * g;
- a *= 0.5;
- l = 1 / (6 * a);
- d.overlap = -a;
- d.centroidx = b * l;
- d.centroidy = e * l;
- null;
- return !0
- }(g) : !1
- }(g) : !1;
- return g
- }(g) : !1;
- return g
- }(this) : function (g) {
- 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;) {
- var w = n.elt,
- t = w.gnormx * a.circle.worldCOMx + w.gnormy * a.circle.worldCOMy;
- if (t > w.gprojection + a.circle.radius) {
- p = !1;
- break
- } else t + a.circle.radius > w.gprojection + h.Config.epsilon &&
- (f = !1, e[r] = !0);
- t -= w.gprojection + a.circle.radius;
- t > u && (u = t, l = w, m = k);
- k = k.next;
- r++;
- n = n.next
- }
- p ? f ? (d.overlap = a.circle.area, d.centroidx = a.circle.worldCOMx, d.centroidy = a.circle.worldCOMy, null, g = !0) : g = function (f) {
- var g = m,
- u = null == m.next ? b.polygon.gverts.next : m.next,
- p = a.circle.worldCOMy * l.gnormx - a.circle.worldCOMx * l.gnormy;
- return p <= g.y * l.gnormx - g.x * l.gnormy ? function (b) {
- b = a.circle.radius;
- var d = 0,
- c = 0,
- d = g.x - a.circle.worldCOMx,
- c = g.y - a.circle.worldCOMy;
- return d * d + c * c <= b * b
- }(f) : p >= u.y * l.gnormx - u.x * l.gnormy ? function (b) {
- b =
- a.circle.radius;
- var d = 0,
- c = 0,
- d = u.x - a.circle.worldCOMx,
- c = u.y - a.circle.worldCOMy;
- return d * d + c * c <= b * b
- }(f) : function (f) {
- for (var g = [], l = 0, m = !0, u = null, p = 0, k = b.polygon.gverts.next; null != k;) {
- var r = k,
- r = c.geom.ZPP_VecMath.vec_dsq(r.x, r.y, a.circle.worldCOMx, a.circle.worldCOMy);
- (g[l] = r <= a.circle.radius * a.circle.radius) ? (p = l, u = k) : m = !1;
- l++;
- k = k.next
- }
- 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) {
- for (; null != c.geom.ZPP_Collide.flowpoly.head;) {
- var l =
- c.geom.ZPP_Collide.flowpoly.pop_unsafe();
- 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)
- }
- c.geom.ZPP_Collide.flowsegs.clear();
- var l = null,
- m = 1;
- null == u ? (u = b.polygon.gverts.next, m = 2) : c.geom.ZPP_Collide.flowpoly.add(l = u);
- for (; 0 != m;)
- if (1 == m)
- if (u = u.next, null == u && (u = b.polygon.gverts.next), p++, p >= b.polygon.edgeCnt && (p = 0), g[p]) {
- if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, u.x, u.y) < h.Config.epsilon) break;
- c.geom.ZPP_Collide.flowpoly.add(u)
- } else {
- var k = c.geom.ZPP_Collide.flowpoly.head.elt,
- r = u,
- m = function (b) {
- var d = 0,
- c = 0,
- d = r.x - k.x,
- c = r.y - k.y,
- e = 0,
- f = 0,
- e = k.x - a.circle.worldCOMx,
- f = k.y - a.circle.worldCOMy;
- b = d * d + c * c;
- d = 2 * (e * d + f * c);
- e = Math.sqrt(d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius));
- b = 1 / (2 * b);
- f = (-d - e) * b;
- return f < h.Config.epsilon ? (-d + e) * b : f
- }(f),
- n = 0,
- w = 0,
- w = m,
- n = k.x + (r.x - k.x) * w,
- w = k.y + (r.y - k.y) * w;
- if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) break;
- c.geom.ZPP_Collide.flowpoly.add(c.geom.ZPP_Vec2.get(n,
- w, null));
- m = 2
- } else if (2 == m) {
- var t = u.next;
- null == t && (t = b.polygon.gverts.next);
- var k = u,
- m = 0,
- q = t;
- do {
- var r = t,
- C = p + 1;
- C == b.polygon.edgeCnt && (C = 0);
- if (e[p])
- if (g[C]) {
- m = function (b) {
- var d = 0,
- c = 0,
- d = r.x - k.x,
- c = r.y - k.y,
- e = 0,
- f = 0,
- e = k.x - a.circle.worldCOMx,
- f = k.y - a.circle.worldCOMy;
- b = d * d + c * c;
- d = 2 * (e * d + f * c);
- e = Math.sqrt(d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius));
- b = 1 / (2 * b);
- f = (-d - e) * b;
- return f < h.Config.epsilon ? (-d + e) * b : f
- }(f);
- w = n = 0;
- w = m;
- n = k.x + (r.x - k.x) * w;
- w = k.y + (r.y - k.y) * w;
- if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
- m =
- 0;
- t = q;
- break
- }
- n = c.geom.ZPP_Vec2.get(n, w, null);
- c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt);
- c.geom.ZPP_Collide.flowsegs.add(n);
- c.geom.ZPP_Collide.flowpoly.add(n);
- m = 1;
- t = q;
- break
- } else {
- var v = 0,
- s = 0,
- x = function (b) {
- var d = 0,
- c = 0,
- d = r.x - k.x,
- c = r.y - k.y,
- e = 0,
- f = 0,
- e = k.x - a.circle.worldCOMx,
- f = k.y - a.circle.worldCOMy;
- b = d * d + c * c;
- d = 2 * (e * d + f * c);
- e = d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius);
- 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);
- return b
- }(f);
- if (v < 1 - h.Config.epsilon && s > h.Config.epsilon) {
- w = n = 0;
- w = v;
- n = k.x + (r.x - k.x) * w;
- w = k.y + (r.y - k.y) * w;
- if (null != l && c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
- m = 0;
- t = q;
- break
- }
- n = c.geom.ZPP_Vec2.get(n, w, null);
- 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));
- c.geom.ZPP_Collide.flowpoly.add(n);
- null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
- 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,
- x, null)))
- }
- }
- k = r;
- u = t;
- p = C;
- t = t.next;
- null == t && (t = b.polygon.gverts.next)
- } while (0);
- for (; t != q;) {
- r = t;
- C = p + 1;
- C == b.polygon.edgeCnt && (C = 0);
- if (e[p])
- if (g[C]) {
- m = function (b) {
- var d = 0,
- c = 0,
- d = r.x - k.x,
- c = r.y - k.y,
- e = 0,
- f = 0,
- e = k.x - a.circle.worldCOMx,
- f = k.y - a.circle.worldCOMy;
- b = d * d + c * c;
- d = 2 * (e * d + f * c);
- e = Math.sqrt(d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius));
- b = 1 / (2 * b);
- f = (-d - e) * b;
- return f < h.Config.epsilon ? (-d + e) * b : f
- }(f);
- w = n = 0;
- w = m;
- n = k.x + (r.x - k.x) * w;
- w = k.y + (r.y - k.y) * w;
- if (c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
- m =
- 0;
- t = q;
- break
- }
- n = c.geom.ZPP_Vec2.get(n, w, null);
- c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt);
- c.geom.ZPP_Collide.flowsegs.add(n);
- c.geom.ZPP_Collide.flowpoly.add(n);
- m = 1;
- t = q;
- break
- } else if (s = v = 0, x = function (b) {
- var d = 0,
- c = 0,
- d = r.x - k.x,
- c = r.y - k.y,
- e = 0,
- f = 0,
- e = k.x - a.circle.worldCOMx,
- f = k.y - a.circle.worldCOMy;
- b = d * d + c * c;
- d = 2 * (e * d + f * c);
- e = d * d - 4 * b * (e * e + f * f - a.circle.radius * a.circle.radius);
- 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);
- return b
- }(f),
- v < 1 - h.Config.epsilon && s > h.Config.epsilon) {
- w = n = 0;
- w = v;
- n = k.x + (r.x - k.x) * w;
- w = k.y + (r.y - k.y) * w;
- if (null != l && c.geom.ZPP_VecMath.vec_dsq(l.x, l.y, n, w) < h.Config.epsilon) {
- m = 0;
- t = q;
- break
- }
- n = c.geom.ZPP_Vec2.get(n, w, null);
- 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));
- c.geom.ZPP_Collide.flowpoly.add(n);
- null == l && (l = c.geom.ZPP_Collide.flowpoly.head.elt);
- 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,
- x, null)))
- }
- k = r;
- u = t;
- p = C;
- t = t.next;
- null == t && (t = b.polygon.gverts.next)
- }
- }
- return null == c.geom.ZPP_Collide.flowpoly.head ? !1 : null == c.geom.ZPP_Collide.flowpoly.head.next ? function (c) {
- c = !0;
- for (var e = b.polygon.edges.head; null != e;) {
- var f = e.elt;
- if (f.gnormx * a.circle.worldCOMx + f.gnormy * a.circle.worldCOMy > f.gprojection) {
- c = !1;
- break
- }
- e = e.next
- }
- c ? (d.overlap = a.circle.area, d.centroidx = a.circle.worldCOMx, d.centroidy = a.circle.worldCOMy, null, c = !0) : c = !1;
- return c
- }(f) : function (b) {
- var e = b = 0,
- f = 0;
- if (null != c.geom.ZPP_Collide.flowpoly.head.next.next) {
- for (var g =
- 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,
- g = g + k.x * (p.y - u.y),
- u = p.y * k.x - p.x * k.y,
- l = l + (k.x + p.x) * u,
- m = m + (k.y + p.y) * u,
- u = k,
- k = p,
- h = h.next;
- h = c.geom.ZPP_Collide.flowpoly.head;
- p = h.elt;
- g += k.x * (p.y - u.y);
- u = p.y * k.x - p.x * k.y;
- l += (k.x + p.x) * u;
- m += (k.y + p.y) * u;
- u = k;
- k = p;
- h = h.next;
- h = h.elt;
- g += k.x * (h.y - u.y);
- u = h.y * k.x - h.x * k.y;
- l += (k.x + h.x) * u;
- m += (k.y + h.y) * u;
- g *= 0.5;
- h = 1 / (6 * g);
- l *= h;
- m *= h;
- h = -g;
- b += l * h;
- e += m * h;
- f -= g
- } else c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.elt),
- c.geom.ZPP_Collide.flowsegs.add(c.geom.ZPP_Collide.flowpoly.head.next.elt);
- 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 /
- 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;
- h = 1 / f;
- d.overlap = f;
- d.centroidx = b * h;
- d.centroidy = e * h;
- null;
- return !0
- }(f)
- }(f);
- return f
- }(f)
- }(g) : g = !1;
- return g
- }(this) : function (c) {
- c = a.circle;
- var e = b.circle,
- f = 0,
- l = 0,
- f = e.worldCOMx - c.worldCOMx,
- l = e.worldCOMy - c.worldCOMy,
- m = c.radius + e.radius,
- u = f * f + l * l;
- if (u > m * m) c = !1;
- else {
- 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 =
- e.area, d.centroidx = e.worldCOMx, d.centroidy = e.worldCOMy);
- else {
- var m = Math.sqrt(u),
- u = 1 / m,
- k = 0.5 * (m - (e.radius * e.radius - c.radius * c.radius) * u);
- if (k <= -c.radius) d.overlap = c.area, d.centroidx = c.worldCOMx, d.centroidy = c.worldCOMy;
- else {
- var n = m - k;
- if (n <= -e.radius) d.overlap = e.area, d.centroidx = e.worldCOMx, d.centroidy = e.worldCOMy;
- else {
- var r = 0,
- q = 0,
- w = 0,
- t = 0,
- w = k,
- t = w / c.radius,
- k = Math.sqrt(1 - t * t),
- s = Math.acos(t),
- r = c.radius * (c.radius * s - w * k),
- q = 2 / 3 * c.radius * k * k * k / (s - t * k),
- w = n,
- t = w / e.radius,
- k = Math.sqrt(1 - t * t),
- s = Math.acos(t),
- w = e.radius *
- (e.radius * s - w * k),
- t = 2 / 3 * e.radius * k * k * k / (s - t * k),
- e = r + w,
- m = (q * r + (m - t) * w) / e * u;
- d.overlap = e;
- d.centroidx = c.worldCOMx + f * m;
- d.centroidy = c.worldCOMy + l * m
- }
- }
- }
- null;
- c = !0
- }
- return c
- }(this)
- };
- c.geom.ZPP_Convex = function () {};
- s["zpp_nape.geom.ZPP_Convex"] = c.geom.ZPP_Convex;
- c.geom.ZPP_Convex.__name__ = ["zpp_nape", "geom", "ZPP_Convex"];
- c.geom.ZPP_Convex.isinner = function (a, b, d) {
- var c = 0,
- e = 0,
- c = a.x - b.x,
- e = a.y - b.y,
- f = a = 0;
- a = d.x - b.x;
- f = d.y - b.y;
- return 0 <= f * c - a * e
- };
- c.geom.ZPP_Convex.optimise = function (a) {
- var b = a.vertices,
- d = a.vertices;
- if (null !=
- b) {
- do {
- var g = b;
- g.sort();
- b = b.next
- } while (b != d)
- }
- d = b = a.vertices;
- if (null != b) {
- do {
- g = b;
- a = g.prev;
- for (var e = null, f = g.diagonals.head; null != f;) {
- var l = f.elt;
- if (c.geom.ZPP_Convex.isinner(null == f.next ? g.next : f.next.elt, g, a)) {
- for (var m = !0, h = l, k = h.prev, n = null, r = h.diagonals.head; null != r;) {
- var q = r.elt;
- if (q == g) {
- m = c.geom.ZPP_Convex.isinner(null == r.next ? h.next : r.next.elt, h, k);
- break
- }
- k = q;
- n = r;
- r = r.next
- }
- m ? (f = g.diagonals.erase(e), h.diagonals.erase(n)) : (a = l, e = f, f = f.next)
- } else e = f, a = l, f = f.next
- }
- b = b.next
- } while (b != d)
- }
- };
- c.geom.ZPP_ConvexRayResult =
- function () {
- this.toiDistance = 0;
- this.next = null;
- this.inner = !1;
- this.normal = this.shape = this.convex = this.position = this.ray = null
- };
- s["zpp_nape.geom.ZPP_ConvexRayResult"] = c.geom.ZPP_ConvexRayResult;
- c.geom.ZPP_ConvexRayResult.__name__ = ["zpp_nape", "geom", "ZPP_ConvexRayResult"];
- c.geom.ZPP_ConvexRayResult.getRay = function (a, b, d, g) {
- var e;
- 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);
- var f = e.zpp_inner;
- f.normal = a;
- a.zpp_inner._immutable = !0;
- f.toiDistance = b;
- f.inner = d;
- f.shape = g;
- return e
- };
- c.geom.ZPP_ConvexRayResult.getConvex = function (a, b, d, g) {
- var e;
- 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);
- var f = e.zpp_inner;
- f.normal = a;
- f.position = b;
- a.zpp_inner._immutable = !0;
- b.zpp_inner._immutable = !0;
- f.toiDistance = d;
- f.shape = g;
- return e
- };
- c.geom.ZPP_ConvexRayResult.prototype = {
- free: function () {
- this.normal.zpp_inner._immutable = !1;
- this.normal.dispose();
- null != this.position && (this.position.zpp_inner._immutable = !1, this.position.dispose());
- this.shape = null;
- this.toiDistance =
- 0;
- 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)
- },
- disposed: function () {
- if (null != this.next) throw "Error: This object has been disposed of and cannot be used";
- },
- __class__: c.geom.ZPP_ConvexRayResult
- };
- c.geom.ZPP_CutVert = function () {
- this.used = !1;
- this.rank = 0;
- this.parent = null;
- this.positive = !1;
- this.value = 0;
- this.vert = null;
- this.posx = this.posy = 0;
- this.prev = this.next =
- null
- };
- s["zpp_nape.geom.ZPP_CutVert"] = c.geom.ZPP_CutVert;
- c.geom.ZPP_CutVert.__name__ = ["zpp_nape", "geom", "ZPP_CutVert"];
- c.geom.ZPP_CutVert.path = function (a) {
- var b;
- 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);
- null;
- b.vert = a;
- b.parent = b;
- b.rank = 0;
- b.used = !1;
- return b
- };
- c.geom.ZPP_CutVert.prototype = {
- free: function () {
- this.parent = this.vert = null
- },
- alloc: function () {},
- __class__: c.geom.ZPP_CutVert
- };
- c.geom.ZPP_CutInt = function () {
- this.path0 =
- this.end = this.start = this.path1 = null;
- this.virtualint = this.vertex = !1;
- this.time = 0;
- this.next = null
- };
- s["zpp_nape.geom.ZPP_CutInt"] = c.geom.ZPP_CutInt;
- c.geom.ZPP_CutInt.__name__ = ["zpp_nape", "geom", "ZPP_CutInt"];
- c.geom.ZPP_CutInt.get = function (a, b, d, g, e, f, l) {
- null == l && (l = !1);
- null == f && (f = !1);
- var m;
- 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);
- null;
- m.virtualint = f;
- m.end = b;
- m.start = d;
- m.path0 = g;
- m.path1 = e;
- m.time = a;
- m.vertex = l;
- return m
- };
- c.geom.ZPP_CutInt.prototype = {
- free: function () {
- this.path0 = this.path1 = this.end = this.start = null
- },
- alloc: function () {},
- __class__: c.geom.ZPP_CutInt
- };
- c.geom.ZPP_Cutter = function () {};
- s["zpp_nape.geom.ZPP_Cutter"] = c.geom.ZPP_Cutter;
- c.geom.ZPP_Cutter.__name__ = ["zpp_nape", "geom", "ZPP_Cutter"];
- c.geom.ZPP_Cutter.run = function (a, b, d, g, e, f) {
- var l = 0,
- m = 0;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- l = b.zpp_inner.x;
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- var m = b.zpp_inner.y,
- u = b = 0;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- b = d.zpp_inner.x - l;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- u = d.zpp_inner.y - m;
- d = g ? 0 : Math.NEGATIVE_INFINITY;
- e = e ? 1 : Math.POSITIVE_INFINITY;
- g = -(m * b - l * u);
- var k = null,
- n = !1,
- r = a;
- do {
- var q;
- 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 =
- q.next, q.next = null);
- null;
- q.vert = r;
- q.posx = q.vert.x;
- q.posy = q.vert.y;
- q.value = q.posy * b - q.posx * u + g;
- q.positive = 0 < q.value;
- 0 == q.value && (n = !0);
- k = function (a) {
- a = q;
- null == k ? k = a.prev = a.next = a : (a.prev = k, a.next = k.next, k.next.prev = a, k.next = a);
- return a
- }(this);
- r = r.next
- } while (r != a);
- if (n) {
- g = null;
- var w = k,
- n = k;
- if (null != w) {
- do {
- var t = w;
- if (0 != t.value) {
- g = t;
- break
- }
- w = w.next
- } while (w != n)
- }
- var s = 0,
- y = 0,
- s = b,
- y = u,
- A = 1 / Math.sqrt(s * s + y * y),
- s = s * A,
- y = y * A,
- A = s,
- s = -y,
- y = A,
- n = null,
- t = g;
- do {
- if (0 == t.value || null != n && t != n.next) {
- if (r = n.value * t.value, 0 != r) {
- var z =
- n.next,
- r = 0 < r ? n.positive : function (b) {
- b = z.next;
- var d = 0,
- c = 0,
- d = z.posx + b.posx,
- c = z.posy + b.posy;
- b = 0.5 * d + 1E-8 * s;
- c = 0.5 * c + 1E-8 * y;
- d = !1;
- if (null != a) {
- var e = a;
- do {
- var f = e,
- g = f.prev;
- (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);
- e = e.next
- } while (e != a)
- }
- return d
- }(this),
- w = z,
- n = t;
- if (null != w) {
- do {
- var x = w;
- x.positive = r;
- w = w.next
- } while (w != n)
- }
- n = t
- }
- } else n = t;
- t = t.next
- } while (t != g);
- if (0 == t.value || null != n && t != n.next) {
- if (r = n.value * t.value, 0 != r) {
- z = n.next;
- r = 0 < r ? n.positive : function (b) {
- b = z.next;
- var d = 0,
- c = 0,
- d = z.posx + b.posx,
- c = z.posy + b.posy;
- b = 0.5 * d + 1E-8 * s;
- c = 0.5 * c + 1E-8 * y;
- d = !1;
- if (null != a) {
- var e = a;
- do {
- var f = e,
- g = f.prev;
- (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);
- e = e.next
- } while (e != a)
- }
- return d
- }(this);
- w = z;
- n = t;
- if (null != w) {
- do x = w, x.positive = r, w = w.next; while (w != n)
- }
- n = t
- }
- } else n = t;
- t = t.next
- }
- null == c.geom.ZPP_Cutter.ints && (c.geom.ZPP_Cutter.ints = new c.util.ZNPList_ZPP_CutInt);
- null == c.geom.ZPP_Cutter.paths && (c.geom.ZPP_Cutter.paths = new c.util.ZNPList_ZPP_CutVert);
- g = null;
- var B = c.geom.ZPP_GeomVert.get(k.posx, k.posy);
- null == g ? g = B.prev = B.next = B : (B.next = g, B.prev = g.prev, g.prev.next = B, g.prev = B);
- B;
- var n = g,
- v = c.geom.ZPP_CutVert.path(g);
- c.geom.ZPP_Cutter.paths.add(v);
- r = k;
- do {
- var H = r.next,
- x = c.geom.ZPP_GeomVert.get(H.posx, H.posy);
- 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;
- else {
- var D = 0,
- B = 0,
- D = H.posx - r.posx,
- B = H.posy - r.posy,
- E = u * D - b * B,
- E = 1 / E,
- F = 0,
- A = 0,
- F = l - r.posx,
- A = m - r.posy,
- w = (B * F - D * A) * E;
- w < d || w > e ? (c.geom.ZPP_Cutter.ints.add(c.geom.ZPP_CutInt.get(w,
- 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,
- 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,
- 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)))
- }
- r = r.next
- } while (r != k);
- D =
- g.prev;
- D.next.prev = n.prev;
- n.prev.next = D.next;
- D.next = n;
- n.prev = D;
- var G = c.geom.ZPP_Cutter.paths.head.elt,
- l = v == v.parent ? v : function (a) {
- a = v;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this),
- m = G == G.parent ? G : function (a) {
- a = G;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this);
- l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent = l : (m.parent = l, l.rank++));
- l = c.geom.ZPP_Cutter.ints;
- if (null != l.head && null != l.head.next) {
- m = l.head;
- e = d = u = b = null;
- g = 1;
- do {
- n = 0;
- u = m;
- for (b = m = null; null != u;) {
- n++;
- d = u;
- r = 0;
- for (w = g; null != d && r < g;) r++, d = d.next;
- 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;
- u = d
- }
- b.next = null;
- g <<= 1
- } while (1 < n);
- l.head = m;
- l.modified = !0;
- l.pushmod = !0
- }
- for (; null != c.geom.ZPP_Cutter.ints.head;) {
- var L = c.geom.ZPP_Cutter.ints.pop_unsafe(),
- H = c.geom.ZPP_Cutter.ints.pop_unsafe();
- L.virtualint ||
- H.virtualint ? L.virtualint && !H.virtualint ? (H.end = null != H.end && H.end.prev == H.end ? function (a) {
- H.end.next = H.end.prev = null;
- a = H.end;
- null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
- a.prev = a.next = null;
- a.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = a;
- return null
- }(this) : function (a) {
- a = H.end.prev;
- H.end.prev.next = H.end.next;
- H.end.next.prev = H.end.prev;
- H.end.next = H.end.prev = null;
- var b = H.end;
- null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
- b.prev = b.next =
- null;
- b.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = b;
- H.end = null;
- return a
- }(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) {
- H.end.next = H.end.prev = null;
- a = H.end;
- null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
- a.prev = a.next = null;
- a.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = a;
- return null
- }(this) : function (a) {
- a = H.end.prev;
- H.end.prev.next = H.end.next;
- H.end.next.prev = H.end.prev;
- H.end.next = H.end.prev = null;
- var b = H.end;
- null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
- b.prev = b.next = null;
- b.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = b;
- H.end = null;
- return a
- }(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 =
- 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) {
- a = H.path0;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), m = H.path1 == H.path1.parent ? H.path1 : function (a) {
- a =
- H.path1;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(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) {
- L.end.next = L.end.prev = null;
- a = L.end;
- null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap = null);
- a.prev = a.next = null;
- a.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = a;
- return null
- }(this) : function (a) {
- a =
- L.end.prev;
- L.end.prev.next = L.end.next;
- L.end.next.prev = L.end.prev;
- L.end.next = L.end.prev = null;
- var b = L.end;
- null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
- b.prev = b.next = null;
- b.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = b;
- L.end = null;
- return a
- }(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) {
- L.end.next = L.end.prev = null;
- a = L.end;
- null != a.wrap && (a.wrap.zpp_inner._inuse = !1, a.wrap.dispose(), a.wrap =
- null);
- a.prev = a.next = null;
- a.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = a;
- return null
- }(this) : function (a) {
- a = L.end.prev;
- L.end.prev.next = L.end.next;
- L.end.next.prev = L.end.prev;
- L.end.next = L.end.prev = null;
- var b = L.end;
- null != b.wrap && (b.wrap.zpp_inner._inuse = !1, b.wrap.dispose(), b.wrap = null);
- b.prev = b.next = null;
- b.next = c.geom.ZPP_GeomVert.zpp_pool;
- c.geom.ZPP_GeomVert.zpp_pool = b;
- L.end = null;
- return a
- }(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 !=
- 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 ?
- L.path0 : function (a) {
- a = L.path0;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), m = L.path1 == L.path1.parent ? L.path1 : function (a) {
- a = L.path1;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(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,
- 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) {
- a = L.path0;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), m = H.path1 == H.path1.parent ? H.path1 : function (a) {
- a = H.path1;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent =
- l : (m.parent = l, l.rank++)), l = L.path1 == L.path1.parent ? L.path1 : function (a) {
- a = L.path1;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), m = H.path0 == H.path0.parent ? H.path0 : function (a) {
- a = H.path0;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), l != m && (l.rank < m.rank ? l.parent = m : l.rank > m.rank ? m.parent = l : (m.parent = l, l.rank++)));
- l = L;
- l.end = l.start = null;
- l.path0 = l.path1 = null;
- l.next =
- c.geom.ZPP_CutInt.zpp_pool;
- c.geom.ZPP_CutInt.zpp_pool = l;
- l = H;
- l.end = l.start = null;
- l.path0 = l.path1 = null;
- l.next = c.geom.ZPP_CutInt.zpp_pool;
- c.geom.ZPP_CutInt.zpp_pool = l
- }
- f = null == f ? new h.geom.GeomPolyList : f;
- for (l = c.geom.ZPP_Cutter.paths.head; null != l;) {
- t = l.elt;
- m = t == t.parent ? t : function (a) {
- a = t;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this);
- if (!m.used) {
- m.used = !0;
- var aa = m.vert;
- for (b = !0; null != m.vert && (b || aa != m.vert);) b = !1, aa.x == aa.next.x &&
- 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) {
- a = aa.next;
- aa.prev.next = aa.next;
- aa.next.prev = aa.prev;
- aa = aa.next = aa.prev = null;
- return a
- }(this), aa = u) : aa = aa.next;
- 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))
- }
- l = l.next
- }
- 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,
- c.geom.ZPP_CutVert.zpp_pool = l;
- for (; null != k;) k = null != k && k.prev == k ? function (a) {
- k.next = k.prev = null;
- a = k;
- a.vert = null;
- a.parent = null;
- a.next = c.geom.ZPP_CutVert.zpp_pool;
- c.geom.ZPP_CutVert.zpp_pool = a;
- return k = null
- }(this) : function (a) {
- a = k.next;
- k.prev.next = k.next;
- k.next.prev = k.prev;
- k.next = k.prev = null;
- var b = k;
- b.vert = null;
- b.parent = null;
- b.next = c.geom.ZPP_CutVert.zpp_pool;
- c.geom.ZPP_CutVert.zpp_pool = b;
- k = null;
- return a
- }(this);
- return f
- };
- c.geom.ZPP_Geom = function () {};
- s["zpp_nape.geom.ZPP_Geom"] = c.geom.ZPP_Geom;
- c.geom.ZPP_Geom.__name__ = ["zpp_nape", "geom", "ZPP_Geom"];
- c.geom.ZPP_Geom.validateShape = function (a) {
- a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.validate_gaxi();
- 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());
- 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 * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy))
- };
- c.geom.ZPP_GeomVert = function () {
- this.forced = !1;
- this.prev = this.next = this.wrap = null;
- this.x = this.y = 0
- };
- s["zpp_nape.geom.ZPP_GeomVert"] = c.geom.ZPP_GeomVert;
- c.geom.ZPP_GeomVert.__name__ = ["zpp_nape", "geom", "ZPP_GeomVert"];
- c.geom.ZPP_GeomVert.get = function (a, b) {
- var d;
- null == c.geom.ZPP_GeomVert.zpp_pool ?
- d = new c.geom.ZPP_GeomVert : (d = c.geom.ZPP_GeomVert.zpp_pool, c.geom.ZPP_GeomVert.zpp_pool = d.next, d.next = null);
- d.forced = !1;
- d.x = a;
- d.y = b;
- return d
- };
- c.geom.ZPP_GeomVert.prototype = {
- getwrap: function () {
- this.wrap.zpp_inner.x = this.x;
- this.wrap.zpp_inner.y = this.y
- },
- modwrap: function (a) {
- this.x = a.x;
- this.y = a.y
- },
- wrapper: function () {
- 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));
- return this.wrap
- },
- alloc: function () {
- this.forced = !1
- },
- free: function () {
- null != this.wrap && (this.wrap.zpp_inner._inuse = !1, this.wrap.dispose(), this.wrap = null);
- this.prev = this.next = null
- },
- __class__: c.geom.ZPP_GeomVert
- };
- c.geom.ZPP_GeomPoly = function (a) {
- this.outer = this.vertices = null;
- this.outer = a
- };
- s["zpp_nape.geom.ZPP_GeomPoly"] = c.geom.ZPP_GeomPoly;
- c.geom.ZPP_GeomPoly.__name__ = ["zpp_nape", "geom", "ZPP_GeomPoly"];
- c.geom.ZPP_GeomPoly.prototype = {
- __class__: c.geom.ZPP_GeomPoly
- };
- c.geom.ZPP_GeomVertexIterator = function () {
- this.outer =
- this.next = null;
- this.first = this.forward = !1;
- this.ptr = this.start = null;
- c.geom.ZPP_GeomVertexIterator.internal = !0;
- this.outer = new h.geom.GeomVertexIterator;
- c.geom.ZPP_GeomVertexIterator.internal = !1
- };
- s["zpp_nape.geom.ZPP_GeomVertexIterator"] = c.geom.ZPP_GeomVertexIterator;
- c.geom.ZPP_GeomVertexIterator.__name__ = ["zpp_nape", "geom", "ZPP_GeomVertexIterator"];
- c.geom.ZPP_GeomVertexIterator.get = function (a, b) {
- var d;
- null == c.geom.ZPP_GeomVertexIterator.zpp_pool ? d = new c.geom.ZPP_GeomVertexIterator : (d = c.geom.ZPP_GeomVertexIterator.zpp_pool,
- c.geom.ZPP_GeomVertexIterator.zpp_pool = d.next, d.next = null);
- null;
- d.outer.zpp_inner = d;
- d.ptr = a;
- d.forward = b;
- d.start = a;
- d.first = null != a;
- return d.outer
- };
- c.geom.ZPP_GeomVertexIterator.prototype = {
- alloc: function () {},
- free: function () {
- this.ptr = this.start = this.outer.zpp_inner = null
- },
- __class__: c.geom.ZPP_GeomVertexIterator
- };
- c.geom.ZPP_MarchSpan = function () {
- this.next = null;
- this.out = !1;
- this.rank = 0;
- this.parent = null;
- this.parent = this
- };
- s["zpp_nape.geom.ZPP_MarchSpan"] = c.geom.ZPP_MarchSpan;
- c.geom.ZPP_MarchSpan.__name__ = ["zpp_nape",
- "geom", "ZPP_MarchSpan"
- ];
- c.geom.ZPP_MarchSpan.prototype = {
- alloc: function () {
- this.out = !1;
- this.rank = 0
- },
- free: function () {
- this.parent = this
- },
- __class__: c.geom.ZPP_MarchSpan
- };
- c.geom.ZPP_MarchPair = function () {
- this.pd = this.span1 = this.span2 = this.spanr = this.next = null;
- this.keyr = this.okeyr = 0;
- this.pr = null;
- this.key2 = this.okey2 = 0;
- this.p2 = null;
- this.key1 = this.okey1 = 0;
- this.p1 = null
- };
- s["zpp_nape.geom.ZPP_MarchPair"] = c.geom.ZPP_MarchPair;
- c.geom.ZPP_MarchPair.__name__ = ["zpp_nape", "geom", "ZPP_MarchPair"];
- c.geom.ZPP_MarchPair.prototype = {
- alloc: function () {},
- free: function () {
- this.span1 = this.span2 = this.spanr = this.p1 = this.p2 = this.pr = this.pd = null
- },
- __class__: c.geom.ZPP_MarchPair
- };
- c.geom.ZPP_MarchingSquares = function () {};
- s["zpp_nape.geom.ZPP_MarchingSquares"] = c.geom.ZPP_MarchingSquares;
- c.geom.ZPP_MarchingSquares.__name__ = ["zpp_nape", "geom", "ZPP_MarchingSquares"];
- c.geom.ZPP_MarchingSquares.run = function (a, b, d, g, e, f, l, m, h) {
- var k = g - b;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- var n =
- k / f.zpp_inner.x,
- k = n | 0,
- r = e - d;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- var q = r / f.zpp_inner.y,
- r = q | 0;
- n != k && k++;
- q != r && r++;
- 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));
- 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);
- for (var w =
- 0, n = r + 1; w < n;) {
- var q = w++,
- t;
- if (0 == q) t = d;
- else if (q <= r) {
- t = d;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- t += f.zpp_inner.y * q
- } else t = e;
- for (var s = t, y = 0, A = k + 1; y < A;) {
- t = y++;
- var z;
- if (0 == t) z = b;
- else if (t <= k) {
- z = b;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- z += f.zpp_inner.x * t
- } else z = g;
- c.geom.ZPP_MarchingSquares.isos.set(t, q, a(z, s))
- }
- }
- null == c.geom.ZPP_MarchingSquares.ints ? c.geom.ZPP_MarchingSquares.ints =
- new c.util.ZNPArray2_ZPP_GeomVert(k + 1, (r << 1) + 1) : c.geom.ZPP_MarchingSquares.ints.resize(k + 1, (r << 1) + 1, null);
- s = null;
- 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);
- z = d;
- for (n = 0; n < r;) {
- q = n++;
- y = z;
- if (q == r - 1) w = e;
- else {
- w = d;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- w += f.zpp_inner.y * (q + 1)
- }
- var x = w;
- z = x;
- for (var B = b, A = null, w = 0; w < k;) {
- t =
- w++;
- var v = B;
- if (t == k - 1) B = g;
- else {
- B = b;
- if (null != f && f.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- f.zpp_inner.validate();
- B += f.zpp_inner.x * (t + 1)
- }
- var H = B,
- B = H,
- 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);
- 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 &&
- 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),
- 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)
- }
- }
- if (m) {
- for (n = 1; n < r;)
- for (q = n++, A = null, w = 0; w < k;)
- if (t = w++, a = c.geom.ZPP_MarchingSquares.map.get(t, q), null == a) A = null;
- else if (c.geom.ZPP_MarchingSquares.me.combUp(null !=
- a.p2 && 14 == a.okey2 ? a.okey2 : a.okey1))
- if (b = c.geom.ZPP_MarchingSquares.map.get(t, q - 1), null == b) A = null;
- else if (c.geom.ZPP_MarchingSquares.me.combDown(null != b.p2 && 56 == b.okey2 ? b.okey2 : b.okey1)) {
- var D = null != b.p2 && 56 == b.okey2 ? b.span2 : b.span1,
- E = null != a.p2 && 14 == a.okey2 ? a.span2 : a.span1;
- (D == D.parent ? D : function (a) {
- a = D;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this)) == (E == E.parent ? E : function (a) {
- a = E;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this)) ? A != E && c.geom.ZPP_MarchingSquares.me.combUD_virtual(b, a) : (d = D == D.parent ? D : function (a) {
- a = D;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), g = E == E.parent ? E : function (a) {
- a = E;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), d != g && (d.rank < g.rank ? d.parent = g : d.rank > g.rank ? g.parent = d : (g.parent =
- d, d.rank++)), c.geom.ZPP_MarchingSquares.me.combUD(b, a));
- A = 0 != ((E == a.span2 ? a.okey2 : a.okey1) & 4) ? E : null
- } else A = null;
- else A = null;
- for (n = 0; n < r;)
- for (q = n++, w = 0; w < k;) {
- t = w++;
- var F = c.geom.ZPP_MarchingSquares.map.get(t, q);
- null != F && (a = F.span1 == F.span1.parent ? F.span1 : function (a) {
- a = F.span1;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(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 :
- function (a) {
- a = F.span2;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(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))
- }
- 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
- }
- };
- c.geom.ZPP_MarchingSquares.ISO =
- function (a, b, d) {
- return a(b, d)
- };
- c.geom.ZPP_MarchingSquares.prototype = {
- ylerp: function (a, b, d, c, e, f, l) {
- for (var m = this.lerp(a, b, c, e); 0 != l-- && a < m && m < b;) {
- var h = f(d, m);
- if (0 == h) break;
- 0 > c * h ? (b = m, e = h) : (a = m, c = h);
- m = this.lerp(a, b, c, e)
- }
- return m
- },
- xlerp: function (a, b, d, c, e, f, l) {
- for (var m = this.lerp(a, b, c, e); 0 != l-- && a < m && m < b;) {
- var h = f(m, d);
- if (0 == h) break;
- 0 > c * h ? (b = m, e = h) : (a = m, c = h);
- m = this.lerp(a, b, c, e)
- }
- return m
- },
- lerp: function (a, b, d, c) {
- if (0 == d) return a;
- if (0 == c) return b;
- c = d - c;
- d = c * c < h.Config.epsilon * h.Config.epsilon ? 0.5 : d /
- c;
- 0 > d ? d = 0 : 1 < d && (d = 1);
- return a + d * (b - a)
- },
- marchSquare: function (a, b, d, g, e, f, l, m, h, k, n, r, q, w) {
- var t = 0,
- s = b.list[h * b.width + m];
- 0 > s && (t |= 8);
- var y = b.list[h * b.width + (m + 1)];
- 0 > y && (t |= 4);
- var A = b.list[(h + 1) * b.width + (m + 1)];
- 0 > A && (t |= 2);
- b = b.list[(h + 1) * b.width + m];
- 0 > b && (t |= 1);
- if (0 == t) return null;
- var z;
- 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);
- null;
- if (10 != t && 5 != t) {
- var x = c.geom.ZPP_MarchingSquares.look_march[t];
- z.okey1 =
- x;
- for (t = 0; 8 > t;) {
- var B = t++;
- if (0 != (x & 1 << B)) {
- var v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p1 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- }
- z.p1 = z.p1.next;
- z.key1 = x;
- 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;
- 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
- } else if (B = 0 > a(0.5 * (g + f), 0.5 * (e + l)), 10 == t)
- if (B) {
- x = 187;
- z.okey1 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g,
- l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x ==
- f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x &
- 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p1 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- z.p1 = z.p1.next;
- z.key1 = x;
- 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;
- 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
- } else {
- x = 131;
- z.okey1 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p1 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- z.p1 = z.p1.next;
- z.key1 = x;
- 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;
- if (0 != x) {
- x = 56;
- z.okey2 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p2 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- z.p2 = z.p2.next;
- z.key2 = x;
- 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;
- 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)
- } else {
- x = 56;
- z.okey1 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g,
- l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x ==
- f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x &
- 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p1 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- z.p1 = z.p1.next;
- z.key1 = x;
- 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;
- 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
- }
- } else if (B) {
- x = 238;
- z.okey1 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p1 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- z.p1 = z.p1.next;
- z.key1 = x;
- 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;
- 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr = z.key1)
- } else {
- x = 224;
- z.okey1 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p1 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- z.p1 =
- z.p1.next;
- z.key1 = x;
- 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;
- if (0 != x) {
- x = 14;
- z.okey2 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p2 = function (a) {
- a =
- v;
- 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);
- return a
- }(this)
- }
- z.p2 = z.p2.next;
- z.key2 = x;
- 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;
- 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)
- } else {
- x = 14;
- z.okey1 = x;
- for (t = 0; 8 > t;)
- if (B = t++, 0 != (x & 1 << B)) {
- v = null;
- if (0 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, e), k || n) v.forced = !0
- } else if (2 ==
- B) {
- if (v = c.geom.ZPP_GeomVert.get(f, e), r || n) v.forced = !0
- } else if (4 == B) {
- if (v = c.geom.ZPP_GeomVert.get(f, l), r || q) v.forced = !0
- } else if (6 == B) {
- if (v = c.geom.ZPP_GeomVert.get(g, l), k || q) v.forced = !0
- } else if (1 == B) {
- 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)
- if (v.x == g && 0 != (x & 1) || v.x == f && 0 != (x & 4)) x ^= 2
- } else if (5 == B) {
- 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)
- if (v.x == g && 0 != (x & 64) || v.x == f && 0 != (x & 16)) x ^= 32
- } else if (3 == B) {
- 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)
- if (v.y == e && 0 != (x & 4) || v.y == l && 0 != (x & 16)) x ^= 8
- } 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)
- if (v.y == e && 0 != (x & 1) || v.y == l && 0 != (x & 64)) x ^= 128;
- z.p1 = function (a) {
- a = v;
- 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);
- return a
- }(this)
- }
- z.p1 = z.p1.next;
- z.key1 = x;
- 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;
- 0 == x ? z = null : (z.pr = z.p1, z.okeyr = z.okey1, z.keyr =
- z.key1)
- }
- }
- return z
- },
- comb: function (a) {
- var b = 0;
- 0 != (a & 1) && b++;
- 0 != (a & 2) && b++;
- 0 != (a & 4) && b++;
- return 2 <= b
- },
- combDown: function (a) {
- return this.comb((a & 112) >> 4)
- },
- combUp: function (a) {
- return this.comb(a & 7)
- },
- combRight: function (a) {
- return this.comb((a & 28) >> 2)
- },
- combLeft: function (a) {
- return this.comb(a & 1 | (a & 192) >> 5)
- },
- combUD_virtual: function (a, b) {
- var d = a.pd,
- c = null != b.p2 && 14 == b.key2 ? b.p2 : b.p1;
- d.forced = c.forced = d.prev.forced = c.next.forced = !0
- },
- combUD: function (a, b) {
- var d = a.pd,
- g = null != b.p2 && 14 == b.key2 ? b.p2 : b.p1,
- e = d.prev,
- f =
- g.next;
- g.next = d.next;
- d.next.prev = g;
- 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;
- f.prev = e.prev;
- e.prev.next = f;
- e == a.p1 && (a.p1 = f);
- 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
- },
- combLR: function (a, b) {
- var d = this.linkright(a.pr, a.okeyr),
- g = this.linkleft(b.p1, b.okey1),
- e = d.next,
- f = g.prev;
- 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);
- d = g;
- 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;
- 0 != (a.keyr & 16) ? (b.pd = e.next, e.next.prev = f.prev, f.prev.next =
- 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);
- d = f;
- 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
- },
- linkup: function (a, b) {
- return a
- },
- linkdown: function (a, b) {
- return 0 == (b & 128) ? a.prev : a.prev.prev
- },
- linkleft: function (a, b) {
- return 0 == (b & 1) ? a.prev :
- a
- },
- linkright: function (a, b) {
- var d = b & 7;
- return 0 == d ? a : 3 == d ? a.next.next : a.next
- },
- output: function (a, b) {
- if (null == b || b.next == b || b.next == b.prev || function (a) {
- a = 0;
- var d = b,
- c = b;
- if (null != d) {
- do {
- var l = d;
- a += l.x * (l.next.y - l.prev.y);
- d = d.next
- } while (d != c)
- }
- a *= 0.5;
- return a * a < h.Config.epsilon * h.Config.epsilon
- }(this))
- for (; null != b;) {
- var d;
- d = null != b && b.prev == b ? b = b.next = b.prev = null : function (a) {
- a = b.next;
- b.prev.next = b.next;
- b.next.prev = b.prev;
- b = b.next = b.prev = null;
- return a
- }(this);
- b = d
- } else d = h.geom.GeomPoly.get(), d.zpp_inner.vertices =
- b, a.zpp_inner.reverse_flag ? a.push(d) : a.unshift(d)
- },
- __class__: c.geom.ZPP_MarchingSquares
- };
- c.geom.ZPP_Mat23 = function () {
- this._invalidate = this.next = null;
- this.a = this.b = this.c = this.d = this.tx = this.ty = 0;
- this.outer = null
- };
- s["zpp_nape.geom.ZPP_Mat23"] = c.geom.ZPP_Mat23;
- c.geom.ZPP_Mat23.__name__ = ["zpp_nape", "geom", "ZPP_Mat23"];
- c.geom.ZPP_Mat23.get = function () {
- var a;
- 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);
- null;
- return a
- };
- c.geom.ZPP_Mat23.identity =
- function () {
- var a = c.geom.ZPP_Mat23.get();
- a.setas(1, 0, 0, 1, 0, 0);
- return a
- };
- c.geom.ZPP_Mat23.prototype = {
- alloc: function () {},
- free: function () {},
- setas: function (a, b, d, c, e, f) {
- this.tx = e;
- this.ty = f;
- this.a = a;
- this.b = b;
- this.c = d;
- this.d = c
- },
- set: function (a) {
- this.setas(a.a, a.b, a.c, a.d, a.tx, a.ty)
- },
- invalidate: function () {
- null != this._invalidate && this._invalidate()
- },
- wrapper: function () {
- if (null == this.outer) {
- this.outer = new h.geom.Mat23;
- var a = this.outer.zpp_inner;
- a.next = c.geom.ZPP_Mat23.zpp_pool;
- c.geom.ZPP_Mat23.zpp_pool = a;
- this.outer.zpp_inner =
- this
- }
- return this.outer
- },
- __class__: c.geom.ZPP_Mat23
- };
- c.geom.ZPP_MatMN = function (a, b) {
- this.x = null;
- this.m = this.n = 0;
- this.outer = null;
- this.m = a;
- this.n = b;
- this.x = [];
- for (var d = 0, c = a * b; d < c;) d++, this.x.push(0)
- };
- s["zpp_nape.geom.ZPP_MatMN"] = c.geom.ZPP_MatMN;
- c.geom.ZPP_MatMN.__name__ = ["zpp_nape", "geom", "ZPP_MatMN"];
- c.geom.ZPP_MatMN.prototype = {
- __class__: c.geom.ZPP_MatMN
- };
- c.geom.ZPP_Monotone = function () {};
- s["zpp_nape.geom.ZPP_Monotone"] = c.geom.ZPP_Monotone;
- c.geom.ZPP_Monotone.__name__ = ["zpp_nape", "geom", "ZPP_Monotone"];
- c.geom.ZPP_Monotone.bisector = function (a) {
- var b = a.prev,
- d = a.next,
- g = 0,
- e = 0,
- g = a.x - b.x,
- e = a.y - b.y,
- f = b = 0,
- b = d.x - a.x,
- f = d.y - a.y;
- a = c.geom.ZPP_Vec2.get(-e - f, g + b, null);
- d = 1 / Math.sqrt(a.x * a.x + a.y * a.y);
- a.x *= d;
- a.y *= d;
- 0 > f * g - b * e && (a.x = -a.x, a.y = -a.y);
- return a
- };
- c.geom.ZPP_Monotone.below = function (a, b) {
- if (a.y < b.y) return !0;
- if (a.y > b.y) return !1;
- if (a.x < b.x) return !0;
- if (a.x > b.x) return !1;
- var d = c.geom.ZPP_Monotone.bisector(a),
- g = c.geom.ZPP_Monotone.bisector(b),
- e = 1;
- d.x += a.x * e;
- d.y += a.y * e;
- e = 1;
- g.x += b.x * e;
- g.y += b.y * e;
- e = d.x < g.x || d.x == g.x &&
- d.y < g.y;
- null != d.outer && (d.outer.zpp_inner = null, d.outer = null);
- d._isimmutable = null;
- d._validate = null;
- d._invalidate = null;
- d.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = d;
- d = g;
- null != d.outer && (d.outer.zpp_inner = null, d.outer = null);
- d._isimmutable = null;
- d._validate = null;
- d._invalidate = null;
- d.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = d;
- return e
- };
- c.geom.ZPP_Monotone.above = function (a, b) {
- return c.geom.ZPP_Monotone.below(b, a)
- };
- c.geom.ZPP_Monotone.left_vertex = function (a) {
- var b = a.prev;
- return b.y >
- a.y || b.y == a.y && a.next.y < a.y
- };
- c.geom.ZPP_Monotone.isMonotone = function (a) {
- var b = a,
- d = a,
- c = a.next;
- if (null != c) {
- do {
- var e = c;
- e.y < b.y && (b = e);
- e.y > d.y && (d = e);
- c = c.next
- } while (c != a)
- }
- var f = !0,
- l = b;
- if (d != b.next && (c = b.next, a = d, null != c)) {
- do {
- e = c;
- if (e.y < l.y) {
- f = !1;
- break
- }
- l = e;
- c = c.next
- } while (c != a)
- }
- if (!f) return !1;
- l = b;
- if (d != b.prev && (c = b.prev, a = d, null != c)) {
- do {
- e = c;
- if (e.y < l.y) {
- f = !1;
- break
- }
- l = e;
- c = c.prev
- } while (c != a)
- }
- return f
- };
- c.geom.ZPP_Monotone.getShared = function () {
- null == c.geom.ZPP_Monotone.sharedPPoly && (c.geom.ZPP_Monotone.sharedPPoly =
- new c.geom.ZPP_PartitionedPoly);
- return c.geom.ZPP_Monotone.sharedPPoly
- };
- c.geom.ZPP_Monotone.decompose = function (a, b) {
- null == b ? b = new c.geom.ZPP_PartitionedPoly(a) : b.init(a);
- if (null == b.vertices) return b;
- null == c.geom.ZPP_Monotone.queue && (c.geom.ZPP_Monotone.queue = new c.util.ZNPList_ZPP_PartitionVertex);
- var d = b.vertices,
- g = b.vertices;
- if (null != d) {
- do {
- var e = d;
- c.geom.ZPP_Monotone.queue.add(e);
- var f = 0,
- l = 0,
- f = e.next.x - e.x,
- l = e.next.y - e.y,
- h = 0,
- k = 0,
- h = e.prev.x - e.x,
- k = e.prev.y - e.y,
- f = 0 < k * f - h * l;
- e.type = c.geom.ZPP_Monotone.below(e.prev,
- 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;
- d = d.next
- } while (d != g)
- }
- g = c.geom.ZPP_Monotone.queue;
- if (null != g.head && null != g.head.next) {
- var d = g.head,
- h = l = f = e = null,
- k = 1,
- p, n, r;
- do {
- p = 0;
- f = d;
- for (e = d = null; null != f;) {
- p++;
- l = f;
- n = 0;
- for (r = k; null != l && n < k;) n++, l = l.next;
- 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;
- f = l
- }
- e.next = null;
- k <<= 1
- } while (1 <
- p);
- g.head = d;
- g.modified = !0;
- g.pushmod = !0
- }
- 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);
- for (; null != c.geom.ZPP_Monotone.queue.head;) {
- var q = c.geom.ZPP_Monotone.queue.pop_unsafe();
- switch (q.type) {
- case 0:
- q.helper = q;
- q.node = c.geom.ZPP_Monotone.edges.insert(q);
- break;
- case 1:
- g = q.prev;
- if (null == g.helper) throw "Fatal error (1): Polygon is not weakly-simple and clockwise";
- 2 == g.helper.type && b.add_diagonal(q, g.helper);
- c.geom.ZPP_Monotone.edges.remove_node(g.node);
- g.helper = null;
- break;
- case 3:
- g = function (a) {
- a = null;
- if (!c.geom.ZPP_Monotone.edges.empty()) {
- for (var b = c.geom.ZPP_Monotone.edges.parent; null != b.prev;) b =
- b.prev;
- for (; null != b;) {
- var d = b.data;
- if (!c.geom.ZPP_PartitionVertex.vert_lt(d, q)) {
- a = d;
- break
- }
- if (null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- }
- return a
- }(this);
- if (null != g) {
- if (null == g.helper) throw "Fatal error (2): Polygon is not weakly-simple and clockwise";
- b.add_diagonal(q, g.helper);
- g.helper = q
- }
- q.node = c.geom.ZPP_Monotone.edges.insert(q);
- q.helper = q;
- break;
- case 2:
- g = q.prev;
- if (null == g.helper) throw "Fatal error (3): Polygon is not weakly-simple and clockwise";
- 2 == g.helper.type && b.add_diagonal(q, g.helper);
- c.geom.ZPP_Monotone.edges.remove_node(g.node);
- g.helper = null;
- g = function (a) {
- a = null;
- if (!c.geom.ZPP_Monotone.edges.empty()) {
- for (var b = c.geom.ZPP_Monotone.edges.parent; null != b.prev;) b = b.prev;
- for (; null != b;) {
- var d = b.data;
- if (!c.geom.ZPP_PartitionVertex.vert_lt(d, q)) {
- a = d;
- break
- }
- if (null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- }
- return a
- }(this);
- if (null != g) {
- if (null == g.helper) throw "Fatal error (4): Polygon is not weakly-simple and clockwise";
- 2 == g.helper.type && b.add_diagonal(q, g.helper);
- g.helper = q
- }
- break;
- case 4:
- if (g = q.prev, c.geom.ZPP_Monotone.left_vertex(q)) {
- if (null == g.helper) throw "Fatal error (5): Polygon is not weakly-simple and clockwise";
- 2 == g.helper.type && b.add_diagonal(q, g.helper);
- c.geom.ZPP_Monotone.edges.remove_node(g.node);
- g.helper = null;
- q.node = c.geom.ZPP_Monotone.edges.insert(q);
- q.helper = q
- } else {
- g = function (a) {
- a = null;
- if (!c.geom.ZPP_Monotone.edges.empty()) {
- for (var b = c.geom.ZPP_Monotone.edges.parent; null != b.prev;) b = b.prev;
- for (; null !=
- b;) {
- var d = b.data;
- if (!c.geom.ZPP_PartitionVertex.vert_lt(d, q)) {
- a = d;
- break
- }
- if (null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- }
- return a
- }(this);
- if (null == g || null == g.helper) throw "Fatal error (6): Polygon is not weakly-simple and clockwise";
- 2 == g.helper.type && b.add_diagonal(q, g.helper);
- g.helper = q
- }
- }
- }
- return b
- };
- c.geom.ZPP_PartitionVertex = function () {
- this.next = this.prev = this.node = null;
- this.rightchain = !1;
- this.helper = null;
- this.type = 0;
- this.diagonals =
- null;
- this.forced = !1;
- this.id = this.mag = this.x = this.y = 0;
- this.id = c.geom.ZPP_PartitionVertex.nextId++;
- this.diagonals = new c.util.ZNPList_ZPP_PartitionVertex
- };
- s["zpp_nape.geom.ZPP_PartitionVertex"] = c.geom.ZPP_PartitionVertex;
- c.geom.ZPP_PartitionVertex.__name__ = ["zpp_nape", "geom", "ZPP_PartitionVertex"];
- c.geom.ZPP_PartitionVertex.get = function (a) {
- var b;
- 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,
- b.next = null);
- null;
- b.x = a.x;
- b.y = a.y;
- return b
- };
- c.geom.ZPP_PartitionVertex.rightdistance = function (a, b) {
- var d = a.next.y > a.y,
- c = 0,
- e = 0,
- c = a.next.x - a.x,
- e = a.next.y - a.y,
- f = 0,
- l = 0,
- f = b.x - a.x,
- l = b.y - a.y;
- return (d ? -1 : 1) * (l * c - f * e)
- };
- c.geom.ZPP_PartitionVertex.vert_lt = function (a, b) {
- var d;
- if (b == a || b == a.next) d = !0;
- else if (a.y == a.next.y) {
- d = a.x;
- var g = a.next.x;
- d = (d < g ? d : g) <= b.x
- } else d = 0 >= c.geom.ZPP_PartitionVertex.rightdistance(a, b);
- return d
- };
- c.geom.ZPP_PartitionVertex.edge_swap = function (a, b) {
- var d = a.node;
- a.node = b.node;
- b.node =
- d
- };
- c.geom.ZPP_PartitionVertex.edge_lt = function (a, b) {
- if (a == b && a.next == b.next) return !1;
- if (a == b.next) return !c.geom.ZPP_PartitionVertex.vert_lt(a, b);
- if (b == a.next) return c.geom.ZPP_PartitionVertex.vert_lt(b, a);
- if (a.y == a.next.y) return b.y == b.next.y ? function (b) {
- b = a.x;
- var d = a.next.x;
- return b > d ? b : d
- }(this) > function (a) {
- a = b.x;
- var d = b.next.x;
- return a > d ? a : d
- }(this) : 0 < c.geom.ZPP_PartitionVertex.rightdistance(b, a) || 0 < c.geom.ZPP_PartitionVertex.rightdistance(b, a.next);
- var d = c.geom.ZPP_PartitionVertex.rightdistance(a,
- b),
- g = c.geom.ZPP_PartitionVertex.rightdistance(a, b.next);
- if (0 == d && 0 == g) return function (b) {
- b = a.x;
- var d = a.next.x;
- return b > d ? b : d
- }(this) > function (a) {
- a = b.x;
- var d = b.next.x;
- return a > d ? a : d
- }(this);
- if (0 <= d * g) return 0 > d || 0 > g;
- d = c.geom.ZPP_PartitionVertex.rightdistance(b, a);
- g = c.geom.ZPP_PartitionVertex.rightdistance(b, a.next);
- return 0 <= d * g ? 0 < d || 0 < g : !1
- };
- c.geom.ZPP_PartitionVertex.prototype = {
- sort: function () {
- var a = 0,
- b = 0,
- d = 0,
- c = 0,
- e = function (e) {
- a = e.prev.x - e.x;
- b = e.prev.y - e.y;
- d = e.next.x - e.x;
- c = e.next.y - e.y;
- e = c * a - d * b;
- return 0 <
- e ? -1 : 0 == e ? 0 : 1
- }(this),
- f = this.diagonals;
- if (null != f.head && null != f.head.next) {
- var l = f.head,
- h = null,
- k = null,
- p = null,
- n = null,
- r = 1,
- q, w, t;
- do {
- q = 0;
- k = l;
- for (h = l = null; null != k;) {
- q++;
- p = k;
- w = 0;
- for (t = r; null != p && w < r;) w++, p = p.next;
- 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) {
- a = k.elt.x - e.x;
- b = k.elt.y - e.y;
- d = p.elt.x - e.x;
- c = p.elt.y - e.y;
- e = c * a - d * b;
- return 0 < e ? -1 : 0 == e ? 0 : 1
- }(this) : function (e) {
- var f = function (e) {
- a = e.prev.x - e.x;
- b = e.prev.y - e.y;
- d = k.elt.x - e.x;
- c = k.elt.y - e.y;
- e = c * a - d * b;
- return 0 < e ? -1 : 0 == e ? 0 : 1
- }(e),
- l = function (e) {
- a = e.prev.x - e.x;
- b = e.prev.y - e.y;
- d = p.elt.x - e.x;
- c = p.elt.y - e.y;
- e = c * a - d * b;
- return 0 < e ? -1 : 0 == e ? 0 : 1
- }(e);
- return 1 == f * l || 0 == f * l && (1 == f || 1 == l) ? 1 == function (e) {
- a = k.elt.x - e.x;
- b = k.elt.y - e.y;
- d = p.elt.x - e.x;
- c = p.elt.y - e.y;
- e = c * a - d * b;
- return 0 < e ? -1 : 0 == e ? 0 : 1
- }(e) : -1 == f || -1 == l ? -1 == l : 0 == f && 0 == l ? function (e) {
- a = e.x - e.prev.x;
- b = e.y - e.prev.y;
- d = k.elt.x - e.x;
- c = k.elt.y - e.y;
- var f = a * d + b * c;
- d = p.elt.x - e.x;
- c = p.elt.y - e.y;
- e = a * d + b * c;
- return 0 > f && 0 < e ? !0 : 0 > e && 0 < f ? !1 : !0
- }(e) : !0
- }(this)) ? (n = k, k = k.next, w--) : (n =
- p, p = p.next, t--), null != h ? h.next = n : l = n, h = n;
- k = p
- }
- h.next = null;
- r <<= 1
- } while (1 < q);
- f.head = l;
- f.modified = !0;
- f.pushmod = !0
- }
- },
- copy: function () {
- var a;
- 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);
- null;
- a.x = this.x;
- a.y = this.y;
- a.forced = this.forced;
- return a
- },
- free: function () {
- this.helper = null
- },
- alloc: function () {},
- __class__: c.geom.ZPP_PartitionVertex
- };
- c.geom.ZPP_PartitionedPoly = function (a) {
- this.vertices =
- this.next = null;
- this.init(a)
- };
- s["zpp_nape.geom.ZPP_PartitionedPoly"] = c.geom.ZPP_PartitionedPoly;
- c.geom.ZPP_PartitionedPoly.__name__ = ["zpp_nape", "geom", "ZPP_PartitionedPoly"];
- c.geom.ZPP_PartitionedPoly.getSharedPP = function () {
- null == c.geom.ZPP_PartitionedPoly.sharedPPList && (c.geom.ZPP_PartitionedPoly.sharedPPList = new c.util.ZNPList_ZPP_PartitionedPoly);
- return c.geom.ZPP_PartitionedPoly.sharedPPList
- };
- c.geom.ZPP_PartitionedPoly.getShared = function () {
- null == c.geom.ZPP_PartitionedPoly.sharedGVList && (c.geom.ZPP_PartitionedPoly.sharedGVList =
- new c.util.ZNPList_ZPP_GeomVert);
- return c.geom.ZPP_PartitionedPoly.sharedGVList
- };
- c.geom.ZPP_PartitionedPoly.prototype = {
- pull: function (a, b) {
- var d = null,
- g = a;
- do
- if (d = function (a) {
- a = c.geom.ZPP_GeomVert.get(g.x, g.y);
- null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
- return a
- }(this), d.forced = g.forced, null != g.diagonals.head)
- if (g.diagonals.inlined_pop_unsafe() == a) break;
- else g = this.pull(g, b);
- else g = g.next; while (g != a);
- var e = function (a) {
- a = 0;
- var b = d,
- c = d;
- if (null != b) {
- do {
- var e = b;
- a += e.x * (e.next.y -
- e.prev.y);
- b = b.next
- } while (b != c)
- }
- return 0.5 * a
- }(this);
- e * e >= h.Config.epsilon * h.Config.epsilon && (function (a) {
- for (var b = d, e = !0; e || b != d;)
- 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) {
- b == d && (d = b.next, e = !0);
- b.forced && (b.next.forced = !0);
- var g;
- g = null != b && b.prev == b ? b = b.next = b.prev = null : function (a) {
- a = b.next;
- b.prev.next = b.next;
- b.next.prev = b.prev;
- b = b.next = b.prev = null;
- return a
- }(a);
- b = g;
- if (null == b) {
- d = null;
- break
- }
- } else b = b.next;
- if (null != d) {
- do
- for (g = !1, b = d, e = !0; e || b !=
- d;) {
- var e = !1,
- k = b.prev,
- n = 0,
- r = 0,
- n = b.x - k.x,
- r = b.y - k.y,
- q = k = 0,
- k = b.next.x - b.x,
- q = b.next.y - b.y,
- n = q * n - k * r;
- if (n * n >= h.Config.epsilon * h.Config.epsilon) b = b.next;
- else if (b == d && (d = b.next, e = !0), g = null != b && b.prev == b ? b = b.next = b.prev = null : function (a) {
- a = b.next;
- b.prev.next = b.next;
- b.next.prev = b.prev;
- b = b.next = b.prev = null;
- return a
- }(a), b = g, g = !0, null == b) {
- g = !1;
- d = null;
- break
- }
- }
- while (g)
- }
- return null == d
- }(this) || b.add(d));
- return g
- },
- extract: function (a) {
- null == a && (a = new c.util.ZNPList_ZPP_GeomVert);
- if (null != this.vertices) {
- var b = this.vertices,
- d = this.vertices;
- if (null != b) {
- do b.sort(), b = b.next; while (b != d)
- }
- for (this.pull(this.vertices, a); null != this.vertices;) this.vertices = null != this.vertices && this.vertices.prev == this.vertices ? function (a) {
- a.vertices.next = a.vertices.prev = null;
- var b = a.vertices;
- b.helper = null;
- null;
- b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = b;
- return a.vertices = null
- }(this) : function (a) {
- var b = a.vertices.next;
- a.vertices.prev.next = a.vertices.next;
- a.vertices.next.prev = a.vertices.prev;
- a.vertices.next =
- a.vertices.prev = null;
- var d = a.vertices;
- d.helper = null;
- null;
- d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = d;
- a.vertices = null;
- return b
- }(this)
- }
- return a
- },
- pull_partitions: function (a, b) {
- var d;
- 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);
- null;
- var g = a;
- do
- if (d.vertices = function (a) {
- a = g.copy();
- null == d.vertices ? d.vertices = a.prev = a.next = a : (a.prev = d.vertices,
- a.next = d.vertices.next, d.vertices.next.prev = a, d.vertices.next = a);
- return a
- }(this), d.vertices.forced = g.forced, null != g.diagonals.head)
- if (g.diagonals.inlined_pop_unsafe() == a) break;
- else g = this.pull_partitions(g, b);
- else g = g.next; while (g != a);
- 0 != function (a) {
- a = 0;
- var b = d.vertices,
- c = d.vertices;
- if (null != b) {
- do {
- var g = b;
- a += g.x * (g.next.y - g.prev.y);
- b = b.next
- } while (b != c)
- }
- return 0.5 * a
- }(this) && b.add(d);
- return g
- },
- extract_partitions: function (a) {
- null == a && (a = new c.util.ZNPList_ZPP_PartitionedPoly);
- if (null != this.vertices) {
- var b =
- this.vertices,
- d = this.vertices;
- if (null != b) {
- do b.sort(), b = b.next; while (b != d)
- }
- for (this.pull_partitions(this.vertices, a); null != this.vertices;) this.vertices = null != this.vertices && this.vertices.prev == this.vertices ? function (a) {
- a.vertices.next = a.vertices.prev = null;
- var b = a.vertices;
- b.helper = null;
- null;
- b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = b;
- return a.vertices = null
- }(this) : function (a) {
- var b = a.vertices.next;
- a.vertices.prev.next = a.vertices.next;
- a.vertices.next.prev = a.vertices.prev;
- a.vertices.next = a.vertices.prev = null;
- var d = a.vertices;
- d.helper = null;
- null;
- d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = d;
- a.vertices = null;
- return b
- }(this);
- d = null;
- for (b = a.head; null != b;) b.elt.remove_collinear_vertices() ? a.erase(d) : (d = b, b = b.next)
- }
- return a
- },
- add_diagonal: function (a, b) {
- a.diagonals.add(b);
- b.diagonals.add(a);
- a.forced = b.forced = !0
- },
- remove_collinear_vertices: function () {
- for (var a = this.vertices, b = !0; b || a != this.vertices;)
- if (b = !1, this.eq(a, a.next)) {
- if (a == this.vertices &&
- (this.vertices = a.next, b = !0), a.forced && (a.next.forced = !0), a = null != a && a.prev == a ? function (b) {
- a.next = a.prev = null;
- b = a;
- b.helper = null;
- null;
- b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = b;
- return a = null
- }(this) : function (b) {
- b = a.next;
- a.prev.next = a.next;
- a.next.prev = a.prev;
- a.next = a.prev = null;
- var d = a;
- d.helper = null;
- null;
- d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = d;
- a = null;
- return b
- }(this), null == a) {
- this.vertices = null;
- break
- }
- } else a = a.next;
- if (null ==
- this.vertices) return !0;
- var d;
- do
- for (d = !1, a = this.vertices, b = !0; b || a != this.vertices;) {
- var b = !1,
- g = a.prev,
- e = 0,
- f = 0,
- e = a.x - g.x,
- f = a.y - g.y,
- l = g = 0,
- g = a.next.x - a.x,
- l = a.next.y - a.y,
- e = l * e - g * f;
- if (e * e >= h.Config.epsilon * h.Config.epsilon) a = a.next;
- else if (a == this.vertices && (this.vertices = a.next, b = !0), a = null != a && a.prev == a ? function (b) {
- a.next = a.prev = null;
- b = a;
- b.helper = null;
- null;
- b.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = b;
- return a = null
- }(this) : function (b) {
- b = a.next;
- a.prev.next = a.next;
- a.next.prev =
- a.prev;
- a.next = a.prev = null;
- var d = a;
- d.helper = null;
- null;
- d.next = c.geom.ZPP_PartitionVertex.zpp_pool;
- c.geom.ZPP_PartitionVertex.zpp_pool = d;
- a = null;
- return b
- }(this), d = !0, null == a) {
- d = !1;
- this.vertices = null;
- break
- }
- }
- while (d);
- return null == this.vertices
- },
- init: function (a) {
- if (null != a) {
- var b = 0 < function (b) {
- b = 0;
- if (null != a) {
- var d = a;
- do {
- var c = d;
- b += c.x * (c.next.y - c.prev.y);
- d = d.next
- } while (d != a)
- }
- return 0.5 * b
- }(this),
- d = a;
- do this.vertices = b ? function (a) {
- var b = c.geom.ZPP_PartitionVertex.get(d);
- null == a.vertices ? a.vertices = b.prev =
- b.next = b : (b.prev = a.vertices, b.next = a.vertices.next, a.vertices.next.prev = b, a.vertices.next = b);
- return b
- }(this) : function (a) {
- var b = c.geom.ZPP_PartitionVertex.get(d);
- 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);
- return b
- }(this), this.vertices.forced = d.forced, d = d.next; while (d != a);
- this.remove_collinear_vertices()
- }
- },
- free: function () {},
- alloc: function () {},
- eq: function (a, b) {
- return c.geom.ZPP_VecMath.vec_dsq(a.x, a.y, b.x, b.y) < h.Config.epsilon *
- h.Config.epsilon
- },
- __class__: c.geom.ZPP_PartitionedPoly
- };
- c.geom.ZPP_Ray = function () {
- this.zip_dir = !1;
- this.originx = this.originy = this.dirx = this.diry = this.idirx = this.idiry = this.normalx = this.normaly = this.absnormalx = this.absnormaly = 0;
- this.userData = null;
- this.maxdist = 0;
- this.origin = this.direction = null;
- this.origin = h.geom.Vec2.get(null, null, null);
- this.origin.zpp_inner._invalidate = A(this, this.origin_invalidate);
- this.direction = h.geom.Vec2.get(null, null, null);
- this.direction.zpp_inner._invalidate = A(this, this.direction_invalidate);
- this.diry = this.dirx = this.originy = this.originx = 0;
- this.zip_dir = !1
- };
- s["zpp_nape.geom.ZPP_Ray"] = c.geom.ZPP_Ray;
- c.geom.ZPP_Ray.__name__ = ["zpp_nape", "geom", "ZPP_Ray"];
- c.geom.ZPP_Ray.prototype = {
- polysect2: function (a, b, d) {
- 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;) {
- var n = k,
- r = m.elt;
- if (b || 0 > r.gnormx * this.dirx + r.gnormy * this.diry) {
- var q = 0,
- w = 0,
- q = n.x - p.x,
- w = n.y - p.y,
- t = r = 0,
- 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 = q, f = m.elt), q > e && (e = q, l = m.elt))))
- }
- m = m.next;
- p = n;
- k = k.next
- }
- n = k = a.gverts.next;
- r = m.elt;
- 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 =
- q, f = m.elt), q > e && (e = q, l = m.elt))));
- if (null != f) {
- m = b = 0;
- b = f.gnormx;
- m = f.gnormy;
- if (k = 0 < b * this.dirx + m * this.diry) b = -b, m = -m;
- g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, m, null), g, k, a.outer);
- b = null;
- for (m = d.zpp_inner.inner.head; null != m;) {
- k = m.elt;
- if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- n = g.zpp_inner.toiDistance;
- if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- if (n < k.zpp_inner.toiDistance) break;
- b = m;
- m = m.next
- }
- d.zpp_inner.inner.inlined_insert(b,
- g)
- }
- if (null != l && f != l) {
- b = l.gnormx;
- m = l.gnormy;
- if (k = 0 < b * this.dirx + m * this.diry) b = -b, m = -m;
- g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, m, null), e, k, a.outer);
- b = null;
- for (m = d.zpp_inner.inner.head; null != m;) {
- k = m.elt;
- if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- a = g.zpp_inner.toiDistance;
- if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- if (a < k.zpp_inner.toiDistance) break;
- b = m;
- m = m.next
- }
- d.zpp_inner.inner.inlined_insert(b,
- g)
- }
- },
- polysect: function (a, b, d) {
- for (var g = null, e = a.edges.head, f = a.gverts.next, l = f, f = f.next; null != f;) {
- var m = f,
- k = e.elt;
- if (b || 0 > k.gnormx * this.dirx + k.gnormy * this.diry) {
- var p = 0,
- n = 0,
- p = m.x - l.x,
- n = m.y - l.y,
- r = k = 0,
- 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)))
- }
- e = e.next;
- l = m;
- f = f.next
- }
- m = f = a.gverts.next;
- k = e.elt;
- if (b || 0 > k.gnormx * this.dirx + k.gnormy *
- 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)));
- if (null != g) {
- e = b = 0;
- b = g.gnormx;
- e = g.gnormy;
- if (g = 0 < b * this.dirx + e * this.diry) b = -b, e = -e;
- return c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b, e, null), d, g, a.outer)
- }
- return null
- },
- circlesect2: function (a, b, d) {
- 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 * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy));
- var g = 0,
- e = 0,
- g = this.originx - a.worldCOMx,
- e = this.originy - a.worldCOMy,
- f = this.dirx * this.dirx + this.diry * this.diry,
- l = 2 * (g * this.dirx + e * this.diry),
- g = g * g + e * e - a.radius * a.radius,
- e = l * l - 4 * f * g;
- if (0 == e) {
- var m = -l / 2 * f;
- if ((!b || 0 < g) && 0 < m && m <= this.maxdist) {
- var e = l = 0,
- l = this.originx,
- e = this.originy,
- f = m,
- l = l + this.dirx * f,
- e = e + this.diry * f,
- f = 1,
- l = l - a.worldCOMx * f,
- e = e - a.worldCOMy * f,
- k = 1 / Math.sqrt(l * l + e * e),
- f = k,
- l = l * f,
- e = e * f;
- 0 >= g && (l = -l, e = -e);
- g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(l, e, null), m, 0 >= g, a.outer);
- l = null;
- for (e = d.zpp_inner.inner.head; null != e;) {
- m = e.elt;
- if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- a = g.zpp_inner.toiDistance;
- if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- if (a < m.zpp_inner.toiDistance) break;
- l = e;
- e = e.next
- }
- d.zpp_inner.inner.inlined_insert(l, g)
- }
- } else {
- e = Math.sqrt(e);
- f = 1 / (2 * f);
- g = (-l - e) * f;
- f *= -l + e;
- if (0 < g && g <= this.maxdist) {
- l = this.originx;
- e = this.originy;
- m = g;
- l += this.dirx * m;
- e += this.diry * m;
- m = 1;
- l -= a.worldCOMx * m;
- e -= a.worldCOMy * m;
- m = k = 1 / Math.sqrt(l * l + e * e);
- g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(l * m, e * m, null), g, !1, a.outer);
- l = null;
- for (e = d.zpp_inner.inner.head; null !=
- e;) {
- m = e.elt;
- if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- k = g.zpp_inner.toiDistance;
- if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- if (k < m.zpp_inner.toiDistance) break;
- l = e;
- e = e.next
- }
- d.zpp_inner.inner.inlined_insert(l, g)
- }
- if (0 < f && f <= this.maxdist && b) {
- l = this.originx;
- e = this.originy;
- m = f;
- l += this.dirx * m;
- e += this.diry * m;
- m = 1;
- l -= a.worldCOMx * m;
- e -= a.worldCOMy * m;
- b = l * l + e * e;
- m = k = 1 / Math.sqrt(b);
- l *= m;
- e *= m;
- l = -l;
- e = -e;
- g = c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(l,
- e, null), f, !0, a.outer);
- l = null;
- for (e = d.zpp_inner.inner.head; null != e;) {
- m = e.elt;
- if (null != g.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- a = g.zpp_inner.toiDistance;
- if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- if (a < m.zpp_inner.toiDistance) break;
- l = e;
- e = e.next
- }
- d.zpp_inner.inner.inlined_insert(l, g)
- }
- }
- },
- circlesect: function (a, b, d) {
- 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 * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy));
- var g = 0,
- e = 0,
- g = this.originx - a.worldCOMx,
- e = this.originy - a.worldCOMy,
- f = this.dirx * this.dirx + this.diry * this.diry,
- l = 2 * (g * this.dirx + e * this.diry),
- g = g * g + e * e - a.radius * a.radius,
- e = l * l - 4 * f * g;
- if (0 == e) {
- 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)
- } else if (e = Math.sqrt(e), f = 1 / (2 * f), g = (-l - e) * f, f *= -l + e, 0 < g) {
- 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),
- c.geom.ZPP_ConvexRayResult.getRay(h.geom.Vec2.get(b * l, d * l, null), g, !1, a.outer)
- } 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);
- return null
- },
- aabbsect: function (a) {
- var b = this.originy >= a.miny && this.originy <= a.maxy;
- if (this.originx >= a.minx && this.originx <= a.maxx && b) return 0;
- b = -1;
- do
- if (!(0 <=
- 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)) {
- if (0 < this.dirx) {
- var d = (a.minx - this.originx) * this.idirx;
- if (0 <= d && d <= this.maxdist) {
- var c = this.originy + d * this.diry;
- if (c >= a.miny && c <= a.maxy) {
- b = d;
- break
- }
- }
- } 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))) {
- b = d;
- break
- }
- 0 < this.diry ? (d = (a.miny - this.originy) * this.idiry, 0 <= d && d <= this.maxdist &&
- (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)))
- }
- while (0);
- return b
- },
- aabbtest: function (a) {
- var b = this.normalx * (this.originx - 0.5 * (a.minx + a.maxx)) + this.normaly * (this.originy - 0.5 * (a.miny + a.maxy));
- return (0 > b ? -b : b) < 0.5 * this.absnormalx * (a.maxx - a.minx) + 0.5 * this.absnormaly * (a.maxy - a.miny)
- },
- rayAABB: function () {
- var a = this.originx,
- b = a,
- d = this.originy,
- g = d;
- this.maxdist >= Math.POSITIVE_INFINITY ?
- (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);
- if (b < a) var e = a,
- a = b,
- b = e;
- g < d && (e = d, d = g, g = e);
- return c.geom.ZPP_AABB.get(a, d, b, g)
- },
- validate_dir: function () {
- if (this.zip_dir) {
- this.zip_dir = !1;
- if (this.dirx * this.dirx + this.diry * this.diry < h.Config.epsilon) throw "Error: Ray::direction is degenerate";
- var a = 1 / Math.sqrt(this.dirx * this.dirx + this.diry * this.diry);
- this.dirx *= a;
- this.diry *= a;
- this.idirx = 1 / this.dirx;
- this.idiry = 1 / this.diry;
- this.normalx = -this.diry;
- this.normaly = this.dirx;
- this.absnormalx = function (a) {
- a = a.normalx;
- return 0 > a ? -a : a
- }(this);
- this.absnormaly = function (a) {
- a = a.normaly;
- return 0 > a ? -a : a
- }(this)
- }
- },
- invalidate_dir: function () {
- this.zip_dir = !0
- },
- direction_invalidate: function (a) {
- this.dirx = a.x;
- this.diry = a.y;
- this.zip_dir = !0
- },
- origin_invalidate: function (a) {
- this.originx = a.x;
- this.originy = a.y
- },
- __class__: c.geom.ZPP_Ray
- };
- c.geom.ZPP_SimpleVert = function () {
- this.next =
- this.node = null;
- this.id = 0;
- this.links = null;
- this.x = this.y = 0;
- this.forced = !1;
- this.id = c.ZPP_ID.ZPP_SimpleVert();
- 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);
- null;
- this.links.lt = c.geom.ZPP_SimpleVert.less_xy
- };
- s["zpp_nape.geom.ZPP_SimpleVert"] = c.geom.ZPP_SimpleVert;
- c.geom.ZPP_SimpleVert.__name__ = ["zpp_nape", "geom", "ZPP_SimpleVert"];
- c.geom.ZPP_SimpleVert.less_xy =
- function (a, b) {
- return a.y < b.y || a.y == b.y && a.x < b.x
- };
- c.geom.ZPP_SimpleVert.swap_nodes = function (a, b) {
- var d = a.node;
- a.node = b.node;
- b.node = d
- };
- c.geom.ZPP_SimpleVert.get = function (a, b) {
- var d;
- 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);
- null;
- d.x = a;
- d.y = b;
- return d
- };
- c.geom.ZPP_SimpleVert.prototype = {
- alloc: function () {},
- free: function () {
- this.links.clear();
- this.node = null;
- this.forced = !1
- },
- __class__: c.geom.ZPP_SimpleVert
- };
- c.geom.ZPP_SimpleSeg = function () {
- this.next = this.prev = this.node = null;
- this.id = 0;
- this.left = this.right = this.vertices = null;
- this.id = c.ZPP_ID.ZPP_SimpleSeg();
- 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);
- null;
- this.vertices.lt = A(this, this.less_xy)
- };
- s["zpp_nape.geom.ZPP_SimpleSeg"] = c.geom.ZPP_SimpleSeg;
- c.geom.ZPP_SimpleSeg.__name__ = ["zpp_nape", "geom", "ZPP_SimpleSeg"];
- c.geom.ZPP_SimpleSeg.get = function (a, b) {
- var d;
- 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);
- null;
- d.left = a;
- d.right = b;
- d.vertices.insert(a);
- d.vertices.insert(b);
- return d
- };
- c.geom.ZPP_SimpleSeg.prototype = {
- less_xy: function (a, b) {
- return a.x < b.x || a.x == b.x && a.y < b.y
- },
- alloc: function () {},
- free: function () {
- this.node = this.prev = this.left = this.right = null;
- this.vertices.clear()
- },
- __class__: c.geom.ZPP_SimpleSeg
- };
- c.geom.ZPP_SimpleEvent = function () {
- this.vertex = this.segment = this.segment2 = this.node = this.next = null;
- this.type = 0
- };
- s["zpp_nape.geom.ZPP_SimpleEvent"] = c.geom.ZPP_SimpleEvent;
- c.geom.ZPP_SimpleEvent.__name__ = ["zpp_nape", "geom", "ZPP_SimpleEvent"];
- c.geom.ZPP_SimpleEvent.swap_nodes = function (a, b) {
- var d = a.node;
- a.node = b.node;
- b.node = d
- };
- c.geom.ZPP_SimpleEvent.less_xy = function (a, b) {
- 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
- };
- c.geom.ZPP_SimpleEvent.get =
- function (a) {
- var b;
- 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);
- null;
- b.vertex = a;
- return b
- };
- c.geom.ZPP_SimpleEvent.prototype = {
- alloc: function () {},
- free: function () {
- this.node = this.segment = this.segment2 = this.vertex = null
- },
- __class__: c.geom.ZPP_SimpleEvent
- };
- c.geom.ZPP_SimpleSweep = function () {
- this.tree = null;
- this.sweepx = 0;
- null == c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool ? this.tree = new c.util.ZPP_Set_ZPP_SimpleSeg :
- (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);
- null;
- this.tree.lt = A(this, this.edge_lt);
- this.tree.swapped = A(this, this.swap_nodes)
- };
- s["zpp_nape.geom.ZPP_SimpleSweep"] = c.geom.ZPP_SimpleSweep;
- c.geom.ZPP_SimpleSweep.__name__ = ["zpp_nape", "geom", "ZPP_SimpleSweep"];
- c.geom.ZPP_SimpleSweep.prototype = {
- intersection: function (a, b) {
- if (null == a || null == b || a.left == b.left || a.left == b.right || a.right == b.left || a.right == b.right) return null;
- var d = 0,
- g = 0,
- d = a.right.x - a.left.x,
- g = a.right.y - a.left.y,
- e = 0,
- f = 0,
- e = b.right.x - b.left.x,
- f = b.right.y - b.left.y,
- l = f * d - e * g;
- if (0 == l) return null;
- var l = 1 / l,
- h = 0,
- k = 0,
- h = b.left.x - a.left.x,
- k = b.left.y - a.left.y,
- p = (f * h - e * k) * l;
- if (0 > p || 1 < p) return null;
- l *= g * h - d * k;
- if (0 > l || 1 < l) return null;
- if (0 == l || 1 == l || 0 == p || 1 == p) {
- d = 0 == l;
- if (1 == l && d) throw "corner case 1a";
- 1 == l && (d = !0);
- if (0 == p && d) throw "corner case 1b";
- 0 == p && (d = !0);
- if (1 == p && d) throw "corner case 1c";
- p = 0 == l ? b.left : 1 == l ? b.right : 0 == p ? a.left : a.right
- } else p = c.geom.ZPP_SimpleVert.get(0.5 * (a.left.x +
- d * p + b.left.x + e * l), 0.5 * (a.left.y + g * p + b.left.y + f * l));
- p = c.geom.ZPP_SimpleEvent.get(p);
- p.type = 0;
- p.segment = a;
- p.segment2 = b;
- return p
- },
- intersect: function (a, b) {
- 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)) *
- ((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
- },
- remove: function (a) {
- var b = this.tree.successor_node(a.node),
- d = this.tree.predecessor_node(a.node);
- null != b && (b.data.prev = a.prev);
- null != d && (d.data.next = a.next);
- this.tree.remove_node(a.node);
- a.node = null
- },
- add: function (a) {
- a.node = this.tree.insert(a);
- var b = this.tree.successor_node(a.node),
- d = this.tree.predecessor_node(a.node);
- null != b && (a.next = b.data, b.data.prev = a);
- null != d && (a.prev = d.data, d.data.next = a);
- return a
- },
- clear: function () {
- this.tree.clear()
- },
- edge_lt: function (a, b) {
- var d = 0,
- c = 0,
- e = 0,
- f = 0,
- l;
- if (a.left == b.left && a.right == b.right) return !1;
- 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;
- 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 -
- b.left.x, f = a.left.y - b.left.y, d = 0 > (l ? c * e - d * f : f * d - e * c)), !d;
- 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;
- 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,
- d = 0 > (l ? c * e - d * f : f * d - e * c)), d;
- if (a.left.x == a.right.x) {
- 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;
- var h;
- 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 - b.left.x;
- f = a.left.y - b.left.y;
- h = l ? c * e - d * f : f * d - e * c;
- l = b.right.x < b.left.x;
- d = b.right.x - b.left.x;
- c = b.right.y - b.left.y;
- e = a.right.x - b.left.x;
- f = a.right.y - b.left.y;
- return 0 <= h * (l ? c * e - d * f : f * d - e * c) ? 0 <= h : this.sweepx >= a.left.x
- }
- if (b.left.x == b.right.x) return 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, 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;
- 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;
- h = 0 > (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;
- if (h == 0 > (l ? c * e -
- d * f : f * d - e * c)) return h;
- 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 - b.left.x;
- f = a.left.y - b.left.y;
- h = 0 <= (l ? c * e - d * f : f * d - e * c);
- l = b.right.x < b.left.x;
- d = b.right.x - b.left.x;
- c = b.right.y - b.left.y;
- e = a.right.x - b.left.x;
- f = a.right.y - b.left.y;
- 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
- },
- swap_nodes: function (a, b) {
- var d = a.node;
- a.node = b.node;
- b.node = d
- },
- __class__: c.geom.ZPP_SimpleSweep
- };
- c.geom.ZPP_Simple = function () {};
- s["zpp_nape.geom.ZPP_Simple"] = c.geom.ZPP_Simple;
- c.geom.ZPP_Simple.__name__ = ["zpp_nape", "geom", "ZPP_Simple"];
- c.geom.ZPP_Simple.decompose = function (a, b) {
- 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);
- 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 :
- (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);
- 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,
- 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);
- var d = null,
- g = null;
- if (null != a) {
- var e = a;
- do {
- var f = e,
- l = c.geom.ZPP_SimpleVert.get(f.x, f.y),
- h = function (a) {
- for (a = c.geom.ZPP_Simple.vertices.parent; null != a;)
- if (c.geom.ZPP_Simple.vertices.lt(l, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.vertices.lt(a.data, l)) a = a.next;
- else break;
- return a
- }(this);
- 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);
- if (null != g) {
- var f = c.geom.ZPP_SimpleEvent.get(g),
- h = c.geom.ZPP_SimpleEvent.get(l),
- k;
- 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));
- f.segment = h.segment = k;
- c.geom.ZPP_Simple.queue.insert(f);
- c.geom.ZPP_Simple.queue.insert(h);
- g.links.insert(l);
- l.links.insert(g)
- }
- g = l;
- null == d && (d = l);
- e = e.next
- } while (e != a)
- }
- f = c.geom.ZPP_SimpleEvent.get(g);
- h = c.geom.ZPP_SimpleEvent.get(d);
- 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));
- f.segment = h.segment = k;
- c.geom.ZPP_Simple.queue.insert(f);
- c.geom.ZPP_Simple.queue.insert(h);
- g.links.insert(d);
- d.links.insert(g);
- null == c.geom.ZPP_Simple.ints && (null == c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool ? c.geom.ZPP_Simple.ints =
- 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);
- for (; !c.geom.ZPP_Simple.queue.empty();) {
- d = c.geom.ZPP_Simple.queue.pop_front();
- c.geom.ZPP_Simple.sweep.sweepx = d.vertex.x;
- if (1 == d.type) {
- g = d.segment;
- c.geom.ZPP_Simple.sweep.add(g);
- if (null != g.next && null != g && (g.next.id < g.id ? !c.geom.ZPP_Simple.inthash.has(g.next.id,
- g.id) : !c.geom.ZPP_Simple.inthash.has(g.id, g.next.id))) {
- var p = c.geom.ZPP_Simple.sweep.intersection(g.next, g);
- if (null != p)
- if (p.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
- if (f = function (a) {
- for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
- if (c.geom.ZPP_Simple.queue.lt(p, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.queue.lt(a.data, p)) a = a.next;
- else break;
- return a
- }(this), null == f) h = function (a) {
- for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
- if (c.geom.ZPP_Simple.ints.lt(p, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.ints.lt(a.data,
- p)) a = a.next;
- else break;
- return a
- }(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));
- else {
- f = f.data;
- if (f.segment !=
- p.segment || p.segment2 != f.segment2) throw "corner case 2, shiiiit.";
- 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;
- c.geom.ZPP_SimpleEvent.zpp_pool = f
- } 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, c.geom.ZPP_SimpleEvent.zpp_pool = f
- }
- 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))
- if (p.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
- if (f = function (a) {
- for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
- if (c.geom.ZPP_Simple.queue.lt(p, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.queue.lt(a.data, p)) a = a.next;
- else break;
- return a
- }(this),
- null == f) h = function (a) {
- for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
- if (c.geom.ZPP_Simple.ints.lt(p, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.ints.lt(a.data, p)) a = a.next;
- else break;
- return a
- }(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,
- g.prev.id, !0)) : c.geom.ZPP_Simple.inthash.add(c.util.Hashable2_Boolfalse.get(g.prev.id, g.id, !0));
- else {
- f = f.data;
- if (f.segment != p.segment || p.segment2 != f.segment2) throw "corner case 2, shiiiit.";
- 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;
- c.geom.ZPP_SimpleEvent.zpp_pool = f
- } 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, c.geom.ZPP_SimpleEvent.zpp_pool = f
- } else if (2 == d.type) {
- 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) :
- !c.geom.ZPP_Simple.inthash.has(k.id, e.id)) && (p = c.geom.ZPP_Simple.sweep.intersection(e, k), null != p)))
- if (p.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
- if (f = function (a) {
- for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
- if (c.geom.ZPP_Simple.queue.lt(p, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.queue.lt(a.data, p)) a = a.next;
- else break;
- return a
- }(this), null == f) h = function (a) {
- for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
- if (c.geom.ZPP_Simple.ints.lt(p, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.ints.lt(a.data, p)) a = a.next;
- else break;
- return a
- }(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));
- else {
- f = f.data;
- if (f.segment != p.segment || p.segment2 !=
- f.segment2) throw "corner case 2, shiiiit.";
- 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;
- c.geom.ZPP_SimpleEvent.zpp_pool = f
- } 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,
- c.geom.ZPP_SimpleEvent.zpp_pool = f
- } else {
- var p = d.vertex,
- f = null == p.node,
- n = d.segment,
- r = d.segment2;
- r.next != n && (g = n, n = r, r = g);
- e = null == function (a) {
- for (a = n.vertices.parent; null != a;)
- if (n.vertices.lt(p, a.data)) a = a.prev;
- else if (n.vertices.lt(a.data, p)) a = a.next;
- else break;
- return a
- }(this);
- g = null == function (a) {
- for (a = r.vertices.parent; null != a;)
- if (r.vertices.lt(p, a.data)) a = a.prev;
- else if (r.vertices.lt(a.data, p)) a = a.next;
- else break;
- return a
- }(this);
- e && (h = n.vertices.insert(p), e = p == n.left ? p : n.vertices.predecessor_node(h).data,
- 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));
- 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));
- f && (p.node = c.geom.ZPP_Simple.vertices.insert(p));
- p.forced = !0;
- 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));
- 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))) {
- var q = c.geom.ZPP_Simple.sweep.intersection(r.next, r);
- if (null != q)
- if (q.vertex.x >= c.geom.ZPP_Simple.sweep.sweepx)
- if (f = function (a) {
- for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
- if (c.geom.ZPP_Simple.queue.lt(q,
- a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.queue.lt(a.data, q)) a = a.next;
- else break;
- return a
- }(this), null == f) h = function (a) {
- for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
- if (c.geom.ZPP_Simple.ints.lt(q, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.ints.lt(a.data, q)) a = a.next;
- else break;
- return a
- }(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),
- 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));
- else {
- f = f.data;
- if (f.segment != q.segment || q.segment2 != f.segment2) throw "corner case 2, shiiiit.";
- 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
- } 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
- }
- 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))
- if (q.vertex.x >=
- c.geom.ZPP_Simple.sweep.sweepx)
- if (f = function (a) {
- for (a = c.geom.ZPP_Simple.queue.parent; null != a;)
- if (c.geom.ZPP_Simple.queue.lt(q, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.queue.lt(a.data, q)) a = a.next;
- else break;
- return a
- }(this), null == f) h = function (a) {
- for (a = c.geom.ZPP_Simple.ints.parent; null != a;)
- if (c.geom.ZPP_Simple.ints.lt(q, a.data)) a = a.prev;
- else if (c.geom.ZPP_Simple.ints.lt(a.data, q)) a = a.next;
- else break;
- return a
- }(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), 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));
- else {
- f = f.data;
- if (f.segment != q.segment || q.segment2 != f.segment2) throw "corner case 2, shiiiit.";
- 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
- } 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;
- c.geom.ZPP_Simple.ints.remove(d)
- }
- 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
- }
- d = 0;
- for (e = c.geom.ZPP_Simple.inthash.table.length; d < e;)
- if (h = d++, f = c.geom.ZPP_Simple.inthash.table[h], null != f) {
- 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;
- c.geom.ZPP_Simple.inthash.table[h] = null
- }
- 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);
- return b
- };
- c.geom.ZPP_Simple.clip_polygon = function (a, b) {
- var d = null,
- g = a.first(),
- e = g,
- f = g.links.parent,
- l = f.data,
- h = (null == f.prev ? f.next : f.prev).data;
- 0 > function (a) {
- var b = a = 0;
- a = g.x - l.x;
- var b = g.y - l.y,
- d = 0,
- c = 0,
- d = h.x - g.x,
- c = h.y - g.y;
- return c * a - d * b
- }(this) && (h = l);
- d = function (a) {
- a = c.geom.ZPP_GeomVert.get(g.x, g.y);
- null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
- return a
- }(this);
- for (d.forced = g.forced;;) {
- g.links.remove(h);
- h.links.remove(g);
- if (h == e) {
- 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);
- break
- }
- d = function (a) {
- a = c.geom.ZPP_GeomVert.get(h.x, h.y);
- null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
- return a
- }(this);
- d.forced = h.forced;
- 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;
- else {
- var k = null,
- f = 0;
- if (!h.links.empty()) {
- for (var p = h.links.parent; null !=
- p.prev;) p = p.prev;
- for (; null != p;) {
- var n = p.data;
- if (null == k) k = n, f = function (a) {
- var b = a = 0;
- a = h.x - g.x;
- var b = h.y - g.y,
- d = 0,
- c = 0,
- d = n.x - h.x,
- c = n.y - h.y;
- return c * a - d * b
- }(this);
- else {
- var r = function (a) {
- var b = a = 0;
- a = h.x - g.x;
- var b = h.y - g.y,
- d = 0,
- c = 0,
- d = n.x - h.x,
- c = n.y - h.y;
- return c * a - d * b
- }(this);
- 0 < r && 0 >= f ? (k = n, f = r) : 0 <= f * r && 0 < function (a) {
- var b = a = 0;
- a = h.x - n.x;
- var b = h.y - n.y,
- d = 0,
- c = 0,
- d = k.x - h.x,
- c = k.y - h.y;
- return c * a - d * b
- }(this) && (k = n, f = r)
- } if (null != p.next)
- for (p = p.next; null != p.prev;) p = p.prev;
- else {
- for (; null != p.parent && p == p.parent.next;) p = p.parent;
- p = p.parent
- }
- }
- }
- 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 = k
- }
- }
- a.remove(e);
- f = e;
- f.links.clear();
- f.node = null;
- f.forced = !1;
- f.next = c.geom.ZPP_SimpleVert.zpp_pool;
- c.geom.ZPP_SimpleVert.zpp_pool = f;
- b.add(d)
- };
- c.geom.ZPP_Simple.isSimple = function (a) {
- 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);
- var b =
- c.geom.ZPP_Simple.list_vertices;
- null == b && (b = c.geom.ZPP_Simple.list_vertices = new c.util.ZNPList_ZPP_SimpleVert);
- if (null != a) {
- var d = a;
- do {
- var g = d;
- b.add(c.geom.ZPP_SimpleVert.get(g.x, g.y));
- d = d.next
- } while (d != a)
- }
- a = c.geom.ZPP_Simple.list_queue;
- null == a && (a = c.geom.ZPP_Simple.list_queue = new c.util.ZNPList_ZPP_SimpleEvent);
- for (var e = b.head, d = e.elt, e = e.next; null != e;) {
- var g = e.elt,
- f = a.add(c.geom.ZPP_SimpleEvent.get(d)),
- l = a.add(c.geom.ZPP_SimpleEvent.get(g)),
- h = f,
- k = l;
- c.geom.ZPP_SimpleEvent.less_xy(f, l) ? (f.type = 1,
- 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));
- h.segment = k.segment = d;
- d = g;
- e = e.next
- }
- g = b.head.elt;
- f = a.add(c.geom.ZPP_SimpleEvent.get(d));
- l = a.add(c.geom.ZPP_SimpleEvent.get(g));
- e = f;
- h = l;
- 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));
- e.segment = h.segment = g;
- g = a;
- if (null != g.head && null != g.head.next) {
- var d = g.head,
- h = e = l = f = null,
- k = 1,
- p, n, r;
- do {
- p = 0;
- l = d;
- for (f = d = null; null != l;) {
- p++;
- e = l;
- n = 0;
- for (r = k; null != e && n < k;) n++, e = e.next;
- 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;
- l = e
- }
- f.next = null;
- k <<= 1
- } while (1 < p);
- g.head = d;
- g.modified = !0;
- g.pushmod = !0
- }
- for (g = !0; null != a.head;) {
- d = a.pop_unsafe();
- f = d.segment;
- if (1 == d.type) {
- 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)) {
- g = !1;
- break
- }
- } else if (2 ==
- d.type) {
- if (c.geom.ZPP_Simple.sweep.intersect(f.prev, f.next)) {
- g = !1;
- break
- }
- c.geom.ZPP_Simple.sweep.remove(f);
- 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
- }
- 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
- }
- 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,
- 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;
- 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;
- return g
- };
- c.geom.ZPP_SimplifyV = function () {
- this.flag = this.forced = !1;
- this.next = this.prev = null;
- this.x = this.y = 0
- };
- s["zpp_nape.geom.ZPP_SimplifyV"] = c.geom.ZPP_SimplifyV;
- c.geom.ZPP_SimplifyV.__name__ = ["zpp_nape", "geom", "ZPP_SimplifyV"];
- c.geom.ZPP_SimplifyV.get = function (a) {
- var b;
- 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);
- null;
- b.x = a.x;
- b.y = a.y;
- b.flag = !1;
- return b
- };
- c.geom.ZPP_SimplifyV.prototype = {
- alloc: function () {},
- free: function () {},
- __class__: c.geom.ZPP_SimplifyV
- };
- c.geom.ZPP_SimplifyP = function () {
- this.next = this.min = this.max = null
- };
- s["zpp_nape.geom.ZPP_SimplifyP"] = c.geom.ZPP_SimplifyP;
- c.geom.ZPP_SimplifyP.__name__ = ["zpp_nape", "geom", "ZPP_SimplifyP"];
- c.geom.ZPP_SimplifyP.get = function (a, b) {
- var d;
- 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);
- null;
- d.min = a;
- d.max = b;
- return d
- };
- c.geom.ZPP_SimplifyP.prototype = {
- alloc: function () {},
- free: function () {
- this.min = this.max = null
- },
- __class__: c.geom.ZPP_SimplifyP
- };
- c.geom.ZPP_Simplify = function () {};
- s["zpp_nape.geom.ZPP_Simplify"] = c.geom.ZPP_Simplify;
- c.geom.ZPP_Simplify.__name__ = ["zpp_nape", "geom", "ZPP_Simplify"];
- c.geom.ZPP_Simplify.lessval = function (a, b) {
- return a.x - b.x + (a.y - b.y)
- };
- c.geom.ZPP_Simplify.less = function (a, b) {
- return 0 > a.x - b.x + (a.y - b.y)
- };
- c.geom.ZPP_Simplify.distance = function (a, b, d) {
- var g = 0,
- e = 0,
- g = d.x - b.x,
- e = d.y - b.y,
- f = 0,
- l = 0,
- f = a.x - b.x,
- l = a.y - b.y;
- if (0 == g * g + e * e) return f * f + l * l;
- b = (f * g + l * e) / (g * g + e * e);
- if (0 >= b) return f * f + l * l;
- if (1 <= b) return c.geom.ZPP_VecMath.vec_dsq(a.x, a.y, d.x, d.y);
- f -= g * b;
- l -= e * b;
- return f * f + l * l
- };
- c.geom.ZPP_Simplify.simplify = function (a, b) {
- var d = null,
- g = null,
- e =
- null;
- b *= b;
- null == c.geom.ZPP_Simplify.stack && (c.geom.ZPP_Simplify.stack = new c.util.ZNPList_ZPP_SimplifyP);
- var f = null,
- l = null,
- h = a;
- do {
- var k = c.geom.ZPP_SimplifyV.get(h);
- k.forced = h.forced;
- k.forced && (k.flag = !0, null != f ? c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(f, k)) : l = k, f = k);
- d = function (a) {
- a = k;
- null == d ? d = a.prev = a.next = a : (a.prev = d, a.next = d.next, d.next.prev = a, d.next = a);
- return a
- }(this);
- 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));
- h = h.next
- } while (h != a);
- null == c.geom.ZPP_Simplify.stack.head ?
- 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)))) :
- c.geom.ZPP_Simplify.stack.add(c.geom.ZPP_SimplifyP.get(f, l));
- for (; null != c.geom.ZPP_Simplify.stack.head;) {
- l = c.geom.ZPP_Simplify.stack.pop_unsafe();
- g = l.min;
- e = l.max;
- l.min = l.max = null;
- l.next = c.geom.ZPP_SimplifyP.zpp_pool;
- c.geom.ZPP_SimplifyP.zpp_pool = l;
- l = b;
- f = null;
- for (h = g.next; h != e;) {
- var p = c.geom.ZPP_Simplify.distance(h, g, e);
- p > l && (l = p, f = h);
- h = h.next
- }
- 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)))
- }
- for (var n = null; null !=
- d;) d.flag && (n = function (a) {
- a = c.geom.ZPP_GeomVert.get(d.x, d.y);
- null == n ? n = a.prev = a.next = a : (a.prev = n, a.next = n.next, n.next.prev = a, n.next = a);
- return a
- }(this), n.forced = d.forced), d = null != d && d.prev == d ? function (a) {
- d.next = d.prev = null;
- a = d;
- a.next = c.geom.ZPP_SimplifyV.zpp_pool;
- c.geom.ZPP_SimplifyV.zpp_pool = a;
- return d = null
- }(this) : function (a) {
- a = d.next;
- d.prev.next = d.next;
- d.next.prev = d.prev;
- d.next = d.prev = null;
- var b = d;
- b.next = c.geom.ZPP_SimplifyV.zpp_pool;
- c.geom.ZPP_SimplifyV.zpp_pool = b;
- d = null;
- return a
- }(this);
- return n
- };
- c.geom.ZPP_ToiEvent = function () {
- this.slipped = this.failed = this.kinematic = !1;
- this.c1 = this.c2 = this.axis = null;
- this.frozen1 = this.frozen2 = !1;
- this.s1 = this.s2 = this.arbiter = null;
- this.toi = 0;
- this.next = null;
- this.c1 = new c.geom.ZPP_Vec2;
- this.c2 = new c.geom.ZPP_Vec2;
- this.axis = new c.geom.ZPP_Vec2
- };
- s["zpp_nape.geom.ZPP_ToiEvent"] = c.geom.ZPP_ToiEvent;
- c.geom.ZPP_ToiEvent.__name__ = ["zpp_nape", "geom", "ZPP_ToiEvent"];
- c.geom.ZPP_ToiEvent.prototype = {
- free: function () {},
- alloc: function () {
- this.failed = !1;
- this.arbiter = this.s1 = this.s2 =
- null
- },
- __class__: c.geom.ZPP_ToiEvent
- };
- c.geom.ZPP_SweepDistance = function () {};
- s["zpp_nape.geom.ZPP_SweepDistance"] = c.geom.ZPP_SweepDistance;
- c.geom.ZPP_SweepDistance.__name__ = ["zpp_nape", "geom", "ZPP_SweepDistance"];
- c.geom.ZPP_SweepDistance.dynamicSweep = function (a, b, d, g, e) {
- null == e && (e = !1);
- var f = a.s1,
- l = a.s2,
- m = f.body,
- k = l.body,
- p = 0,
- n = 0,
- p = k.velx - m.velx,
- n = k.vely - m.vely,
- r = m.angvel;
- 0 > r && (r = -r);
- var q = k.angvel;
- 0 > q && (q = -q);
- var w = f.sweepCoef * r + l.sweepCoef * q;
- if (!e && !a.kinematic && p * p + n * n < h.Config.dynamicSweepLinearThreshold *
- h.Config.dynamicSweepLinearThreshold && w < h.Config.dynamicSweepAngularThreshold) a.toi = -1, a.failed = !0;
- else {
- for (var r = a.c1, q = a.c2, t = a.axis, s = 0;;) {
- m.sweepIntegrate(d * b);
- m.sweepValidate(f);
- k.sweepIntegrate(d * b);
- k.sweepValidate(l);
- var y = c.geom.ZPP_SweepDistance.distance(f, l, r, q, t, null) + g,
- A = p * t.x + n * t.y;
- if (y < h.Config.distanceThresholdCCD) {
- if (e) break;
- var z = 0,
- x = 0,
- z = r.x - m.posx,
- x = r.y - m.posy,
- B = 0,
- v = 0,
- B = q.x - k.posx,
- v = q.y - k.posy,
- z = A - m.sweep_angvel * (t.y * z - t.x * x) + k.sweep_angvel * (t.y * B - t.x * v);
- 0 < z && (a.slipped = !0);
- if (0 >=
- z || y < 0.5 * h.Config.distanceThresholdCCD) break
- }
- z = (w - A) * b;
- if (0 >= z) {
- d = -1;
- break
- }
- z = y / z;
- 1E-6 > z && (z = 1E-6);
- d += z;
- if (1 <= d) {
- d = 1;
- m.sweepIntegrate(d * b);
- m.sweepValidate(f);
- k.sweepIntegrate(d * b);
- k.sweepValidate(l);
- b = c.geom.ZPP_SweepDistance.distance(f, l, r, q, t, null) + g;
- p = p * t.x + n * t.y;
- if (b < h.Config.distanceThresholdCCD) {
- if (e) break;
- z = r.x - m.posx;
- x = r.y - m.posy;
- B = q.x - k.posx;
- v = q.y - k.posy;
- z = p - m.sweep_angvel * (t.y * z - t.x * x) + k.sweep_angvel * (t.y * B - t.x * v);
- 0 < z && (a.slipped = !0);
- if (0 >= z || b < 0.5 * h.Config.distanceThresholdCCD) break
- }
- d = -1;
- break
- }
- if (40 <= ++s) {
- y > g && (a.failed = !0);
- break
- }
- }
- a.toi = d
- }
- };
- c.geom.ZPP_SweepDistance.staticSweep = function (a, b, d, g) {
- var e = a.s1,
- f = a.s2,
- l = e.body,
- m = 0,
- k = 0,
- m = -l.velx,
- k = -l.vely,
- p = l.sweep_angvel;
- 0 > p && (p = -p);
- for (var n = e.sweepCoef * p, p = a.c1, r = a.c2, q = a.axis, w = 0;;) {
- l.sweepIntegrate(d * b);
- l.sweepValidate(e);
- var t = c.geom.ZPP_SweepDistance.distance(e, f, p, r, q, null) + g,
- s = m * q.x + k * q.y;
- if (t < h.Config.distanceThresholdCCD) {
- var y = 0,
- A = 0,
- y = p.x - l.posx,
- A = p.y - l.posy,
- y = s - l.sweep_angvel * (q.y * y - q.x * A);
- 0 < y && (a.slipped = !0);
- if (0 >= y || t < 0.5 *
- h.Config.distanceThresholdCCD) break
- }
- y = (n - s) * b;
- if (0 >= y) {
- d = -1;
- break
- }
- y = t / y;
- 1E-6 > y && (y = 1E-6);
- d += y;
- if (1 <= d) {
- d = 1;
- l.sweepIntegrate(d * b);
- l.sweepValidate(e);
- b = c.geom.ZPP_SweepDistance.distance(e, f, p, r, q, null) + g;
- m = m * q.x + k * q.y;
- 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;
- d = -1;
- break
- }
- if (40 <= ++w) {
- t > g && (a.failed = !0);
- break
- }
- }
- a.toi = d
- };
- c.geom.ZPP_SweepDistance.distanceBody = function (a, b, d, g) {
- var e;
- 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);
- e.weak = !1;
- var f;
- 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);
- f.weak = !1;
- var l;
- 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);
- l.weak = !1;
- var h = 1E100;
- for (a = a.shapes.head; null != a;) {
- for (var k = a.elt, p = b.shapes.head; null != p;) {
- var n =
- c.geom.ZPP_SweepDistance.distance(k, p.elt, e, f, l, h);
- n < h && (h = n, d.x = e.x, d.y = e.y, g.x = f.x, g.y = f.y);
- p = p.next
- }
- a = a.next
- }
- b = e;
- null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
- b._isimmutable = null;
- b._validate = null;
- b._invalidate = null;
- b.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = b;
- b = f;
- null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
- b._isimmutable = null;
- b._validate = null;
- b._invalidate = null;
- b.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = b;
- b = l;
- null != b.outer && (b.outer.zpp_inner = null, b.outer =
- null);
- b._isimmutable = null;
- b._validate = null;
- b._invalidate = null;
- b.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = b;
- return h
- };
- c.geom.ZPP_SweepDistance.distance = function (a, b, d, g, e, f) {
- null == f && (f = 1E100);
- if (a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE && b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
- var l = a.circle;
- a = b.circle;
- var m, k = 0,
- p = 0,
- k = a.worldCOMx - l.worldCOMx,
- p = a.worldCOMy - l.worldCOMy,
- n = Math.sqrt(k * k + p * p);
- m = n - (l.radius + a.radius);
- m < f && (0 == n ? (k = 1, p = 0) : (f = 1 / n, k *= f, p *= f), f = l.radius, d.x = l.worldCOMx +
- 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);
- return m
- }
- l = !1;
- 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);
- if (a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && b.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
- var r = b.circle;
- b = -1E100;
- p = null;
- for (a = a.polygon.edges.head; null != a;) {
- k = a.elt;
- m = k.gnormx * r.worldCOMx + k.gnormy * r.worldCOMy - k.gprojection - r.radius;
- if (m > f) {
- b = m;
- break
- }
- 0 < m ? m > b && (b = m, p = k) :
- 0 > b && m > b && (b = m, p = k);
- a = a.next
- }
- 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,
- 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));
- l && (e.x = -e.x, e.y = -e.y);
- return b
- }
- m = a.polygon;
- var q = b.polygon;
- b = -1E100;
- var n = p = null,
- w = 0;
- for (a = m.edges.head; null != a;) {
- for (var k = a.elt, r = 1E100, t = q.gverts.next; null != t;) {
- var s = t,
- s = k.gnormx * s.x + k.gnormy * s.y;
- s < r && (r = s);
- t = t.next
- }
- r -= k.gprojection;
- if (r > f) {
- b = r;
- break
- }
- 0 < r ? r > b && (b = r, p = k, w = 1) : 0 > b && r > b && (b = r, p = k, w = 1);
- a = a.next
- }
- if (b <
- f) {
- for (a = q.edges.head; null != a;) {
- k = a.elt;
- r = 1E100;
- 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;
- r -= k.gprojection;
- if (r > f) {
- b = r;
- break
- }
- 0 < r ? r > b && (b = r, n = k, w = 2) : 0 > b && r > b && (b = r, n = k, w = 2);
- a = a.next
- }
- if (b < f) {
- 1 == w ? (a = q, m = p) : (a = m, m = n, k = d, d = g, g = k, l = !l);
- f = null;
- r = 1E100;
- 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;
- l ? (e.x = -m.gnormx, e.y = -m.gnormy) : (e.x = m.gnormx, e.y = m.gnormy);
- if (0 <= b) {
- a = m.gp0;
- m = m.gp1;
- var k = f.gp0,
- r = f.gp1,
- y = t = w = 0,
- A = 0,
- w =
- m.x - a.x,
- t = m.y - a.y,
- y = r.x - k.x,
- A = r.y - k.y;
- b = 1 / (w * w + t * t);
- p = 1 / (y * y + A * A);
- f = -(w * (a.x - k.x) + t * (a.y - k.y)) * b;
- b *= -(w * (a.x - r.x) + t * (a.y - r.y));
- var z = -(y * (k.x - a.x) + A * (k.y - a.y)) * p,
- x = -(y * (k.x - m.x) + A * (k.y - m.y)) * p;
- 0 > f ? f = 0 : 1 < f && (f = 1);
- 0 > b ? b = 0 : 1 < b && (b = 1);
- 0 > z ? z = 0 : 1 < z && (z = 1);
- 0 > x ? x = 0 : 1 < x && (x = 1);
- n = p = 0;
- p = a.x + w * f;
- n = a.y + t * f;
- q = s = 0;
- f = b;
- s = a.x + w * f;
- q = a.y + t * f;
- t = w = 0;
- f = z;
- w = k.x + y * f;
- t = k.y + A * f;
- f = z = 0;
- f = x;
- z = k.x + y * f;
- f = k.y + A * f;
- b = c.geom.ZPP_VecMath.vec_dsq(p, n, k.x, k.y);
- var B = c.geom.ZPP_VecMath.vec_dsq(s, q, r.x, r.y),
- y = c.geom.ZPP_VecMath.vec_dsq(w,
- t, a.x, a.y),
- A = c.geom.ZPP_VecMath.vec_dsq(z, f, m.x, m.y),
- v = x = 0,
- H = null;
- b < B ? (x = p, v = n, H = k) : (x = s, v = q, H = r, b = B);
- r = k = 0;
- p = null;
- y < A ? (k = w, r = t, p = a) : (k = z, r = f, p = m, y = A);
- 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));
- 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));
- return b
- }
- l = e = 0;
- e = f.gp0.x;
- l = f.gp0.y;
- k = a = 0;
- a = f.gp1.x;
- k = f.gp1.y;
- p = r = 0;
- r = a - e;
- p = k - l;
- f = m.gnormy * e - m.gnormx * l;
- b = m.gnormy * a - m.gnormx * k;
- n = 1 / (b - f);
- f = (-m.tp1 - f) * n;
- f > h.Config.epsilon && (e += r * f, l +=
- p * f);
- f = (-m.tp0 - b) * n;
- f < -h.Config.epsilon && (b = f, a += r * b, k += p * b);
- f = e * m.gnormx + l * m.gnormy - m.gprojection;
- r = a * m.gnormx + k * m.gnormy - m.gprojection;
- 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;
- g.x = a;
- g.y = k;
- b = -r;
- d.x = g.x + m.gnormx * b;
- d.y = g.y + m.gnormy * b;
- return r
- }
- }
- return f
- };
- c.geom.ZPP_PartitionPair = function () {
- this.node = null;
- this.id = this.di = 0;
- this.a = this.b = null;
- this.length = 0;
- this._inuse = this.modified = this.pushmod = !1;
- this.next = null
- };
- s["zpp_nape.geom.ZPP_PartitionPair"] = c.geom.ZPP_PartitionPair;
- c.geom.ZPP_PartitionPair.__name__ = ["zpp_nape", "geom", "ZPP_PartitionPair"];
- c.geom.ZPP_PartitionPair.get = function (a, b) {
- var d;
- 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);
- null;
- d.a = a;
- d.b = b;
- a.id < b.id ? (d.id = a.id, d.di = b.id) : (d.id = b.id, d.di = a.id);
- return d
- };
- c.geom.ZPP_PartitionPair.edge_swap = function (a, b) {
- var d = a.node;
- a.node = b.node;
- b.node = d
- };
- c.geom.ZPP_PartitionPair.edge_lt = function (a, b) {
- return a.id <
- b.id || a.id == b.id && a.di < b.di
- };
- c.geom.ZPP_PartitionPair.prototype = {
- alloc: function () {},
- free: function () {
- this.node = this.a = this.b = null
- },
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a : null
- },
- iterator_at: function (a) {
- for (var b = this.next; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.next, b = a; null != b;) a = b, b = b.next;
- return a
- },
- front: function () {
- return this.next
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.next; null != d;) {
- if (d == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.next
- },
- reverse: function () {
- for (var a = this.next, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.next = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {},
- clear: function () {},
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- b._inuse = !1;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a =
- this.next;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.next;
- this.next = a.next;
- a._inuse = !1;
- null == this.next && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- b._inuse = !0;
- null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
- this.pushmod = this.modified = !0;
- this.length++;
- return b
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.next; null !=
- a;) this.add(a), a = a.next
- },
- inlined_add: function (a) {
- a._inuse = !0;
- a.next = this.next;
- this.next = a;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.next = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.next
- },
- elem: function () {
- return this
- },
- __class__: c.geom.ZPP_PartitionPair
- };
- c.geom.ZPP_Triangular = function () {};
- s["zpp_nape.geom.ZPP_Triangular"] = c.geom.ZPP_Triangular;
- c.geom.ZPP_Triangular.__name__ = ["zpp_nape", "geom", "ZPP_Triangular"];
- c.geom.ZPP_Triangular.lt =
- function (a, b) {
- return a.y < b.y || a.y == b.y && a.x < b.x
- };
- c.geom.ZPP_Triangular.right_turn = function (a, b, d) {
- var c = 0,
- e = 0,
- c = d.x - b.x,
- e = d.y - b.y,
- f = d = 0;
- d = b.x - a.x;
- f = b.y - a.y;
- return f * c - d * e
- };
- c.geom.ZPP_Triangular.delaunay = function (a, b, d, c) {
- var e = 0,
- f = 0,
- l = 0,
- h = 0,
- e = d.x - b.x,
- f = d.y - b.y,
- l = b.x - a.x,
- h = b.y - a.y;
- (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)));
- return e ? !0 : 0 < b.x * (d.y * c.mag - d.mag *
- 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))
- };
- c.geom.ZPP_Triangular.optimise = function (a) {
- var b = a.vertices,
- d = a.vertices;
- if (null != b) {
- var g = b;
- do b = g, b.sort(), b.mag = b.x * b.x + b.y * b.y, g = g.next; while (g != d)
- }
- null == c.geom.ZPP_Triangular.edgeSet && (null == c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool ?
- 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);
- var e;
- null == c.geom.ZPP_PartitionPair.zpp_pool ? e = new c.geom.ZPP_PartitionPair : (e = c.geom.ZPP_PartitionPair.zpp_pool,
- c.geom.ZPP_PartitionPair.zpp_pool = e.next, e.next = null);
- null;
- d = b = a.vertices;
- if (null != b) {
- g = b;
- do {
- var b = g,
- f = b.next;
- b.diagonals.reverse();
- for (a = b.diagonals.head; null != a;) {
- var l = a.elt;
- 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));
- f = l;
- a = a.next
- }
- g = g.next
- } while (g != d)
- }
- for (; null != e.next;) {
- var f = e.pop_unsafe(),
- d = f.a,
- g = f.b,
- l = d.next,
- h = null;
- for (a = d.diagonals.head; null != a;) {
- b = a.elt;
- if (b ==
- g) {
- a = a.next;
- h = null == a ? d.prev : a.elt;
- break
- }
- l = b;
- a = a.next
- }
- d.diagonals.remove(g);
- g.diagonals.remove(d);
- if (g == l.next) l.diagonals.add(h);
- else
- for (a = l.diagonals.head; null != a;) {
- b = a.elt;
- if (b == g) {
- l.diagonals.insert(a, h);
- break
- }
- a = a.next
- }
- if (d == h.next) h.diagonals.add(l);
- else
- for (a = h.diagonals.head; null != a;) {
- b = a.elt;
- if (b == d) {
- h.diagonals.insert(a, l);
- break
- }
- a = a.next
- }
- c.geom.ZPP_Triangular.edgeSet.remove_node(f.node);
- b = f;
- b.a = b.b = null;
- b.node = null;
- b.next = c.geom.ZPP_PartitionPair.zpp_pool;
- c.geom.ZPP_PartitionPair.zpp_pool =
- b
- }
- b = e;
- b.a = b.b = null;
- b.node = null;
- b.next = c.geom.ZPP_PartitionPair.zpp_pool;
- c.geom.ZPP_PartitionPair.zpp_pool = b
- };
- c.geom.ZPP_Triangular.triangulate = function (a) {
- var b = a.vertices,
- d = a.vertices,
- g = a.vertices.next,
- e = a.vertices;
- if (null != g) {
- var f = g;
- do {
- g = f;
- if (g.y < b.y || g.y == b.y && g.x < b.x) b = g;
- if (d.y < g.y || d.y == g.y && d.x < g.x) d = g;
- f = f.next
- } while (f != e)
- }
- null == c.geom.ZPP_Triangular.queue && (c.geom.ZPP_Triangular.queue = new c.util.ZNPList_ZPP_PartitionVertex);
- g = d.prev;
- e = d.next;
- for (c.geom.ZPP_Triangular.queue.add(d); g != b || e !=
- 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);
- c.geom.ZPP_Triangular.queue.add(b);
- null == c.geom.ZPP_Triangular.stack && (c.geom.ZPP_Triangular.stack = new c.util.ZNPList_ZPP_PartitionVertex);
- c.geom.ZPP_Triangular.stack.add(c.geom.ZPP_Triangular.queue.pop_unsafe());
- e = c.geom.ZPP_Triangular.queue.pop_unsafe();
- for (c.geom.ZPP_Triangular.stack.add(e);;) {
- g = c.geom.ZPP_Triangular.queue.pop_unsafe();
- if (null == c.geom.ZPP_Triangular.queue.head) break;
- if (g.rightchain != c.geom.ZPP_Triangular.stack.head.elt.rightchain)
- for (;;) {
- b = c.geom.ZPP_Triangular.stack.pop_unsafe();
- if (null == c.geom.ZPP_Triangular.stack.head) break;
- a.add_diagonal(b, g)
- } else
- for (e = c.geom.ZPP_Triangular.stack.pop_unsafe(); null != c.geom.ZPP_Triangular.stack.head;) {
- b = c.geom.ZPP_Triangular.stack.head.elt;
- f = c.geom.ZPP_Triangular.right_turn(b, e, g);
- if (g.rightchain && 0 <= f || !g.rightchain && 0 >= f) break;
- a.add_diagonal(b, g);
- e = b;
- c.geom.ZPP_Triangular.stack.pop()
- }
- c.geom.ZPP_Triangular.stack.add(e);
- c.geom.ZPP_Triangular.stack.add(g);
- e = g
- }
- if (null != c.geom.ZPP_Triangular.stack.head)
- for (c.geom.ZPP_Triangular.stack.pop(); null != c.geom.ZPP_Triangular.stack.head;) {
- b = c.geom.ZPP_Triangular.stack.pop_unsafe();
- if (null == c.geom.ZPP_Triangular.stack.head) break;
- a.add_diagonal(d, b)
- }
- return a
- };
- c.geom.ZPP_Vec2 = function () {
- this.length = this.x = this.y = 0;
- this._inuse = this.modified = this.pushmod = !1;
- this.next = null;
- this.weak = !1;
- this._isimmutable = this.outer = null;
- this._immutable = !1;
- this._invalidate = this._validate = null
- };
- s["zpp_nape.geom.ZPP_Vec2"] =
- c.geom.ZPP_Vec2;
- c.geom.ZPP_Vec2.__name__ = ["zpp_nape", "geom", "ZPP_Vec2"];
- c.geom.ZPP_Vec2.get = function (a, b, d) {
- null == d && (d = !1);
- var g;
- 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);
- g.weak = !1;
- g._immutable = d;
- g.x = a;
- g.y = b;
- return g
- };
- c.geom.ZPP_Vec2.prototype = {
- toString: function () {
- return "{ x: " + this.x + " y: " + this.y + " }"
- },
- copy: function () {
- return c.geom.ZPP_Vec2.get(this.x, this.y, null)
- },
- at: function (a) {
- a = this.iterator_at(a);
- return null !=
- a ? a : null
- },
- iterator_at: function (a) {
- for (var b = this.next; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.next, b = a; null != b;) a = b, b = b.next;
- return a
- },
- front: function () {
- return this.next
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.next; null != d;) {
- if (d == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.next
- },
- reverse: function () {
- for (var a = this.next, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b =
- this.next = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {},
- clear: function () {},
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- b._inuse = !1;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.next,
- c = !1; null != d;) {
- if (d == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.next;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.next;
- this.next = a.next;
- a._inuse = !1;
- null ==
- this.next && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- b._inuse = !0;
- null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
- this.pushmod = this.modified = !0;
- this.length++;
- return b
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.next; null != a;) this.add(a), a = a.next
- },
- inlined_add: function (a) {
- a._inuse = !0;
- a.next = this.next;
- this.next = a;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.next = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.next
- },
- elem: function () {
- return this
- },
- alloc: function () {
- this.weak = !1
- },
- free: function () {
- null != this.outer && (this.outer = this.outer.zpp_inner = null);
- this._invalidate = this._validate = this._isimmutable = null
- },
- wrapper: function () {
- if (null == this.outer) {
- this.outer = new h.geom.Vec2;
- var a = this.outer.zpp_inner;
- null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
- a._isimmutable = null;
- a._validate = null;
- a._invalidate = null;
- a.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = a;
- this.outer.zpp_inner = this
- }
- return this.outer
- },
- immutable: function () {
- if (this._immutable) throw "Error: Vec2 is immutable";
- null != this._isimmutable && this._isimmutable()
- },
- invalidate: function () {
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- null != this._validate && this._validate()
- },
- __class__: c.geom.ZPP_Vec2
- };
- c.geom.ZPP_Vec3 = function () {
- this._validate = null;
- this.immutable = !1;
- this.x = this.y = this.z = 0;
- this.outer = null;
- this.immutable = !1;
- this._validate = null
- };
- s["zpp_nape.geom.ZPP_Vec3"] =
- c.geom.ZPP_Vec3;
- c.geom.ZPP_Vec3.__name__ = ["zpp_nape", "geom", "ZPP_Vec3"];
- c.geom.ZPP_Vec3.prototype = {
- validate: function () {
- null != this._validate && this._validate()
- },
- __class__: c.geom.ZPP_Vec3
- };
- c.geom.ZPP_VecMath = function () {};
- s["zpp_nape.geom.ZPP_VecMath"] = c.geom.ZPP_VecMath;
- c.geom.ZPP_VecMath.__name__ = ["zpp_nape", "geom", "ZPP_VecMath"];
- c.geom.ZPP_VecMath.vec_dsq = function (a, b, d, c) {
- var e = 0,
- f = 0,
- e = a - d,
- f = b - c;
- return e * e + f * f
- };
- c.geom.ZPP_VecMath.vec_distance = function (a, b, d, c) {
- var e = 0,
- f = 0,
- e = a - d,
- f = b - c;
- return Math.sqrt(e *
- e + f * f)
- };
- c.phys = {};
- c.phys.ZPP_Interactor = function () {
- this.userData = this.ishape = this.ibody = this.icompound = this.cbsets = this.group = this.cbTypes = this.cbSet = this.wrap_cbTypes = null;
- this.id = 0;
- this.outer_i = null;
- this.id = c.ZPP_ID.Interactor();
- this.cbsets = new c.util.ZNPList_ZPP_CallbackSet;
- this.cbTypes = new c.util.ZNPList_ZPP_CbType
- };
- s["zpp_nape.phys.ZPP_Interactor"] = c.phys.ZPP_Interactor;
- c.phys.ZPP_Interactor.__name__ = ["zpp_nape", "phys", "ZPP_Interactor"];
- c.phys.ZPP_Interactor.get = function (a, b) {
- for (var d = a.id <
- 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;) {
- var l = f.elt;
- if (l.id == d && l.di == c) {
- e = l;
- break
- }
- f = f.next
- }
- return e
- };
- c.phys.ZPP_Interactor.int_callback = function (a, b, d) {
- var c = a.int1;
- a = a.int2;
- b.options1.compatible(c.cbTypes) && b.options2.compatible(a.cbTypes) ? (d.int1 = c, d.int2 = a) : (d.int1 = a, d.int2 = c)
- };
- c.phys.ZPP_Interactor.prototype = {
- copyto: function (a) {
- a.zpp_inner_i.group = this.group;
- for (var b = this.outer_i.get_cbTypes().iterator(); b.hasNext();) {
- var d =
- b.next(),
- c = void 0;
- null == a.zpp_inner_i.wrap_cbTypes && a.zpp_inner_i.setupcbTypes();
- c = a.zpp_inner_i.wrap_cbTypes;
- c.add(d)
- }
- null != this.userData && (a.zpp_inner_i.userData = W.copy(this.userData))
- },
- lookup_group: function () {
- 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;
- return null == a ? null : a.group
- },
- immutable_midstep: function (a) {
- null != this.ibody ? this.ibody.__immutable_midstep(a) : null != this.ishape ? this.ishape.__immutable_midstep(a) :
- this.icompound.__imutable_midstep(a)
- },
- setGroup: function (a) {
- if (this.group != a) {
- var b = null != (null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space);
- b && null != this.group && this.group.interactors.remove(this);
- this.group = a;
- b && null != a && a.interactors.add(this);
- b && (null != this.ishape ? this.ishape.body.wake() : null != this.ibody ? this.ibody.wake() : this.icompound.wake())
- }
- },
- dealloc_cbSet: function () {
- var a = null != this.ishape ? null == this.ishape.body ? null :
- this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
- 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)
- },
- alloc_cbSet: function () {
- var a = null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
- null != (this.cbSet = a.cbsets.get(this.cbTypes)) &&
- (this.cbSet.count++, this.cbSet.interactors.add(this), this.cbSet.validate(), a.freshInteractorType(this))
- },
- insert_cbtype: function (a) {
- if (!this.cbTypes.has(a)) {
- var b = null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
- null != b && (this.dealloc_cbSet(), a.interactors.add(this));
- for (var d = null, c = this.cbTypes.head; null != c && !(a.id < c.elt.id);) d = c, c = c.next;
- this.cbTypes.inlined_insert(d, a);
- null != b && (this.alloc_cbSet(), this.wake())
- }
- },
- wrap_cbTypes_adder: function (a) {
- this.insert_cbtype(a.zpp_inner);
- return !1
- },
- wrap_cbTypes_subber: function (a) {
- a = a.zpp_inner;
- if (this.cbTypes.has(a)) {
- var b = null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space;
- null != b && (this.dealloc_cbSet(), a.interactors.remove(this));
- this.cbTypes.remove(a);
- null != b && (this.alloc_cbSet(), this.wake())
- }
- },
- immutable_cbTypes: function () {
- this.immutable_midstep("Interactor::cbTypes")
- },
- setupcbTypes: function () {
- this.wrap_cbTypes = c.util.ZPP_CbTypeList.get(this.cbTypes);
- this.wrap_cbTypes.zpp_inner.adder =
- A(this, this.wrap_cbTypes_adder);
- this.wrap_cbTypes.zpp_inner.subber = A(this, this.wrap_cbTypes_subber);
- this.wrap_cbTypes.zpp_inner.dontremove = !0;
- this.wrap_cbTypes.zpp_inner._modifiable = A(this, this.immutable_cbTypes)
- },
- getSpace: function () {
- return null != this.ishape ? null == this.ishape.body ? null : this.ishape.body.space : null != this.ibody ? this.ibody.space : this.icompound.space
- },
- wake: function () {
- if (null != this.ishape) {
- var a = this.ishape.body;
- null != a && null != a.space && a.space.non_inlined_wake(a);
- !0
- } else null != this.ibody ?
- null != this.ibody.space ? this.ibody.space.non_inlined_wake(this.ibody) : !1 : (null != this.icompound.space && this.icompound.space.wakeCompound(this.icompound), !0)
- },
- __iremovedFromSpace: function () {
- null != this.group && this.group.interactors.remove(this);
- for (var a = this.cbTypes.head; null != a;) a.elt.interactors.remove(this), a = a.next;
- this.dealloc_cbSet()
- },
- __iaddedToSpace: function () {
- null != this.group && this.group.interactors.add(this);
- for (var a = this.cbTypes.head; null != a;) a.elt.interactors.add(this), a = a.next;
- this.alloc_cbSet()
- },
- isCompound: function () {
- return null != this.icompound
- },
- isBody: function () {
- return null != this.ibody
- },
- isShape: function () {
- return null != this.ishape
- },
- __class__: c.phys.ZPP_Interactor
- };
- c.phys.ZPP_Body = function () {
- this.wrap_localCOM = this.wrap_worldCOM = null;
- this.zip_worldCOM = !1;
- this.worldCOMx = this.worldCOMy = 0;
- this.zip_localCOM = !1;
- this.localCOMx = this.localCOMy = 0;
- this.zip_aabb = !1;
- this.aabb = null;
- this.norotate = !1;
- this.cinertia = this.iinertia = this.sinertia = 0;
- this.zip_inertia = !1;
- this.inertiaMode = this.inertia = 0;
- this.zip_gravMassScale = !1;
- this.gravMassMode = this.gravMassScale = 0;
- this.zip_gravMass = !1;
- this.gravMass = 0;
- this.nomove = !1;
- this.massMode = this.imass = this.smass = this.cmass = 0;
- this.zip_mass = !1;
- this.mass = 0;
- this.zip_axis = !1;
- this.angvel = this.torque = this.kinangvel = this.pre_rot = this.rot = this.axisx = this.axisy = 0;
- this.wrap_svel = this.wrapcvel = null;
- this.svelx = this.svely = 0;
- this.wrap_kinvel = null;
- this.kinvelx = this.kinvely = 0;
- this.wrap_force = null;
- this.forcex = this.forcey = 0;
- this.wrap_vel = null;
- this.velx = this.vely = 0;
- this.wrap_pos = null;
- this.pre_posx =
- this.pre_posy = this.posx = this.posy = 0;
- this.bullet = this.bulletEnabled = this.disableCCD = !1;
- this.sweepRadius = 0;
- this.sweepFrozen = !1;
- this.graph_depth = this.sweepTime = this.sweep_angvel = 0;
- this.compound = this.shapes = this.wrap_shapes = this.space = this.arbiters = this.wrap_arbiters = this.constraints = this.wrap_constraints = this.component = null;
- this.type = 0;
- this.world = !1;
- this.outer = null;
- c.phys.ZPP_Interactor.call(this);
- this.ibody = this;
- this.bulletEnabled = this.world = !1;
- this.sweep_angvel = this.sweepTime = 0;
- this.disableCCD = this.norotate =
- this.nomove = !1;
- this.axisx = this.rot = this.posy = this.posx = 0;
- this.axisy = 1;
- this.torque = this.angvel = this.kinangvel = this.forcey = this.forcex = this.kinvely = this.kinvelx = this.vely = this.velx = this.svely = this.svelx = 0;
- this.pre_rot = this.pre_posy = this.pre_posx = Math.POSITIVE_INFINITY;
- this.worldCOMy = this.worldCOMx = this.localCOMy = this.localCOMx = 0;
- this.zip_aabb = !0;
- this.aabb = c.geom.ZPP_AABB.get(0, 0, 0, 0);
- this.aabb._immutable = !0;
- this.aabb._validate = A(this, this.aabb_validate);
- this.massMode = c.util.ZPP_Flags.id_MassMode_DEFAULT;
- this.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_DEFAULT;
- this.gravMassScale = 1;
- this.inertiaMode = c.util.ZPP_Flags.id_InertiaMode_DEFAULT;
- this.arbiters = new c.util.ZNPList_ZPP_Arbiter;
- this.constraints = new c.util.ZNPList_ZPP_Constraint;
- this.shapes = new c.util.ZNPList_ZPP_Shape;
- this.wrap_shapes = c.util.ZPP_ShapeList.get(this.shapes);
- this.wrap_shapes.zpp_inner.adder = A(this, this.shapes_adder);
- this.wrap_shapes.zpp_inner.subber = A(this, this.shapes_subber);
- this.wrap_shapes.zpp_inner._invalidate = A(this, this.shapes_invalidate);
- this.wrap_shapes.zpp_inner._modifiable = A(this, this.shapes_modifiable);
- this.kinematicDelaySleep = !1
- };
- s["zpp_nape.phys.ZPP_Body"] = c.phys.ZPP_Body;
- c.phys.ZPP_Body.__name__ = ["zpp_nape", "phys", "ZPP_Body"];
- c.phys.ZPP_Body.bodysetlt = function (a, b) {
- return a.id < b.id
- };
- c.phys.ZPP_Body.__static = function () {
- var a = h.phys.Body;
- 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);
- var a = new a(c.util.ZPP_Flags.BodyType_STATIC),
- b = a.zpp_inner;
- b.world = !0;
- b.wrap_shapes.zpp_inner.immutable = !0;
- b.smass = b.imass = b.cmass = b.mass = b.gravMass = 0;
- b.sinertia = b.iinertia = b.cinertia = b.inertia = 0;
- b.cbTypes.clear();
- return a
- };
- c.phys.ZPP_Body.__super__ = c.phys.ZPP_Interactor;
- c.phys.ZPP_Body.prototype = I(c.phys.ZPP_Interactor.prototype, {
- copy: function () {
- var a = (new h.phys.Body).zpp_inner;
- a.type = this.type;
- a.bulletEnabled = this.bulletEnabled;
- a.disableCCD = this.disableCCD;
- for (var b = this.shapes.head; null != b;) a.outer.zpp_inner.wrap_shapes.add(b.elt.outer.copy()),
- b = b.next;
- a.posx = this.posx;
- a.posy = this.posy;
- a.velx = this.velx;
- a.vely = this.vely;
- a.forcex = this.forcex;
- a.forcey = this.forcey;
- a.rot = this.rot;
- a.angvel = this.angvel;
- a.torque = this.torque;
- a.kinvelx = this.kinvelx;
- a.kinvely = this.kinvely;
- a.kinangvel = this.kinangvel;
- a.svelx = this.svelx;
- a.svely = this.svely;
- this.zip_axis ? a.invalidate_rot() : (a.axisx = this.axisx, a.axisy = this.axisy);
- a.rot = this.rot;
- a.massMode = this.massMode;
- a.gravMassMode = this.gravMassMode;
- a.inertiaMode = this.inertiaMode;
- a.norotate = this.norotate;
- a.nomove = this.nomove;
- a.cmass = this.cmass;
- a.cinertia = this.cinertia;
- this.zip_mass ? a.invalidate_mass() : a.mass = this.mass;
- this.zip_gravMass ? a.invalidate_gravMass() : a.gravMass = this.gravMass;
- this.zip_gravMassScale ? a.invalidate_gravMassScale() : a.gravMassScale = this.gravMassScale;
- this.zip_inertia ? a.invalidate_inertia() : a.inertia = this.inertia;
- 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);
- this.zip_localCOM ? (a.zip_localCOM = !0, a.zip_worldCOM = !0) : (a.localCOMx = this.localCOMx, a.localCOMy = this.localCOMy);
- this.zip_worldCOM ? a.zip_worldCOM = !0 : (a.worldCOMx = this.worldCOMx, a.worldCOMy = this.worldCOMy);
- this.copyto(a.outer);
- return a.outer
- },
- removedFromSpace: function () {
- for (; null != this.arbiters.head;) {
- var a = this.arbiters.pop_unsafe();
- a.cleared = !0;
- a.b2 == this && a.b1.arbiters.inlined_try_remove(a);
- a.b1 == this && a.b2.arbiters.inlined_try_remove(a);
- null != a.pair && (a.pair.arb = null, a.pair = null);
- a.active = !1;
- this.space.f_arbiters.modified = !0
- }
- a = this.component;
- a.body =
- null;
- a.constraint = null;
- null;
- a.next = c.space.ZPP_Component.zpp_pool;
- c.space.ZPP_Component.zpp_pool = a;
- this.component = null;
- this.__iremovedFromSpace()
- },
- addedToSpace: function () {
- 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);
- null;
- this.component.isBody = !0;
- this.component.body = this;
- this.__iaddedToSpace()
- },
- shapes_modifiable: function () {
- this.immutable_midstep("Body::shapes");
- 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";
- },
- shapes_invalidate: function (a) {
- this.invalidate_shapes()
- },
- shapes_subber: function (a) {
- null != this.space && this.space.removed_shape(a.zpp_inner);
- a.zpp_inner.body = null;
- a.zpp_inner.removedFromBody()
- },
- shapes_adder: function (a) {
- 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(),
- 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
- },
- aabb_validate: function () {
- if (null == this.shapes.head) throw "Error: bounds only makes sense when Body has shapes";
- this.validate_aabb()
- },
- clear: function () {
- if (null != this.space) throw "Error: Cannot clear a Body if it is currently being used by a Space!";
- if (null != this.constraints.head) throw "Error: Cannot clear a Body if it is currently being used by a constraint!";
- for (; null != this.shapes.head;) {
- var a = this.shapes.pop_unsafe();
- a.removedFromBody();
- a.body = null
- }
- this.invalidate_shapes();
- 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;
- this.invalidate_pos();
- this.invalidate_rot();
- this.axisx = 0;
- this.axisy = 1;
- this.zip_axis = !1;
- this.massMode = c.util.ZPP_Flags.id_MassMode_DEFAULT;
- this.gravMassMode = c.util.ZPP_Flags.id_GravMassMode_DEFAULT;
- this.gravMassScale = 1;
- this.inertiaMode = c.util.ZPP_Flags.id_InertiaMode_DEFAULT;
- this.nomove = this.norotate = !1
- },
- __immutable_midstep: function (a) {
- if (null != this.space && this.space.midstep) throw "Error: " + a + " cannot be set during a space step()";
- },
- getworldCOM: function () {
- if (null == this.shapes.head) throw "Error: worldCOM only makes sense when Body has Shapes";
- this.validate_worldCOM()
- },
- getlocalCOM: function () {
- if (null == this.shapes.head) throw "Error: localCOM only makes sense when Body has Shapes";
- this.validate_localCOM()
- },
- validate_worldCOM: function () {
- 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))
- },
- validate_localCOM: function () {
- if (this.zip_localCOM) {
- this.zip_localCOM = !1;
- for (var a = 0, b = 0, d = 0, g = this.shapes.head; null != g;) {
- var e = g.elt;
- 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));
- e.validate_area_inertia();
- var f = e.area * e.material.density,
- a = a + e.localCOMx * f,
- b = b + e.localCOMy * f,
- d = d + e.area * e.material.density,
- g = g.next
- }
- 0 != d && (f = 1 / d, this.localCOMx = a * f, this.localCOMy = b * f);
- null != this.wrap_localCOM && (this.wrap_localCOM.zpp_inner.x =
- this.localCOMx, this.wrap_localCOM.zpp_inner.y = this.localCOMy);
- 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))
- }
- },
- invalidate_worldCOM: function () {
- this.zip_worldCOM = !0
- },
- invalidate_localCOM: function () {
- this.zip_worldCOM = this.zip_localCOM = !0
- },
- invalidate_aabb: function () {
- this.zip_aabb = !0
- },
- validate_aabb: function () {
- if (null ==
- this.shapes.head) throw "Error: Body bounds only makes sense if it contains shapes";
- if (this.zip_aabb) {
- this.zip_aabb = !1;
- this.aabb.minx = Math.POSITIVE_INFINITY;
- this.aabb.miny = Math.POSITIVE_INFINITY;
- this.aabb.maxx = Math.NEGATIVE_INFINITY;
- this.aabb.maxy = Math.NEGATIVE_INFINITY;
- for (var a = this.shapes.head; null != a;) {
- var b = a.elt;
- 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());
- this.aabb.combine(b.aabb);
- a = a.next
- }
- }
- },
- invalidate_wake: function () {
- this.wake()
- },
- validate_inertia: function () {
- if (this.zip_inertia) {
- this.zip_inertia = !1;
- if (this.inertiaMode == c.util.ZPP_Flags.id_InertiaMode_DEFAULT) {
- this.cinertia = 0;
- for (var a = this.shapes.head; null != a;) {
- var b = a.elt;
- b.refmaterial.density = b.material.density;
- b.validate_area_inertia();
- this.cinertia += b.inertia * b.area * b.material.density;
- a = a.next
- }
- }
- 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 =
- 1 / this.inertia)
- }
- },
- invalidate_inertia: function () {
- this.zip_inertia = !0;
- this.wake()
- },
- validate_gravMassScale: function () {
- 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))
- },
- invalidate_gravMassScale: function () {
- this.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_SCALED ? this.zip_gravMassScale = !0 : this.invalidate_gravMass()
- },
- validate_gravMass: function () {
- 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))
- },
- invalidate_gravMass: function () {
- this.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_FIXED && (this.zip_gravMass = !0);
- this.gravMassMode != c.util.ZPP_Flags.id_GravMassMode_SCALED &&
- (this.zip_gravMassScale = !0);
- this.wake()
- },
- validate_mass: function () {
- if (this.zip_mass) {
- this.zip_mass = !1;
- if (this.massMode == c.util.ZPP_Flags.id_MassMode_DEFAULT) {
- this.cmass = 0;
- for (var a = this.shapes.head; null != a;) {
- var b = a.elt;
- b.refmaterial.density = b.material.density;
- b.validate_area_inertia();
- this.cmass += b.area * b.material.density;
- a = a.next
- }
- }
- 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)
- }
- },
- invalidate_mass: function () {
- this.zip_mass = !0;
- this.invalidate_gravMass()
- },
- delta_rot: function (a) {
- this.rot += a;
- if (1E-4 < a * a) this.axisx = Math.sin(this.rot), this.axisy = Math.cos(this.rot), null;
- else {
- var b = a * a,
- d = 1 - 0.5 * b,
- b = 1 - b * b / 8,
- c = (d * this.axisx + a * this.axisy) * b;
- this.axisy = (d * this.axisy - a * this.axisx) * b;
- this.axisx = c
- }
- },
- quick_validate_axis: function () {
- this.axisx = Math.sin(this.rot);
- this.axisy = Math.cos(this.rot)
- },
- validate_axis: function () {
- this.zip_axis && (this.zip_axis = !1, this.axisx = Math.sin(this.rot), this.axisy = Math.cos(this.rot),
- null)
- },
- invalidate_rot: function () {
- this.zip_axis = !0;
- for (var a = this.shapes.head; null != a;) {
- var b = a.elt;
- b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && (b.polygon.invalidate_gverts(), b.polygon.invalidate_gaxi());
- b.invalidate_worldCOM();
- a = a.next
- }
- this.zip_worldCOM = !0
- },
- setup_cvel: function () {
- this.wrapcvel = h.geom.Vec3.get();
- this.wrapcvel.zpp_inner.immutable = !0;
- this.wrapcvel.zpp_inner._validate = A(this, this.cvel_validate)
- },
- cvel_validate: function () {
- this.wrapcvel.zpp_inner.x = this.velx + this.kinvelx;
- this.wrapcvel.zpp_inner.y =
- this.vely + this.kinvely;
- this.wrapcvel.zpp_inner.z = this.angvel + this.kinangvel
- },
- setupForce: function () {
- this.wrap_force = h.geom.Vec2.get(this.forcex, this.forcey, null);
- this.wrap_force.zpp_inner._inuse = !0;
- 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))
- },
- setupsvel: function () {
- this.wrap_svel = h.geom.Vec2.get(this.svelx, this.svely, null);
- this.wrap_svel.zpp_inner._inuse = !0;
- this.world ?
- 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))
- },
- setupkinvel: function () {
- this.wrap_kinvel = h.geom.Vec2.get(this.kinvelx, this.kinvely, null);
- this.wrap_kinvel.zpp_inner._inuse = !0;
- 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))
- },
- setupVelocity: function () {
- this.wrap_vel =
- h.geom.Vec2.get(this.velx, this.vely, null);
- this.wrap_vel.zpp_inner._inuse = !0;
- 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))
- },
- setupPosition: function () {
- this.wrap_pos = h.geom.Vec2.get(this.posx, this.posy, null);
- this.wrap_pos.zpp_inner._inuse = !0;
- 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 =
- A(this, this.pos_validate))
- },
- force_validate: function () {
- this.wrap_force.zpp_inner.x = this.forcex;
- this.wrap_force.zpp_inner.y = this.forcey
- },
- force_invalidate: function (a) {
- if (this.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) throw "Error: Non-dynamic body cannot have force applied.";
- this.forcex = a.x;
- this.forcey = a.y;
- this.wake()
- },
- svel_validate: function () {
- this.wrap_svel.zpp_inner.x = this.svelx;
- this.wrap_svel.zpp_inner.y = this.svely
- },
- svel_invalidate: function (a) {
- this.svelx = a.x;
- this.svely = a.y;
- this.wake()
- },
- kinvel_validate: function () {
- this.wrap_kinvel.zpp_inner.x =
- this.kinvelx;
- this.wrap_kinvel.zpp_inner.y = this.kinvely
- },
- kinvel_invalidate: function (a) {
- this.kinvelx = a.x;
- this.kinvely = a.y;
- this.wake()
- },
- vel_validate: function () {
- this.wrap_vel.zpp_inner.x = this.velx;
- this.wrap_vel.zpp_inner.y = this.vely
- },
- vel_invalidate: function (a) {
- if (this.type == c.util.ZPP_Flags.id_BodyType_STATIC) throw "Error: Static body cannot have its velocity set.";
- this.velx = a.x;
- this.vely = a.y;
- this.wake()
- },
- pos_validate: function () {
- this.wrap_pos.zpp_inner.x = this.posx;
- this.wrap_pos.zpp_inner.y = this.posy
- },
- pos_invalidate: function (a) {
- this.immutable_midstep("Body::position");
- if (this.type == c.util.ZPP_Flags.id_BodyType_STATIC && null != this.space) throw "Error: Cannot move a static object once inside a Space";
- if (this.posx != a.x || this.posy != a.y) this.posx = a.x, this.posy = a.y, this.invalidate_pos(), this.wake()
- },
- invalidate_pos: function () {
- for (var a = this.shapes.head; null != a;) {
- var b = a.elt;
- b.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && (b.polygon.invalidate_gverts(), b.polygon.invalidate_gaxi());
- b.invalidate_worldCOM();
- a = a.next
- }
- this.zip_worldCOM = !0
- },
- sweepValidate: function (a) {
- 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);
- else {
- a = a.polygon;
- for (var b = a.lverts.next, d = a.gverts.next; null != d;) {
- var g = d,
- e = b,
- b = b.next;
- g.x = this.posx + (this.axisy * e.x - this.axisx * e.y);
- g.y = this.posy + (e.x * this.axisx + e.y * this.axisy);
- d = d.next
- }
- b = a.edges.head;
- g = d = a.gverts.next;
- for (d = d.next; null != d;) {
- var e = d,
- f = b.elt,
- b = b.next;
- f.gnormx = this.axisy * f.lnormx - this.axisx * f.lnormy;
- f.gnormy = f.lnormx * this.axisx + f.lnormy * this.axisy;
- f.gprojection = this.posx * f.gnormx + this.posy * f.gnormy + f.lprojection;
- f.tp0 = g.y * f.gnormx - g.x * f.gnormy;
- f.tp1 = e.y * f.gnormx - e.x * f.gnormy;
- g = e;
- d = d.next
- }
- e = a.gverts.next;
- f = b.elt;
- f.gnormx = this.axisy * f.lnormx - this.axisx * f.lnormy;
- f.gnormy = f.lnormx * this.axisx + f.lnormy * this.axisy;
- f.gprojection = this.posx * f.gnormx + this.posy * f.gnormy + f.lprojection;
- f.tp0 = g.y * f.gnormx - g.x * f.gnormy;
- f.tp1 = e.y * f.gnormx - e.x * f.gnormy
- }
- },
- sweepIntegrate: function (a) {
- var b = a - this.sweepTime;
- 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))
- },
- refreshArbiters: function () {
- for (var a = this.arbiters.head; null != a;) a.elt.invalidated = !0, a = a.next
- },
- atRest: function (a) {
- if (this.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC) return this.component.sleeping;
- var b = h.Config.linearSleepThreshold,
- b = b * b;
- if (this.velx * this.velx + this.vely * this.vely > b) a = 0;
- else if (c.geom.ZPP_VecMath.vec_dsq(this.posx,
- this.posy, this.pre_posx, this.pre_posy) > 0.25 * b * a * a) a = 0;
- else {
- var d = b = 0,
- b = this.aabb.maxx - this.aabb.minx,
- d = this.aabb.maxy - this.aabb.miny,
- b = b * b + d * d,
- d = h.Config.angularSleepThreshold,
- d = d * d;
- if (4 * this.angvel * this.angvel * b > d) a = !1;
- else {
- var g = this.rot - this.pre_rot;
- a = g * g * b > d * a * a ? !1 : !0
- }
- }
- a || (this.component.waket = this.space.stamp);
- return this.component.waket + h.Config.sleepDelay < this.space.stamp
- },
- interactingBodies: function (a, b, d) {
- var g = this;
- 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);
- null;
- var e = null == d ? new h.phys.BodyList : d;
- c.phys.ZPP_Body.bodyset.insert(this);
- c.phys.ZPP_Body.bodystack.add(this);
- for (this.graph_depth = 0; null != c.phys.ZPP_Body.bodystack.head;)
- if (d = c.phys.ZPP_Body.bodystack.pop_unsafe(), d.graph_depth != b)
- for (var f = d.arbiters.head; null != f;) {
- var l = f.elt;
- 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),
- l.graph_depth = d.graph_depth + 1));
- f = f.next
- }
- c.phys.ZPP_Body.bodyset.clear_with(function (a) {
- a != g && e.add(a.outer)
- });
- return e
- },
- connectedBodies: function (a, b) {
- var d = this;
- 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);
- null;
- var g = null == b ? new h.phys.BodyList : b;
- c.phys.ZPP_Body.bodystack.add(this);
- c.phys.ZPP_Body.bodyset.insert(this);
- for (this.graph_depth = 0; null != c.phys.ZPP_Body.bodystack.head;) {
- var e =
- c.phys.ZPP_Body.bodystack.pop_unsafe();
- if (e.graph_depth != a)
- 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
- }
- c.phys.ZPP_Body.bodyset.clear_with(function (a) {
- a != d && g.add(a.outer)
- });
- return g
- },
- connectedBodies_cont: function (a) {
- 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)
- },
- init_bodysetlist: function () {
- 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)
- },
- invalidate_shapes: function () {
- this.zip_worldCOM = this.zip_localCOM = this.zip_aabb = !0;
- this.invalidate_mass();
- this.invalidate_inertia()
- },
- invalidate_type: function () {
- this.invalidate_mass();
- this.invalidate_inertia()
- },
- isKinematic: function () {
- return this.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC
- },
- isDynamic: function () {
- return this.type ==
- c.util.ZPP_Flags.id_BodyType_DYNAMIC
- },
- isStatic: function () {
- return this.type == c.util.ZPP_Flags.id_BodyType_STATIC
- },
- __class__: c.phys.ZPP_Body
- });
- c.phys.ZPP_Compound = function () {
- this.compound = this.space = null;
- this.depth = 0;
- this.outer = this.bodies = this.constraints = this.compounds = this.wrap_bodies = this.wrap_constraints = this.wrap_compounds = null;
- c.phys.ZPP_Interactor.call(this);
- this.icompound = this;
- this.depth = 1;
- this.bodies = new c.util.ZNPList_ZPP_Body;
- this.wrap_bodies = c.util.ZPP_BodyList.get(this.bodies);
- this.wrap_bodies.zpp_inner.adder =
- A(this, this.bodies_adder);
- this.wrap_bodies.zpp_inner.subber = A(this, this.bodies_subber);
- this.wrap_bodies.zpp_inner._modifiable = A(this, this.bodies_modifiable);
- this.constraints = new c.util.ZNPList_ZPP_Constraint;
- this.wrap_constraints = c.util.ZPP_ConstraintList.get(this.constraints);
- this.wrap_constraints.zpp_inner.adder = A(this, this.constraints_adder);
- this.wrap_constraints.zpp_inner.subber = A(this, this.constraints_subber);
- this.wrap_constraints.zpp_inner._modifiable = A(this, this.constraints_modifiable);
- this.compounds =
- new c.util.ZNPList_ZPP_Compound;
- this.wrap_compounds = c.util.ZPP_CompoundList.get(this.compounds);
- this.wrap_compounds.zpp_inner.adder = A(this, this.compounds_adder);
- this.wrap_compounds.zpp_inner.subber = A(this, this.compounds_subber);
- this.wrap_compounds.zpp_inner._modifiable = A(this, this.compounds_modifiable)
- };
- s["zpp_nape.phys.ZPP_Compound"] = c.phys.ZPP_Compound;
- c.phys.ZPP_Compound.__name__ = ["zpp_nape", "phys", "ZPP_Compound"];
- c.phys.ZPP_Compound.__super__ = c.phys.ZPP_Interactor;
- c.phys.ZPP_Compound.prototype =
- I(c.phys.ZPP_Interactor.prototype, {
- copy: function (a, b) {
- var d = null == a;
- null == a && (a = []);
- null == b && (b = []);
- for (var g = new h.phys.Compound, e = this.compounds.head; null != e;) {
- var f = e.elt,
- f = f.copy(a, b);
- f.zpp_inner.immutable_midstep("Compound::compound");
- (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));
- null == f.zpp_inner.compound ? null : f.zpp_inner.compound.outer;
- e = e.next
- }
- for (e = this.bodies.head; null != e;) {
- var f = e.elt,
- l = f.outer.copy();
- a.push(c.constraint.ZPP_CopyHelper.dict(f.id, l));
- (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));
- null == l.zpp_inner.compound ? null : l.zpp_inner.compound.outer;
- e = e.next
- }
- 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;
- if (d)
- for (; 0 < b.length;)
- for (d = b.pop(), e = 0; e < a.length;)
- if (f = a[e], ++e, f.id == d.id) {
- d.cb(f.bc);
- break
- }
- this.copyto(g);
- return g
- },
- compounds_modifiable: function () {
- this.immutable_midstep("Compound::compounds")
- },
- compounds_subber: function (a) {
- a.zpp_inner.compound = null;
- a.zpp_inner.depth = 1;
- null != this.space && this.space.remCompound(a.zpp_inner)
- },
- compounds_adder: function (a) {
- for (var b = this; null != b && b != a.zpp_inner;) b = b.compound;
- if (b == a.zpp_inner) throw "Error: Assignment would cause a cycle in the Compound tree: assigning " + a.toString() + ".compound = " + this.outer.toString();
- return a.zpp_inner.compound != this ?
- (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
- },
- constraints_modifiable: function () {
- this.immutable_midstep("Compound::constraints")
- },
- constraints_subber: function (a) {
- a.zpp_inner.compound = null;
- null != this.space && this.space.remConstraint(a.zpp_inner)
- },
- constraints_adder: function (a) {
- return a.zpp_inner.compound !=
- 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
- },
- bodies_modifiable: function () {
- this.immutable_midstep("Compound::bodies")
- },
- bodies_subber: function (a) {
- a.zpp_inner.compound = null;
- null != this.space && this.space.remBody(a.zpp_inner)
- },
- bodies_adder: function (a) {
- return a.zpp_inner.compound != this ? (null != a.zpp_inner.compound ?
- 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
- },
- breakApart: function () {
- null != this.space && (this.__iremovedFromSpace(), this.space.nullInteractorType(this));
- for (null != this.compound ? this.compound.compounds.remove(this) : null != this.space && this.space.compounds.remove(this); null != this.bodies.head;) {
- var a = this.bodies.pop_unsafe();
- null != (a.compound = this.compound) ? this.compound.bodies.add(a) :
- null != this.space && this.space.bodies.add(a);
- null != this.space && this.space.freshInteractorType(a)
- }
- 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);
- 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);
- this.space =
- this.compound = null
- },
- removedFromSpace: function () {
- this.__iremovedFromSpace()
- },
- addedToSpace: function () {
- this.__iaddedToSpace()
- },
- __imutable_midstep: function (a) {
- if (null != this.space && this.space.midstep) throw "Error: " + a + " cannot be set during space step()";
- },
- __class__: c.phys.ZPP_Compound
- });
- c.phys.ZPP_FluidProperties = function () {
- this.wrap_gravity = null;
- this.viscosity = this.density = this.gravityx = this.gravityy = 0;
- this.next = this.userData = this.outer = this.shapes = this.wrap_shapes = null;
- this.shapes = new c.util.ZNPList_ZPP_Shape;
- this.density = this.viscosity = 1;
- this.wrap_gravity = null;
- this.gravityy = this.gravityx = 0
- };
- s["zpp_nape.phys.ZPP_FluidProperties"] = c.phys.ZPP_FluidProperties;
- c.phys.ZPP_FluidProperties.__name__ = ["zpp_nape", "phys", "ZPP_FluidProperties"];
- c.phys.ZPP_FluidProperties.prototype = {
- invalidate: function () {
- for (var a = this.shapes.head; null != a;) a.elt.invalidate_fluidprops(), a = a.next
- },
- getgravity: function () {
- this.wrap_gravity = h.geom.Vec2.get(this.gravityx, this.gravityy, null);
- this.wrap_gravity.zpp_inner._inuse = !0;
- this.wrap_gravity.zpp_inner._invalidate =
- A(this, this.gravity_invalidate);
- this.wrap_gravity.zpp_inner._validate = A(this, this.gravity_validate)
- },
- gravity_validate: function () {
- this.wrap_gravity.zpp_inner.x = this.gravityx;
- this.wrap_gravity.zpp_inner.y = this.gravityy
- },
- gravity_invalidate: function (a) {
- this.gravityx = a.x;
- this.gravityy = a.y;
- this.invalidate()
- },
- copy: function () {
- var a;
- 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);
- null;
- a.viscosity = this.viscosity;
- a.density = this.density;
- return a
- },
- remShape: function (a) {
- this.shapes.remove(a)
- },
- addShape: function (a) {
- this.shapes.add(a)
- },
- feature_cons: function () {
- this.shapes = new c.util.ZNPList_ZPP_Shape
- },
- alloc: function () {},
- free: function () {
- this.outer = null
- },
- wrapper: function () {
- if (null == this.outer) {
- this.outer = new h.phys.FluidProperties;
- var a = this.outer.zpp_inner;
- a.outer = null;
- a.next = c.phys.ZPP_FluidProperties.zpp_pool;
- c.phys.ZPP_FluidProperties.zpp_pool = a;
- this.outer.zpp_inner = this
- }
- return this.outer
- },
- __class__: c.phys.ZPP_FluidProperties
- };
- c.phys.ZPP_Material = function () {
- this.dynamicFriction = this.staticFriction = this.density = this.elasticity = this.rollingFriction = 0;
- this.next = this.userData = this.outer = this.shapes = this.wrap_shapes = null;
- this.shapes = new c.util.ZNPList_ZPP_Shape;
- this.elasticity = 0;
- this.dynamicFriction = 1;
- this.staticFriction = 2;
- this.density = 0.001;
- this.rollingFriction = 0.01
- };
- s["zpp_nape.phys.ZPP_Material"] = c.phys.ZPP_Material;
- c.phys.ZPP_Material.__name__ = ["zpp_nape", "phys", "ZPP_Material"];
- c.phys.ZPP_Material.prototype = {
- invalidate: function (a) {
- for (var b = this.shapes.head; null != b;) b.elt.invalidate_material(a), b = b.next
- },
- set: function (a) {
- this.dynamicFriction = a.dynamicFriction;
- this.staticFriction = a.staticFriction;
- this.density = a.density;
- this.elasticity = a.elasticity;
- this.rollingFriction = a.rollingFriction
- },
- copy: function () {
- var a = new c.phys.ZPP_Material;
- a.dynamicFriction = this.dynamicFriction;
- a.staticFriction = this.staticFriction;
- a.density = this.density;
- a.elasticity = this.elasticity;
- a.rollingFriction = this.rollingFriction;
- return a
- },
- remShape: function (a) {
- this.shapes.remove(a)
- },
- addShape: function (a) {
- this.shapes.add(a)
- },
- feature_cons: function () {
- this.shapes = new c.util.ZNPList_ZPP_Shape
- },
- alloc: function () {},
- free: function () {
- this.outer = null
- },
- wrapper: function () {
- if (null == this.outer) {
- this.outer = new h.phys.Material;
- var a = this.outer.zpp_inner;
- a.outer = null;
- a.next = c.phys.ZPP_Material.zpp_pool;
- c.phys.ZPP_Material.zpp_pool = a;
- this.outer.zpp_inner = this
- }
- return this.outer
- },
- __class__: c.phys.ZPP_Material
- };
- c.shape = {};
- c.shape.ZPP_Shape = function (a) {
- this.zip_aabb = !1;
- this.sweep = this.node = this.pairs = this.aabb = null;
- this.fluidEnabled = this.sensorEnabled = !1;
- this.circle = this.polygon = this.refmaterial = this.material = this.filter = this.fluidProperties = null;
- this.sweepCoef = 0;
- this.zip_sweepRadius = !1;
- this.sweepRadius = 0;
- this.wrap_localCOM = this.wrap_worldCOM = null;
- this.zip_worldCOM = !1;
- this.worldCOMx = this.worldCOMy = 0;
- this.zip_localCOM = !1;
- this.localCOMx = this.localCOMy = 0;
- this.zip_angDrag = !1;
- this.inertia = this.angDrag = 0;
- this.zip_area_inertia = !1;
- this.type = this.area = 0;
- this.outer = this.body =
- null;
- c.phys.ZPP_Interactor.call(this);
- this.pairs = new c.util.ZNPList_ZPP_AABBPair;
- this.ishape = this;
- this.type = a;
- this.aabb = c.geom.ZPP_AABB.get(0, 0, 0, 0);
- this.aabb._immutable = !0;
- this.aabb._validate = A(this, this.aabb_validate);
- this.zip_area_inertia = this.zip_angDrag = this.zip_localCOM = this.zip_sweepRadius = !0;
- this.worldCOMy = this.worldCOMx = this.localCOMy = this.localCOMx = 0;
- this.sensorEnabled = this.fluidEnabled = !1;
- this.body = this.fluidProperties = null;
- this.refmaterial = new c.phys.ZPP_Material;
- this.sweepRadius = this.sweepCoef =
- 0
- };
- s["zpp_nape.shape.ZPP_Shape"] = c.shape.ZPP_Shape;
- c.shape.ZPP_Shape.__name__ = ["zpp_nape", "shape", "ZPP_Shape"];
- c.shape.ZPP_Shape.__super__ = c.phys.ZPP_Interactor;
- c.shape.ZPP_Shape.prototype = I(c.phys.ZPP_Interactor.prototype, {
- copy: function () {
- var a = null,
- a = this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__copy() : this.polygon.__copy();
- this.zip_area_inertia ? a.invalidate_area_inertia() : (a.area = this.area, a.inertia = this.inertia);
- this.zip_sweepRadius ? a.zip_sweepRadius = !0 : (a.sweepRadius = this.sweepRadius,
- a.sweepCoef = this.sweepCoef);
- this.zip_angDrag ? a.invalidate_angDrag() : a.angDrag = this.angDrag;
- 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);
- var b = a.material;
- b.outer = null;
- b.next = c.phys.ZPP_Material.zpp_pool;
- c.phys.ZPP_Material.zpp_pool = b;
- b = a.filter;
- b.outer = null;
- b.next = c.dynamics.ZPP_InteractionFilter.zpp_pool;
- c.dynamics.ZPP_InteractionFilter.zpp_pool = b;
- a.material = this.material;
- a.filter = this.filter;
- null != this.fluidProperties && (a.fluidProperties = this.fluidProperties);
- a.fluidEnabled = this.fluidEnabled;
- a.sensorEnabled = this.sensorEnabled;
- null != this.userData && (a.userData = W.copy(this.userData));
- this.copyto(a.outer);
- return a.outer
- },
- removedFromSpace: function () {
- this.__iremovedFromSpace();
- this.material.shapes.remove(this);
- this.filter.shapes.remove(this);
- null != this.fluidProperties && this.fluidProperties.shapes.remove(this)
- },
- addedToSpace: function () {
- this.__iaddedToSpace();
- this.material.shapes.add(this);
- this.filter.shapes.add(this);
- null != this.fluidProperties && this.fluidProperties.shapes.add(this)
- },
- removedFromBody: function () {},
- addedToBody: function () {
- this.invalidate_worldCOM();
- this.zip_aabb = !0;
- null != this.body && (this.body.zip_aabb = !0)
- },
- __immutable_midstep: function (a) {
- if (null != this.body && null != this.body.space && this.body.space.midstep) throw "Error: " + a + " cannot be set during a space step()";
- },
- setFluid: function (a) {
- this.fluidProperties != a && (null != this.body && null != this.body.space && null != this.fluidProperties &&
- this.fluidProperties.shapes.remove(this), this.fluidProperties = a, null != this.body && null != this.body.space && a.shapes.add(this), this.fluidEnabled && this.wake())
- },
- setFilter: function (a) {
- 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())
- },
- setMaterial: function (a) {
- this.material != a && (null != this.body && null != this.body.space && null != this.material && this.material.shapes.remove(this),
- this.material = a, null != this.body && null != this.body.space && a.shapes.add(this), this.wake(), null != this.body && this.body.refreshArbiters())
- },
- aabb_validate: function () {
- if (null == this.body) throw "Error: bounds only makes sense when Shape belongs to a Body";
- 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())
- },
- invalidate_fluidprops: function () {
- this.fluidEnabled && this.wake()
- },
- invalidate_filter: function () {
- this.wake()
- },
- invalidate_material: function (a) {
- 0 != (a & c.phys.ZPP_Material.WAKE) && this.wake();
- 0 != (a & c.phys.ZPP_Material.ARBITERS) && null != this.body && this.body.refreshArbiters();
- 0 != (a & c.phys.ZPP_Material.PROPS) && null != this.body && (this.body.invalidate_localCOM(), this.body.invalidate_mass(), this.body.invalidate_inertia());
- 0 != (a & c.phys.ZPP_Material.ANGDRAG) && this.invalidate_angDrag();
- this.refmaterial.set(this.material)
- },
- invalidate_worldCOM: function () {
- this.zip_aabb = this.zip_worldCOM = !0;
- null != this.body && (this.body.zip_aabb = !0)
- },
- invalidate_localCOM: function () {
- this.zip_localCOM = !0;
- this.invalidate_area_inertia();
- this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE && (this.zip_sweepRadius = !0);
- this.invalidate_angDrag();
- this.invalidate_worldCOM();
- null != this.body && this.body.invalidate_localCOM()
- },
- invalidate_angDrag: function () {
- this.zip_angDrag = !0
- },
- invalidate_area_inertia: function () {
- this.zip_area_inertia = !0;
- null != this.body && (this.body.invalidate_localCOM(), this.body.invalidate_mass(), this.body.invalidate_inertia())
- },
- getworldCOM: function () {
- if (null ==
- this.body) throw "Error: worldCOM only makes sense when Shape belongs to a Body";
- 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),
- this.worldCOMy = this.body.posy + (this.localCOMx * this.body.axisx + this.localCOMy * this.body.axisy));
- this.wrap_worldCOM.zpp_inner.x = this.worldCOMx;
- this.wrap_worldCOM.zpp_inner.y = this.worldCOMy
- },
- validate_worldCOM: function () {
- 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), this.worldCOMy = this.body.posy + (this.localCOMx * this.body.axisx + this.localCOMy * this.body.axisy))
- },
- validate_localCOM: function () {
- 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))
- },
- validate_angDrag: function () {
- 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()
- },
- validate_area_inertia: function () {
- 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())
- },
- invalidate_aabb: function () {
- this.zip_aabb = !0;
- null != this.body && (this.body.zip_aabb = !0)
- },
- force_validate_aabb: function () {
- this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle._force_validate_aabb() : this.polygon._force_validate_aabb()
- },
- validate_aabb: function () {
- 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())
- },
- clear: function () {
- this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__clear() :
- this.polygon.__clear()
- },
- validate_sweepRadius: function () {
- this.zip_sweepRadius && (this.zip_sweepRadius = !1, this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? this.circle.__validate_sweepRadius() : this.polygon.__validate_sweepRadius())
- },
- invalidate_sweepRadius: function () {
- this.zip_sweepRadius = !0
- },
- isPolygon: function () {
- return this.type == c.util.ZPP_Flags.id_ShapeType_POLYGON
- },
- isCircle: function () {
- return this.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE
- },
- __class__: c.shape.ZPP_Shape
- });
- c.shape.ZPP_Circle = function () {
- this.radius =
- 0;
- this.outer_zn = null;
- c.shape.ZPP_Shape.call(this, c.util.ZPP_Flags.id_ShapeType_CIRCLE);
- this.circle = this;
- this.zip_localCOM = !1
- };
- s["zpp_nape.shape.ZPP_Circle"] = c.shape.ZPP_Circle;
- c.shape.ZPP_Circle.__name__ = ["zpp_nape", "shape", "ZPP_Circle"];
- c.shape.ZPP_Circle.__super__ = c.shape.ZPP_Shape;
- c.shape.ZPP_Circle.prototype = I(c.shape.ZPP_Shape.prototype, {
- __copy: function () {
- var a = (new h.shape.Circle(this.radius)).zpp_inner_zn;
- a.localCOMx = this.localCOMx;
- a.localCOMy = this.localCOMy;
- a.zip_localCOM = !1;
- return a
- },
- __transform: function (a) {
- var b =
- a.zpp_inner.a * a.zpp_inner.d - a.zpp_inner.b * a.zpp_inner.c;
- 0 > b && (b = -b);
- this.radius *= Math.sqrt(b);
- b = a.zpp_inner.a * this.localCOMx + a.zpp_inner.b * this.localCOMy + a.zpp_inner.tx;
- this.localCOMy = a.zpp_inner.c * this.localCOMx + a.zpp_inner.d * this.localCOMy + a.zpp_inner.ty;
- this.localCOMx = b;
- this.invalidate_radius();
- this.invalidate_localCOM()
- },
- __rotate: function (a, b) {
- if (0 < this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy) {
- var d = 0,
- c = 0,
- d = b * this.localCOMx - a * this.localCOMy,
- c = this.localCOMx * a + this.localCOMy * b;
- this.localCOMx =
- d;
- this.localCOMy = c;
- this.invalidate_localCOM()
- }
- },
- __translate: function (a, b) {
- this.localCOMx += 1 * a;
- this.localCOMy += 1 * b;
- this.invalidate_localCOM()
- },
- __scale: function (a, b) {
- var d = ((0 > a ? -a : a) + (0 > b ? -b : b)) / 2;
- this.radius *= 0 > d ? -d : d;
- this.invalidate_radius();
- 0 < this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy && (this.localCOMx *= a, this.localCOMy *= b, this.invalidate_localCOM())
- },
- __validate_angDrag: function () {
- var a = this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy,
- b = this.radius * this.radius;
- this.angDrag =
- (a + 2 * b) * this.material.dynamicFriction * h.Config.fluidAngularDragFriction + 0.5 * h.Config.fluidAngularDrag * (1 + h.Config.fluidVacuumDrag) * a;
- this.angDrag /= 2 * (a + 0.5 * b)
- },
- __validate_area_inertia: function () {
- var a = this.radius * this.radius;
- this.area = a * Math.PI;
- this.inertia = 0.5 * a + (this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy)
- },
- __validate_sweepRadius: function () {
- this.sweepCoef = Math.sqrt(this.localCOMx * this.localCOMx + this.localCOMy * this.localCOMy);
- this.sweepRadius = this.sweepCoef + this.radius
- },
- _force_validate_aabb: function () {
- 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);
- this.aabb.minx = this.worldCOMx - this.radius;
- this.aabb.miny = this.worldCOMy - this.radius;
- this.aabb.maxx = this.worldCOMx + this.radius;
- this.aabb.maxy = this.worldCOMy + this.radius
- },
- __validate_aabb: function () {
- 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), this.worldCOMy = this.body.posy + (this.localCOMx * this.body.axisx + this.localCOMy * this.body.axisy));
- var a = this.radius,
- b = this.radius;
- this.aabb.minx = this.worldCOMx - a;
- this.aabb.miny = this.worldCOMy - b;
- this.aabb.maxx = this.worldCOMx + a;
- this.aabb.maxy =
- this.worldCOMy + b
- },
- setupLocalCOM: function () {
- this.wrap_localCOM = h.geom.Vec2.get(this.localCOMx, this.localCOMy, null);
- this.wrap_localCOM.zpp_inner._inuse = !0;
- this.wrap_localCOM.zpp_inner._validate = A(this, this.localCOM_validate);
- this.wrap_localCOM.zpp_inner._invalidate = A(this, this.localCOM_invalidate);
- this.wrap_localCOM.zpp_inner._isimmutable = A(this, this.localCOM_immutable)
- },
- localCOM_immutable: function () {
- 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";
- },
- localCOM_invalidate: function (a) {
- this.localCOMx = a.x;
- this.localCOMy = a.y;
- this.invalidate_localCOM();
- null != this.body && this.body.wake()
- },
- localCOM_validate: function () {
- this.wrap_localCOM.zpp_inner.x = this.localCOMx;
- this.wrap_localCOM.zpp_inner.y = this.localCOMy
- },
- invalidate_radius: function () {
- this.invalidate_area_inertia();
- this.invalidate_angDrag();
- this.zip_aabb = !0;
- null != this.body && (this.body.zip_aabb = !0);
- null != this.body && this.body.wake()
- },
- __clear: function () {},
- __class__: c.shape.ZPP_Circle
- });
- c.shape.ZPP_Edge =
- function () {
- this.tp0 = this.tp1 = 0;
- this.lp0 = this.gp0 = this.lp1 = this.gp1 = null;
- this.length = this.lprojection = this.gprojection = 0;
- this.wrap_gnorm = null;
- this.gnormx = this.gnormy = 0;
- this.wrap_lnorm = null;
- this.lnormx = this.lnormy = 0;
- this.next = this.polygon = this.outer = null;
- this.gprojection = this.lprojection = this.length = this.gnormy = this.gnormx = this.lnormy = this.lnormx = 0
- };
- s["zpp_nape.shape.ZPP_Edge"] = c.shape.ZPP_Edge;
- c.shape.ZPP_Edge.__name__ = ["zpp_nape", "shape", "ZPP_Edge"];
- c.shape.ZPP_Edge.prototype = {
- getgnorm: function () {
- this.wrap_gnorm =
- h.geom.Vec2.get(this.gnormx, this.gnormy, null);
- this.wrap_gnorm.zpp_inner._immutable = !0;
- this.wrap_gnorm.zpp_inner._validate = A(this, this.gnorm_validate)
- },
- getlnorm: function () {
- this.wrap_lnorm = h.geom.Vec2.get(this.lnormx, this.lnormy, null);
- this.wrap_lnorm.zpp_inner._immutable = !0;
- this.wrap_lnorm.zpp_inner._validate = A(this, this.lnorm_validate)
- },
- gnorm_validate: function () {
- if (null == this.polygon) throw "Error: Edge not currently in use";
- if (null == this.polygon.body) throw "Error: Edge worldNormal only makes sense if the parent Polygon is contained within a rigid body";
- this.polygon.validate_gaxi();
- this.wrap_gnorm.zpp_inner.x = this.gnormx;
- this.wrap_gnorm.zpp_inner.y = this.gnormy
- },
- lnorm_validate: function () {
- if (null == this.polygon) throw "Error: Edge not currently in use";
- this.polygon.validate_laxi();
- this.wrap_lnorm.zpp_inner.x = this.lnormx;
- this.wrap_lnorm.zpp_inner.y = this.lnormy
- },
- wrapper: function () {
- 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);
- return this.outer
- },
- alloc: function () {},
- free: function () {
- this.polygon =
- null
- },
- __class__: c.shape.ZPP_Edge
- };
- c.shape.ZPP_Polygon = function () {
- this.reverse_flag = this.zip_lverts = this.zip_laxi = this.zip_gverts = this.zip_gaxi = this.zip_valid = this.zip_sanitation = !1;
- this.edgeCnt = 0;
- this.outer_zn = this.lverts = this.wrap_lverts = this.gverts = this.wrap_gverts = this.edges = this.wrap_edges = null;
- c.shape.ZPP_Shape.call(this, c.util.ZPP_Flags.id_ShapeType_POLYGON);
- this.polygon = this;
- this.lverts = new c.geom.ZPP_Vec2;
- this.gverts = new c.geom.ZPP_Vec2;
- this.edges = new c.util.ZNPList_ZPP_Edge;
- this.edgeCnt =
- 0
- };
- s["zpp_nape.shape.ZPP_Polygon"] = c.shape.ZPP_Polygon;
- c.shape.ZPP_Polygon.__name__ = ["zpp_nape", "shape", "ZPP_Polygon"];
- c.shape.ZPP_Polygon.__super__ = c.shape.ZPP_Shape;
- c.shape.ZPP_Polygon.prototype = I(c.shape.ZPP_Shape.prototype, {
- __copy: function () {
- return (new h.shape.Polygon(this.outer_zn.get_localVerts())).zpp_inner_zn
- },
- __transform: function (a) {
- for (var b = this.lverts.next; null != b;) {
- var d = b,
- c = a.zpp_inner.a * d.x + a.zpp_inner.b * d.y + a.zpp_inner.tx;
- d.y = a.zpp_inner.c * d.x + a.zpp_inner.d * d.y + a.zpp_inner.ty;
- d.x =
- c;
- b = b.next
- }
- this.invalidate_lverts()
- },
- __rotate: function (a, b) {
- for (var d = this.lverts.next; null != d;) {
- var c = d,
- e = 0,
- f = 0,
- e = b * c.x - a * c.y,
- f = c.x * a + c.y * b;
- c.x = e;
- c.y = f;
- d = d.next
- }
- this.invalidate_lverts()
- },
- __scale: function (a, b) {
- for (var d = this.lverts.next; null != d;) {
- var c = d;
- c.x *= a;
- c.y *= b;
- d = d.next
- }
- this.invalidate_lverts()
- },
- __translate: function (a, b) {
- for (var d = this.lverts.next; null != d;) {
- var c = d;
- c.x += 1 * a;
- c.y += 1 * b;
- d = d.next
- }
- this.invalidate_lverts()
- },
- setupLocalCOM: function () {
- this.wrap_localCOM = h.geom.Vec2.get(this.localCOMx,
- this.localCOMy, null);
- this.wrap_localCOM.zpp_inner._inuse = !0;
- this.wrap_localCOM.zpp_inner._validate = A(this, this.localCOM_validate);
- this.wrap_localCOM.zpp_inner._invalidate = A(this, this.localCOM_invalidate)
- },
- localCOM_invalidate: function (a) {
- 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));
- var b = 0,
- d = 0,
- b = a.x -
- this.localCOMx,
- d = a.y - this.localCOMy;
- for (a = this.lverts.next; null != a;) {
- var g = a;
- g.x += 1 * b;
- g.y += 1 * d;
- a = a.next
- }
- this.invalidate_lverts()
- },
- localCOM_validate: function () {
- if (null == this.lverts.next) throw "Error: An empty polygon does not have any meaningful localCOM";
- 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))
- },
- __validate_localCOM: function () {
- if (null == this.lverts.next) throw "Error: An empty polygon has no meaningful localCOM";
- if (null == this.lverts.next.next) this.localCOMx = this.lverts.next.x, this.localCOMy = this.lverts.next.y;
- else {
- if (null == this.lverts.next.next.next) {
- this.localCOMx = this.lverts.next.x;
- this.localCOMy = this.lverts.next.y;
- var a = 1;
- this.localCOMx += this.lverts.next.next.x * a;
- this.localCOMy += this.lverts.next.next.y * a;
- a = 0.5
- } else {
- for (var a = this.localCOMy = this.localCOMx = 0, b = this.lverts.next, d = b, c = b = b.next,
- b = b.next; null != b;) {
- var e = b,
- a = a + c.x * (e.y - d.y),
- d = e.y * c.x - e.x * c.y;
- this.localCOMx += (c.x + e.x) * d;
- this.localCOMy += (c.y + e.y) * d;
- d = c;
- c = e;
- b = b.next
- }
- e = b = this.lverts.next;
- a += c.x * (e.y - d.y);
- d = e.y * c.x - e.x * c.y;
- this.localCOMx += (c.x + e.x) * d;
- this.localCOMy += (c.y + e.y) * d;
- d = c;
- c = e;
- b = b.next;
- a += c.x * (b.y - d.y);
- d = b.y * c.x - b.x * c.y;
- this.localCOMx += (c.x + b.x) * d;
- this.localCOMy += (c.y + b.y) * d;
- a = 1 / (3 * a)
- }
- this.localCOMx *= a;
- this.localCOMy *= a
- }
- },
- __validate_angDrag: function () {
- if (3 > this.lverts.length) throw "Error: Polygon's with less than 3 vertices have no meaningful angDrag";
- this.validate_area_inertia();
- this.validate_laxi();
- for (var a = 0, b = this.edges.head, d = 0, c = this.lverts.next, e = c, c = c.next; null != c;) {
- var f = c,
- l = b.elt,
- b = b.next,
- d = d + l.length,
- m = 0,
- k = 0,
- m = f.x - e.x,
- k = f.y - e.y,
- a = a + l.length * h.Config.fluidAngularDragFriction * this.material.dynamicFriction * l.lprojection * l.lprojection,
- p = -(e.y * l.lnormx - e.x * l.lnormy) / (k * l.lnormx - m * l.lnormy);
- if (0 < p) var n = 1 < p ? 1 : p,
- r = 0,
- q = 0,
- r = e.x,
- q = e.y,
- w = n,
- r = r + m * w,
- q = q + k * w,
- t = l.lnormy * e.x - l.lnormx * e.y,
- r = l.lnormy * r - l.lnormx * q,
- t = (r * r * r - t * t * t) / (3 * (r - t)),
- a = a + t * n * l.length *
- h.Config.fluidAngularDrag;
- 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);
- e = f;
- c = c.next
- }
- f = c = this.lverts.next;
- l = b.elt;
- d += l.length;
- m = f.x - e.x;
- k = f.y - e.y;
- a += l.length * h.Config.fluidAngularDragFriction * this.material.dynamicFriction * l.lprojection * l.lprojection;
- p = -(e.y * l.lnormx - e.x * l.lnormy) / (k * l.lnormx - m * l.lnormy);
- 0 < p && (n = 1 < p ? 1 : p, r = e.x, q = e.y, w = n, t = l.lnormy * e.x -
- 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);
- 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);
- this.angDrag = a / (this.inertia * d)
- },
- __validate_area_inertia: function () {
- if (null == this.lverts.next || null == this.lverts.next.next || null == this.lverts.next.next.next) this.inertia = this.area = 0;
- else {
- for (var a =
- this.area = 0, b = 0, d = this.lverts.next, c = d, e = d = d.next, d = d.next; null != d;) {
- var f = d,
- l = e.y * c.x - e.x * c.y,
- 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),
- a = a + l * h,
- b = b + l;
- this.area += e.x * (f.y - c.y);
- c = e;
- e = f;
- d = d.next
- }
- f = d = this.lverts.next;
- l = e.y * c.x - e.x * c.y;
- 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);
- a += l * h;
- b += l;
- this.area += e.x * (f.y - c.y);
- c = e;
- e = f;
- d = d.next;
- l = e.y * c.x - e.x * c.y;
- 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);
- this.area += e.x * (d.y - c.y);
- this.inertia = (a + l * h) / (6 * (b + l));
- this.area *= 0.5;
- 0 > this.area &&
- (this.area = -this.area, this.reverse_vertices())
- }
- },
- __validate_sweepRadius: function () {
- var a = 0,
- b = 0;
- this.validate_laxi();
- for (var d = this.lverts.next; null != d;) {
- var c = d,
- c = c.x * c.x + c.y * c.y;
- c > a && (a = c);
- d = d.next
- }
- for (d = this.edges.head; null != d;) {
- c = d.elt;
- if (c.lprojection < b && (b = c.lprojection, 0 > b)) break;
- d = d.next
- }
- 0 > b && (b = 0);
- this.sweepRadius = Math.sqrt(a);
- this.sweepCoef = this.sweepRadius - b
- },
- _force_validate_aabb: function () {
- var a = this.lverts.next,
- b = this.gverts.next,
- d = a,
- a = a.next;
- b.x = this.body.posx + (this.body.axisy * d.x - this.body.axisx *
- d.y);
- b.y = this.body.posy + (d.x * this.body.axisx + d.y * this.body.axisy);
- this.aabb.minx = b.x;
- this.aabb.miny = b.y;
- this.aabb.maxx = b.x;
- this.aabb.maxy = b.y;
- for (b = this.gverts.next.next; null != b;) {
- var d = b,
- c = a,
- a = a.next;
- d.x = this.body.posx + (this.body.axisy * c.x - this.body.axisx * c.y);
- d.y = this.body.posy + (c.x * this.body.axisx + c.y * this.body.axisy);
- d.x < this.aabb.minx && (this.aabb.minx = d.x);
- d.x > this.aabb.maxx && (this.aabb.maxx = d.x);
- d.y < this.aabb.miny && (this.aabb.miny = d.y);
- d.y > this.aabb.maxy && (this.aabb.maxy = d.y);
- b = b.next
- }
- },
- __validate_aabb: function () {
- this.validate_gverts();
- if (null == this.lverts.next) throw "Error: An empty polygon has no meaningful bounds";
- var a = this.gverts.next;
- this.aabb.minx = a.x;
- this.aabb.miny = a.y;
- this.aabb.maxx = a.x;
- this.aabb.maxy = a.y;
- for (a = this.gverts.next.next; null != a;) {
- var b = a;
- b.x < this.aabb.minx && (this.aabb.minx = b.x);
- b.x > this.aabb.maxx && (this.aabb.maxx = b.x);
- b.y < this.aabb.miny && (this.aabb.miny = b.y);
- b.y > this.aabb.maxy && (this.aabb.maxy = b.y);
- a = a.next
- }
- },
- validate_gaxi: function () {
- if (this.zip_gaxi && null != this.body) {
- this.zip_gaxi = !1;
- this.validate_laxi();
- this.body.validate_axis();
- this.validate_gverts();
- for (var a = this.edges.head, b = this.gverts.next, d = b, b = b.next; null != b;) {
- var c = b,
- e = a.elt,
- a = a.next;
- e.gp0 = d;
- e.gp1 = c;
- e.gnormx = this.body.axisy * e.lnormx - this.body.axisx * e.lnormy;
- e.gnormy = e.lnormx * this.body.axisx + e.lnormy * this.body.axisy;
- e.gprojection = this.body.posx * e.gnormx + this.body.posy * e.gnormy + e.lprojection;
- null != e.wrap_gnorm && (e.wrap_gnorm.zpp_inner.x = e.gnormx, e.wrap_gnorm.zpp_inner.y = e.gnormy);
- e.tp0 = e.gp0.y * e.gnormx - e.gp0.x * e.gnormy;
- e.tp1 = e.gp1.y * e.gnormx - e.gp1.x * e.gnormy;
- d = c;
- b =
- b.next
- }
- c = this.gverts.next;
- e = a.elt;
- e.gp0 = d;
- e.gp1 = c;
- e.gnormx = this.body.axisy * e.lnormx - this.body.axisx * e.lnormy;
- e.gnormy = e.lnormx * this.body.axisx + e.lnormy * this.body.axisy;
- e.gprojection = this.body.posx * e.gnormx + this.body.posy * e.gnormy + e.lprojection;
- null != e.wrap_gnorm && (e.wrap_gnorm.zpp_inner.x = e.gnormx, e.wrap_gnorm.zpp_inner.y = e.gnormy);
- e.tp0 = e.gp0.y * e.gnormx - e.gp0.x * e.gnormy;
- e.tp1 = e.gp1.y * e.gnormx - e.gp1.x * e.gnormy
- }
- },
- validate_gverts: function () {
- if (this.zip_gverts && null != this.body) {
- this.zip_gverts = !1;
- this.validate_lverts();
- this.body.validate_axis();
- for (var a = this.lverts.next, b = this.gverts.next; null != b;) {
- var d = b,
- c = a,
- a = a.next;
- d.x = this.body.posx + (this.body.axisy * c.x - this.body.axisx * c.y);
- d.y = this.body.posy + (c.x * this.body.axisx + c.y * this.body.axisy);
- b = b.next
- }
- }
- },
- validate_laxi: function () {
- if (this.zip_laxi) {
- this.zip_laxi = !1;
- this.validate_lverts();
- for (var a = this.edges.head, b = this.lverts.next, d = b, b = b.next; null != b;) {
- var c = b,
- e = a.elt,
- a = a.next;
- e.lp0 = d;
- e.lp1 = c;
- var f = 0,
- l = 0,
- f = d.x - c.x,
- l = d.y - c.y,
- h = Math.sqrt(f * f + l * l);
- e.length = h;
- h = 1 / h;
- f *=
- h;
- l *= h;
- h = f;
- f = -l;
- l = h;
- e.lprojection = f * d.x + l * d.y;
- e.lnormx = f;
- e.lnormy = l;
- null != e.wrap_lnorm && (e.wrap_lnorm.zpp_inner.x = f, e.wrap_lnorm.zpp_inner.y = l);
- d = c;
- b = b.next
- }
- c = this.lverts.next;
- e = a.elt;
- e.lp0 = d;
- e.lp1 = c;
- f = d.x - c.x;
- l = d.y - c.y;
- h = Math.sqrt(f * f + l * l);
- e.length = h;
- h = 1 / h;
- l *= h;
- h *= f;
- f = -l;
- l = h;
- e.lprojection = f * d.x + l * d.y;
- e.lnormx = f;
- e.lnormy = l;
- null != e.wrap_lnorm && (e.wrap_lnorm.zpp_inner.x = f, e.wrap_lnorm.zpp_inner.y = l)
- }
- },
- reverse_vertices: function () {
- this.lverts.reverse();
- this.gverts.reverse();
- this.edges.reverse();
- var a =
- this.edges.iterator_at(this.edgeCnt - 1),
- b = this.edges.pop_unsafe();
- this.edges.insert(a, b);
- this.reverse_flag = !this.reverse_flag;
- null != this.wrap_lverts && (this.wrap_lverts.zpp_inner.reverse_flag = this.reverse_flag);
- null != this.wrap_gverts && (this.wrap_gverts.zpp_inner.reverse_flag = this.reverse_flag);
- null != this.wrap_edges && (this.wrap_edges.zpp_inner.reverse_flag = this.reverse_flag)
- },
- splice_collinear_real: function () {
- if (null != this.lverts.next && null != this.lverts.next.next && null != this.lverts.next.next.next) {
- for (var a =
- null, b = this.lverts.next; null != b;) {
- var d = null == b.next ? this.lverts.next : b.next,
- g = b,
- e = d;
- 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)
- }
- if (null != this.lverts.next) {
- do
- for (a = !1, b = this.lverts.next; null != b;) {
- var f = null == b.next ? this.lverts.next : b.next,
- d = null == f.next ? this.lverts.next : f.next,
- g = b,
- e = f,
- l = 0,
- m = 0,
- l = e.x - g.x,
- m = e.y - g.y,
- k = g = 0,
- g = d.x - e.x,
- k = d.y - e.y,
- e = k * l - g * m;
- e * e >= h.Config.epsilon * h.Config.epsilon || (this.cleanup_lvert(f),
- this.lverts.erase(null == b.next ? null : b), a = !0);
- b = b.next
- }
- while (a)
- }
- }
- },
- splice_collinear: function () {
- this.zip_sanitation && (this.zip_sanitation = !1, this.splice_collinear_real())
- },
- cleanup_lvert: function (a) {
- 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;
- a = null == b ? this.gverts.next : b.next;
- this.gverts.erase(b);
- b = a;
- null != b.outer && (b.outer.zpp_inner = null, b.outer = null);
- b._isimmutable = null;
- b._validate = null;
- b._invalidate = null;
- b.next =
- c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = b;
- 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--)
- },
- validate_lverts: function () {
- this.zip_lverts &&
- (this.zip_lverts = !1, 2 < this.lverts.length && (this.validate_area_inertia(), 0 > this.area && (this.reverse_vertices(), this.area = -this.area)))
- },
- valid: function () {
- if (this.zip_valid) {
- this.zip_valid = !1;
- this.zip_sanitation && (this.zip_sanitation = !1, this.splice_collinear_real());
- 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;
- this.validate_lverts();
- this.validate_area_inertia();
- 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;
- for (var a = !1, b = !1, d = !0, g = this.lverts.next, e = g, f = g = g.next, g = g.next; null != g;) {
- var l = g,
- m = 0,
- k = 0,
- m = l.x - f.x,
- k = l.y - f.y,
- p = 0,
- n = 0,
- 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);
- if (b && a) {
- d = !1;
- break
- }
- e = f;
- f = l;
- g = g.next
- }
- 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)));
- 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,
- c.util.ZPP_Flags.internal = !1), this.validation = c.util.ZPP_Flags.ValidationResult_CONCAVE;
- d = a = !0;
- e = g = this.lverts.next;
- for (g = g.next; null != g;) {
- f = g;
- if (!a) {
- d = !1;
- break
- }
- b = !0;
- m = l = this.lverts.next;
- for (l = l.next; null != l;) {
- k = l;
- if (e != m && e != k && f != m && f != k) {
- var n = p = 0,
- p = e.x - m.x,
- n = e.y - m.y,
- r = 0,
- q = 0,
- r = f.x - e.x,
- q = f.y - e.y,
- w = 0,
- t = 0,
- w = k.x - m.x,
- t = k.y - m.y,
- s = q * w - r * t;
- 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))) {
- b = a = !1;
- break
- }
- }
- m = k;
- l = l.next
- }
- 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)))));
- e = f;
- g = g.next
- }
- if (d) {
- do
- if (f = this.lverts.next, a) {
- b = !0;
- m = l = this.lverts.next;
- for (l = l.next; null != l;) {
- k = l;
- 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 =
- 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)))) {
- b = a = !1;
- break
- }
- m = k;
- l = l.next
- }
- 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)))))
- }
- while (0)
- }
- 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);
- return e
- }
- return this.validation
- },
- invalidate_gaxi: function () {
- this.zip_gaxi = !0
- },
- invalidate_gverts: function () {
- this.zip_aabb = !0;
- null != this.body && (this.body.zip_aabb = !0);
- this.zip_gverts = !0
- },
- invalidate_laxi: function () {
- this.invalidate_gaxi();
- this.zip_laxi = this.zip_sweepRadius = !0
- },
- invalidate_lverts: function () {
- this.invalidate_laxi();
- this.invalidate_area_inertia();
- this.invalidate_angDrag();
- this.invalidate_localCOM();
- this.invalidate_gverts();
- this.zip_sanitation = this.zip_valid = this.zip_lverts = !0;
- null != this.body && this.body.wake()
- },
- getedges: function () {
- this.wrap_edges = c.util.ZPP_EdgeList.get(this.edges, !0);
- this.wrap_edges.zpp_inner.reverse_flag = this.reverse_flag;
- this.wrap_edges.zpp_inner._validate = A(this, this.edges_validate)
- },
- getgverts: function () {
- this.wrap_gverts = c.util.ZPP_MixVec2List.get(this.gverts, !0);
- this.wrap_gverts.zpp_inner.reverse_flag = this.reverse_flag;
- this.wrap_gverts.zpp_inner._validate = A(this, this.gverts_validate)
- },
- getlverts: function () {
- this.wrap_lverts = c.util.ZPP_MixVec2List.get(this.lverts);
- this.wrap_lverts.zpp_inner.post_adder = A(this, this.lverts_post_adder);
- this.wrap_lverts.zpp_inner.subber =
- A(this, this.lverts_subber);
- this.wrap_lverts.zpp_inner._invalidate = A(this, this.lverts_invalidate);
- this.wrap_lverts.zpp_inner._validate = A(this, this.lverts_validate);
- this.wrap_lverts.zpp_inner._modifiable = A(this, this.lverts_modifiable);
- this.wrap_lverts.zpp_inner.reverse_flag = this.reverse_flag
- },
- edges_validate: function () {
- this.validate_lverts()
- },
- gverts_validate: function () {
- this.validate_gverts()
- },
- lverts_modifiable: function () {
- this.immutable_midstep("Polygon::localVerts");
- if (null != this.body && this.body.type ==
- c.util.ZPP_Flags.id_BodyType_STATIC && null != this.body.space) throw "Error: Cannot modifiy shapes of static object once added to Space";
- },
- lverts_validate: function () {
- this.validate_lverts()
- },
- lverts_invalidate: function (a) {
- this.invalidate_lverts()
- },
- lverts_subber: function (a) {
- this.cleanup_lvert(a.zpp_inner)
- },
- lverts_post_adder: function (a) {
- a.zpp_inner._invalidate = A(this, this.lverts_pa_invalidate);
- a.zpp_inner._isimmutable = A(this, this.lverts_pa_immutable);
- for (var b = null, d = null, g = this.lverts.next; null != g && g != a.zpp_inner;) b =
- null == b ? this.gverts.next : b.next, d = null == d ? this.edges.head : d.next, g = g.next;
- a = c.geom.ZPP_Vec2.get(0, 0, !0);
- this.gverts.insert(b, a);
- 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 =
- 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++));
- a._validate = A(this, this.gverts_pa_validate)
- },
- gverts_pa_validate: function () {
- if (null == this.body) throw "Error: World vertex only makes sense when Polygon is contained in a rigid body";
- this.validate_gverts()
- },
- lverts_pa_immutable: function () {
- if (null != this.body && this.body.type ==
- 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";
- },
- lverts_pa_invalidate: function (a) {
- this.invalidate_lverts()
- },
- __clear: function () {},
- __class__: c.shape.ZPP_Polygon
- });
- c.space = {};
- c.space.ZPP_Broadphase = function () {
- this.sweep = this.dynab = this.aabbShape = this.matrix = this.circShape = null;
- this.is_sweep = !1;
- this.space = null
- };
- s["zpp_nape.space.ZPP_Broadphase"] = c.space.ZPP_Broadphase;
- c.space.ZPP_Broadphase.__name__ = ["zpp_nape", "space", "ZPP_Broadphase"];
- c.space.ZPP_Broadphase.prototype = {
- rayMultiCast: function (a, b, d, c) {
- return null
- },
- rayCast: function (a, b, d) {
- return null
- },
- bodiesInShape: function (a, b, d, c) {
- return null
- },
- shapesInShape: function (a, b, d, c) {
- return null
- },
- validateShape: function (a) {
- a.type == c.util.ZPP_Flags.id_ShapeType_POLYGON && a.polygon.validate_gaxi();
- 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());
- 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 * a.localCOMx - a.body.axisx * a.localCOMy), a.worldCOMy = a.body.posy + (a.localCOMx * a.body.axisx + a.localCOMy * a.body.axisy))
- },
- bodiesInCircle: function (a, b, d, c, e, f) {
- return null
- },
- shapesInCircle: function (a, b,
- d, c, e, f) {
- return null
- },
- updateCircShape: function (a, b, d) {
- if (null == this.circShape) {
- var g = h.phys.Body;
- 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);
- (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)))
- } 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)),
- 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);
- this.circShape.zpp_inner.validate_aabb()
- },
- bodiesInAABB: function (a, b, d, c, e) {
- return null
- },
- shapesInAABB: function (a, b, d, c, e) {
- return null
- },
- updateAABBShape: function (a) {
- if (null == this.aabbShape) {
- var b = h.phys.Body;
- 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);
- (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)))
- } else {
- var b = this.aabbShape.zpp_inner.aabb,
- d = (a.maxx - a.minx) / (b.maxx - b.minx),
- g = (a.maxy - a.miny) / (b.maxy - b.miny);
- null == this.matrix && (this.matrix = new h.geom.Mat23);
- this.matrix.set_a(d);
- this.matrix.set_b(this.matrix.set_c(0));
- this.matrix.set_d(g);
- this.matrix.set_tx(a.minx - d * b.minx);
- this.matrix.set_ty(a.miny - g * b.miny);
- this.aabbShape.transform(this.matrix)
- }
- this.aabbShape.zpp_inner.validate_aabb();
- this.aabbShape.zpp_inner.polygon.validate_gaxi()
- },
- bodiesUnderPoint: function (a, b, d, c) {
- return null
- },
- shapesUnderPoint: function (a, b, d, c) {
- return null
- },
- clear: function () {},
- broadphase: function (a, b) {},
- sync: function (a) {
- 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)
- },
- remove: function (a) {
- this.is_sweep ? this.sweep.__remove(a) : this.dynab.__remove(a)
- },
- insert: function (a) {
- this.is_sweep ?
- this.sweep.__insert(a) : this.dynab.__insert(a)
- },
- __class__: c.space.ZPP_Broadphase
- };
- c.space.ZPP_AABBNode = function () {
- this.synced = this.first_sync = !1;
- this.snext = null;
- this.moved = !1;
- this.next = this.mnext = null;
- this.height = this.rayt = 0;
- this.parent = this.child1 = this.child2 = null;
- this.dyn = !1;
- this.aabb = this.shape = null;
- this.height = -1
- };
- s["zpp_nape.space.ZPP_AABBNode"] = c.space.ZPP_AABBNode;
- c.space.ZPP_AABBNode.__name__ = ["zpp_nape", "space", "ZPP_AABBNode"];
- c.space.ZPP_AABBNode.prototype = {
- isLeaf: function () {
- return null ==
- this.child1
- },
- free: function () {
- this.height = -1;
- var a = this.aabb;
- null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
- a.wrap_min = a.wrap_max = null;
- a._invalidate = null;
- a._validate = null;
- a.next = c.geom.ZPP_AABB.zpp_pool;
- c.geom.ZPP_AABB.zpp_pool = a;
- this.mnext = this.snext = this.next = this.child1 = this.child2 = this.parent = null
- },
- alloc: function () {
- 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);
- null;
- this.first_sync =
- this.synced = this.moved = !1
- },
- __class__: c.space.ZPP_AABBNode
- };
- c.space.ZPP_AABBPair = function () {
- this.arb = this.next = null;
- this.id = this.di = 0;
- this.first = this.sleeping = !1;
- this.n1 = this.n2 = null
- };
- s["zpp_nape.space.ZPP_AABBPair"] = c.space.ZPP_AABBPair;
- c.space.ZPP_AABBPair.__name__ = ["zpp_nape", "space", "ZPP_AABBPair"];
- c.space.ZPP_AABBPair.prototype = {
- free: function () {
- this.n1 = this.n2 = null;
- this.sleeping = !1
- },
- alloc: function () {},
- __class__: c.space.ZPP_AABBPair
- };
- c.space.ZPP_AABBTree = function () {
- this.root = null
- };
- s["zpp_nape.space.ZPP_AABBTree"] =
- c.space.ZPP_AABBTree;
- c.space.ZPP_AABBTree.__name__ = ["zpp_nape", "space", "ZPP_AABBTree"];
- c.space.ZPP_AABBTree.prototype = {
- balance: function (a) {
- if (null == a.child1 || 2 > a.height) return a;
- var b = a.child1,
- d = a.child2,
- c = d.height - b.height;
- if (1 < c) {
- var e = d.child1,
- f = d.child2;
- d.child1 = a;
- d.parent = a.parent;
- a.parent = d;
- null != d.parent ? d.parent.child1 == a ? d.parent.child1 = d : d.parent.child2 = d : this.root = d;
- 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 =
- 1 + function (a) {
- a = b.height;
- var d = f.height;
- return a > d ? a : d
- }(this), d.height = 1 + function (b) {
- b = a.height;
- var d = e.height;
- return b > d ? b : d
- }(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) {
- a = b.height;
- var d = e.height;
- return a > d ? a : d
- }(this), d.height = 1 + function (b) {
- b = a.height;
- var d = f.height;
- return b > d ? b : d
- }(this));
- return d
- }
- 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 =
- 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) {
- a = d.height;
- var b = f.height;
- return a > b ? a : b
- }(this), b.height = 1 + function (b) {
- b = a.height;
- var d = e.height;
- return b > d ? b : d
- }(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) {
- a = d.height;
- var b = e.height;
- return a > b ? a : b
- }(this), b.height = 1 + function (b) {
- b = a.height;
- var d =
- f.height;
- return b > d ? b : d
- }(this)), b) : a
- },
- inlined_removeLeaf: function (a) {
- if (a == this.root) this.root = null;
- else {
- var b = a.parent,
- d = b.parent;
- a = b.child1 == a ? b.child2 : b.child1;
- if (null != d)
- 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;) {
- var d = this.balance(d),
- g = d.child1;
- a = d.child2;
- d.aabb.setCombine(g.aabb, a.aabb);
- var b = d,
- e = void 0,
- g = g.height;
- a = a.height;
- e = g > a ? g : a;
- b.height = 1 + e;
- d = d.parent
- } else this.root = a, a.parent = null, b.free(),
- b.next = c.space.ZPP_AABBNode.zpp_pool, c.space.ZPP_AABBNode.zpp_pool = b
- }
- },
- removeLeaf: function (a) {
- this.inlined_removeLeaf(a)
- },
- inlined_insertLeaf: function (a) {
- if (null == this.root) this.root = a, this.root.parent = null;
- else {
- for (var b = a.aabb, d = this.root; null != d.child1;) {
- var g = d.child1,
- e = d.child2,
- f = d.aabb.perimeter();
- c.space.ZPP_AABBTree.tmpaabb.setCombine(d.aabb, b);
- var l = c.space.ZPP_AABBTree.tmpaabb.perimeter(),
- h = 2 * l,
- k = 2 * (l - f),
- f = function (a) {
- c.space.ZPP_AABBTree.tmpaabb.setCombine(b, g.aabb);
- null == g.child1 ? a = c.space.ZPP_AABBTree.tmpaabb.perimeter() +
- k : (a = g.aabb.perimeter(), a = c.space.ZPP_AABBTree.tmpaabb.perimeter() - a + k);
- return a
- }(this),
- l = function (a) {
- c.space.ZPP_AABBTree.tmpaabb.setCombine(b, e.aabb);
- null == e.child1 ? a = c.space.ZPP_AABBTree.tmpaabb.perimeter() + k : (a = e.aabb.perimeter(), a = c.space.ZPP_AABBTree.tmpaabb.perimeter() - a + k);
- return a
- }(this);
- if (h < f && h < l) break;
- else d = f < l ? g : e
- }
- h = d.parent;
- 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);
- null == c.geom.ZPP_AABB.zpp_pool ?
- 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);
- null;
- f.moved = !1;
- f.synced = !1;
- f.first_sync = !1;
- f.parent = h;
- f.aabb.setCombine(b, d.aabb);
- f.height = d.height + 1;
- 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);
- for (d = a.parent; null != d;) d = this.balance(d), g = d.child1, e = d.child2, d.height = 1 + function (a) {
- a = g.height;
- var b = e.height;
- return a > b ? a : b
- }(this), d.aabb.setCombine(g.aabb,
- e.aabb), d = d.parent
- }
- },
- insertLeaf: function (a) {
- this.inlined_insertLeaf(a)
- },
- clear: function () {
- if (null != this.root) {
- var a;
- this.root.next = null;
- for (a = this.root; null != a;) {
- var b;
- b = void 0;
- b = a;
- a = b.next;
- b.next = null;
- 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));
- b.free();
- b.next = c.space.ZPP_AABBNode.zpp_pool;
- c.space.ZPP_AABBNode.zpp_pool = b
- }
- this.root = null
- }
- },
- __class__: c.space.ZPP_AABBTree
- };
- c.space.ZPP_DynAABBPhase =
- function (a) {
- this.stree = this.dtree = this.pairs = this.syncs = this.moves = this.treeStack = this.treeStack2 = this.failed = this.openlist = null;
- this.space = a;
- this.is_sweep = !1;
- this.dynab = this;
- this.stree = new c.space.ZPP_AABBTree;
- this.dtree = new c.space.ZPP_AABBTree
- };
- s["zpp_nape.space.ZPP_DynAABBPhase"] = c.space.ZPP_DynAABBPhase;
- c.space.ZPP_DynAABBPhase.__name__ = ["zpp_nape", "space", "ZPP_DynAABBPhase"];
- c.space.ZPP_DynAABBPhase.__super__ = c.space.ZPP_Broadphase;
- c.space.ZPP_DynAABBPhase.prototype = I(c.space.ZPP_Broadphase.prototype, {
- rayMultiCast: function (a, b, d, g) {
- null == this.openlist && (this.openlist = new c.util.ZNPList_ZPP_AABBNode);
- this.sync_broadphase();
- a.validate_dir();
- var e = a.maxdist >= Math.POSITIVE_INFINITY;
- g = null == g ? new h.geom.RayResultList : g;
- if (null != this.dtree.root && a.aabbtest(this.dtree.root.aabb))
- if (e) this.openlist.add(this.dtree.root);
- else {
- var f = a.aabbsect(this.dtree.root.aabb);
- 0 <= f && f < a.maxdist && this.openlist.add(this.dtree.root)
- }
- null != this.stree.root && a.aabbtest(this.stree.root.aabb) && (e ? this.openlist.add(this.stree.root) :
- (f = a.aabbsect(this.stree.root.aabb), 0 <= f && f < a.maxdist && this.openlist.add(this.stree.root)));
- for (; null != this.openlist.head;) {
- var l = this.openlist.pop_unsafe();
- if (null == l.child1) {
- 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)
- } 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))),
- 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)))
- }
- this.openlist.clear();
- return g
- },
- rayCast: function (a, b, d) {
- null == this.openlist && (this.openlist = new c.util.ZNPList_ZPP_AABBNode);
- this.sync_broadphase();
- a.validate_dir();
- var g = a.maxdist;
- if (null != this.dtree.root && a.aabbtest(this.dtree.root.aabb)) {
- var e = a.aabbsect(this.dtree.root.aabb);
- if (0 <= e && e < g) {
- this.dtree.root.rayt = e;
- for (var e = null, f = this.openlist.head; null !=
- f;) {
- var l = f.elt;
- if (this.dtree.root.rayt < l.rayt) break;
- e = f;
- f = f.next
- }
- this.openlist.inlined_insert(e, this.dtree.root)
- }
- }
- if (null != this.stree.root && a.aabbtest(this.stree.root.aabb) && (e = a.aabbsect(this.stree.root.aabb), 0 <= e && e < g)) {
- this.stree.root.rayt = e;
- e = null;
- for (f = this.openlist.head; null != f;) {
- l = f.elt;
- if (this.stree.root.rayt < l.rayt) break;
- e = f;
- f = f.next
- }
- this.openlist.inlined_insert(e, this.stree.root)
- }
- for (var h = null; null != this.openlist.head;) {
- var k = this.openlist.pop_unsafe();
- if (k.rayt >= g) break;
- if (null == k.child1) {
- if (k =
- k.shape, null == d || k.filter.shouldCollide(d))
- 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) {
- g = void 0;
- if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- g = k.zpp_inner.toiDistance;
- if (null != h) {
- if (null != h.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- h.zpp_inner.free()
- }
- h = k
- }
- } else {
- if (null != k.child1 && a.aabbtest(k.child1.aabb) && (e = a.aabbsect(k.child1.aabb),
- 0 <= e && e < g)) {
- k.child1.rayt = e;
- e = null;
- for (f = this.openlist.head; null != f;) {
- l = f.elt;
- if (k.child1.rayt < l.rayt) break;
- e = f;
- f = f.next
- }
- this.openlist.inlined_insert(e, k.child1)
- }
- if (null != k.child2 && a.aabbtest(k.child2.aabb) && (e = a.aabbsect(k.child2.aabb), 0 <= e && e < g)) {
- k.child2.rayt = e;
- e = null;
- for (f = this.openlist.head; null != f;) {
- l = f.elt;
- if (k.child2.rayt < l.rayt) break;
- e = f;
- f = f.next
- }
- this.openlist.inlined_insert(e, k.child2)
- }
- }
- }
- this.openlist.clear();
- return h
- },
- bodiesInShape: function (a, b, d, g) {
- this.sync_broadphase();
- this.validateShape(a);
- var e = a.aabb;
- g = null == g ? new h.phys.BodyList : g;
- null == this.failed && (this.failed = new h.phys.BodyList);
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
- var f = this.treeStack.pop_unsafe();
- if (f.aabb.intersect(e))
- if (null == f.child1) {
- var l = f.shape.body.outer;
- 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),
- this.failed.push(l))) : !g.has(l) && c.geom.ZPP_Collide.testCollide_safe(f.shape, a) && g.push(l)
- } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2)
- }
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
- if (f = this.treeStack.pop_unsafe(), f.aabb.intersect(e))
- if (null == f.child1) {
- if (l = f.shape.body.outer, 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), this.failed.push(l))) : !g.has(l) && c.geom.ZPP_Collide.testCollide_safe(f.shape, a) && g.push(l)
- } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
- this.failed.clear();
- return g
- },
- shapesInShape: function (a, b, d, g) {
- this.sync_broadphase();
- this.validateShape(a);
- var e = a.aabb;
- g = null == g ? new h.shape.ShapeList : g;
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode),
- this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
- var f = this.treeStack.pop_unsafe();
- if (f.aabb.intersect(e))
- if (null == f.child1) {
- 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)
- } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2)
- }
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode),
- this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
- if (f = this.treeStack.pop_unsafe(), f.aabb.intersect(e))
- if (null == f.child1) {
- 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)
- } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
- return g
- },
- bodiesInCircle: function (a, b, d, g, e, f) {
- this.sync_broadphase();
- this.updateCircShape(a,
- b, d);
- a = this.circShape.zpp_inner.aabb;
- f = null == f ? new h.phys.BodyList : f;
- null == this.failed && (this.failed = new h.phys.BodyList);
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
- if (d = this.treeStack.pop_unsafe(), d.aabb.intersect(a))
- if (null == d.child1) {
- 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,
- 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)
- } else null != d.child1 && this.treeStack.add(d.child1), null != d.child2 && this.treeStack.add(d.child2);
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
- if (d = this.treeStack.pop_unsafe(), d.aabb.intersect(a))
- if (null == d.child1) {
- 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, 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)
- } else null != d.child1 && this.treeStack.add(d.child1), null != d.child2 && this.treeStack.add(d.child2);
- this.failed.clear();
- return f
- },
- shapesInCircle: function (a, b, d, g, e, f) {
- this.sync_broadphase();
- this.updateCircShape(a, b, d);
- a = this.circShape.zpp_inner.aabb;
- f = null == f ? new h.shape.ShapeList : f;
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
- if (b = this.treeStack.pop_unsafe(), b.aabb.intersect(a))
- if (null == b.child1) {
- 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)
- } else null !=
- b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
- if (b = this.treeStack.pop_unsafe(), b.aabb.intersect(a))
- if (null == b.child1) {
- 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)
- } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
- return f
- },
- bodiesInAABB: function (a, b, d, g, e) {
- this.sync_broadphase();
- this.updateAABBShape(a);
- a = this.aabbShape.zpp_inner.aabb;
- e = null == e ? new h.phys.BodyList : e;
- null == this.failed && (this.failed = new h.phys.BodyList);
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
- var f = this.treeStack.pop_unsafe();
- if (a.contains(f.aabb))
- if (null == f.child1) {
- if (null == g || f.shape.filter.shouldCollide(g)) {
- var l = f.shape.body.outer;
- e.has(l) || e.push(l)
- }
- } else
- for (null == this.treeStack2 && (this.treeStack2 = new c.util.ZNPList_ZPP_AABBNode), this.treeStack2.add(f); null != this.treeStack2.head;)
- if (l = this.treeStack2.pop_unsafe(), null == l.child1) {
- if (null == g || l.shape.filter.shouldCollide(g)) l = l.shape.body.outer, e.has(l) || e.push(l)
- } else null != l.child1 && this.treeStack2.add(l.child1), null != l.child2 && this.treeStack2.add(l.child2);
- else if (f.aabb.intersect(a))
- if (null ==
- f.child1) {
- 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)
- } else null != f.child1 && this.treeStack.add(f.child1),
- null != f.child2 && this.treeStack.add(f.child2)
- }
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
- if (f = this.treeStack.pop_unsafe(), a.contains(f.aabb))
- if (null == f.child1) {
- if (null == g || f.shape.filter.shouldCollide(g)) l = f.shape.body.outer, e.has(l) || e.push(l)
- } else
- for (null == this.treeStack2 && (this.treeStack2 = new c.util.ZNPList_ZPP_AABBNode), this.treeStack2.add(f); null != this.treeStack2.head;)
- if (l =
- this.treeStack2.pop_unsafe(), null == l.child1) {
- if (null == g || l.shape.filter.shouldCollide(g)) l = l.shape.body.outer, e.has(l) || e.push(l)
- } else null != l.child1 && this.treeStack2.add(l.child1), null != l.child2 && this.treeStack2.add(l.child2);
- else if (f.aabb.intersect(a))
- if (null == f.child1) {
- 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)
- } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
- this.failed.clear();
- return e
- },
- shapesInAABB: function (a, b, d, g, e) {
- this.sync_broadphase();
- this.updateAABBShape(a);
- a = this.aabbShape.zpp_inner.aabb;
- e = null == e ? new h.shape.ShapeList :
- e;
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;) {
- var f = this.treeStack.pop_unsafe();
- if (a.contains(f.aabb))
- if (null == f.child1)(null == g || f.shape.filter.shouldCollide(g)) && e.push(f.shape.outer);
- else
- 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)) &&
- e.push(f.shape.outer) : (null != f.child1 && this.treeStack2.add(f.child1), null != f.child2 && this.treeStack2.add(f.child2));
- else if (f.aabb.intersect(a))
- if (null == f.child1) {
- 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)
- } else null !=
- f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2)
- }
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
- if (f = this.treeStack.pop_unsafe(), a.contains(f.aabb))
- if (null == f.child1)(null == g || f.shape.filter.shouldCollide(g)) && e.push(f.shape.outer);
- else
- 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)) && e.push(f.shape.outer) : (null != f.child1 && this.treeStack2.add(f.child1), null != f.child2 && this.treeStack2.add(f.child2));
- else if (f.aabb.intersect(a))
- if (null == f.child1) {
- 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)
- } else null != f.child1 && this.treeStack.add(f.child1), null != f.child2 && this.treeStack.add(f.child2);
- return e
- },
- bodiesUnderPoint: function (a, b, d, g) {
- this.sync_broadphase();
- a = c.geom.ZPP_Vec2.get(a, b, null);
- g = null == g ? new h.phys.BodyList : g;
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
- if (b = this.treeStack.pop_unsafe(), b.aabb.containsPoint(a))
- if (null ==
- b.child1) {
- var 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))
- } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null !=
- 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)));
- null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
- a._isimmutable =
- null;
- a._validate = null;
- a._invalidate = null;
- a.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = a;
- return g
- },
- shapesUnderPoint: function (a, b, d, g) {
- this.sync_broadphase();
- a = c.geom.ZPP_Vec2.get(a, b, null);
- g = null == g ? new h.shape.ShapeList : g;
- if (null != this.stree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.stree.root); null != this.treeStack.head;)
- if (b = this.treeStack.pop_unsafe(), b.aabb.containsPoint(a))
- if (null == b.child1) {
- 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)
- } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
- if (null != this.dtree.root)
- for (null == this.treeStack && (this.treeStack = new c.util.ZNPList_ZPP_AABBNode), this.treeStack.add(this.dtree.root); null != this.treeStack.head;)
- if (b = this.treeStack.pop_unsafe(), b.aabb.containsPoint(a))
- if (null ==
- b.child1) {
- 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)
- } else null != b.child1 && this.treeStack.add(b.child1), null != b.child2 && this.treeStack.add(b.child2);
- null != a.outer && (a.outer.zpp_inner = null, a.outer = null);
- a._isimmutable = null;
- a._validate = null;
- a._invalidate = null;
- a.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool =
- a;
- return g
- },
- clear: function () {
- for (; null != this.syncs;) {
- var a = this.syncs.snext;
- this.syncs.snext = null;
- this.syncs.first_sync && (this.syncs.shape.node = null, this.syncs.shape.removedFromSpace(), this.syncs.shape = null);
- this.syncs = a
- }
- 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;
- for (; null != this.pairs;) {
- a = this.pairs.next;
- null != this.pairs.arb && (this.pairs.arb.pair = null);
- this.pairs.arb =
- null;
- this.pairs.n1.shape.pairs.inlined_try_remove(this.pairs);
- this.pairs.n2.shape.pairs.inlined_try_remove(this.pairs);
- var b = this.pairs;
- b.n1 = b.n2 = null;
- b.sleeping = !1;
- b.next = c.space.ZPP_AABBPair.zpp_pool;
- c.space.ZPP_AABBPair.zpp_pool = b;
- this.pairs = a
- }
- this.dtree.clear();
- this.stree.clear()
- },
- broadphase: function (a, b) {
- for (var d = this.syncs; null != d;) {
- var g = d.shape;
- if (d.first_sync) d.first_sync = !1;
- else {
- var e = d.dyn ? this.dtree : this.stree;
- e.inlined_removeLeaf(d)
- }
- e = d.aabb;
- !a.continuous && g.zip_aabb && null != g.body &&
- (g.zip_aabb = !1, g.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? g.circle.__validate_aabb() : g.polygon.__validate_aabb());
- e.setExpand(g.aabb, 3);
- e = (d.dyn = g.body.type == c.util.ZPP_Flags.id_BodyType_STATIC ? !1 : !g.body.component.sleeping) ? this.dtree : this.stree;
- e.inlined_insertLeaf(d);
- d.synced = !1;
- d = d.snext
- }
- for (; null != this.syncs;)
- if (d = function (a) {
- var b = a.syncs;
- a.syncs = b.snext;
- b.snext = null;
- return b
- }(this), !d.moved && (d.moved = !1, e = d.shape, g = e.body, !g.component.sleeping)) {
- var f = d.aabb,
- l = null;
- null != this.dtree.root &&
- (this.dtree.root.next = l, l = this.dtree.root);
- for (; null != l;) {
- var h = function (a) {
- a = l;
- l = a.next;
- a.next = null;
- return a
- }(this);
- if (h != d)
- if (null == h.child1) {
- 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)) {
- var k, p;
- e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
- for (var n = e.pairs.length < g.pairs.length ? e : g, r = null, n = n.pairs.head; null != n;) {
- var q = n.elt;
- if (q.id == k && q.di == p) {
- r = q;
- break
- }
- n = n.next
- }
- 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))
- }
- } 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))
- }
- null != this.stree.root && (this.stree.root.next = l, l = this.stree.root);
- for (; null !=
- l;)
- if (h = function (a) {
- a = l;
- l = a.next;
- a.next = null;
- return a
- }(this), h != d)
- if (null == h.child1) {
- 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)) {
- e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
- n = e.pairs.length < g.pairs.length ? e : g;
- r = null;
- for (n = n.pairs.head; null != n;) {
- q = n.elt;
- if (q.id == k && q.di == p) {
- r = q;
- break
- }
- n = n.next
- }
- 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))
- }
- } 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))
- }
- for (; null != this.moves;)
- if (d = function (a) {
- var b = a.moves;
- a.moves = b.mnext;
- b.mnext = null;
- return b
- }(this), d.moved = !1, e = d.shape, g = e.body, !g.component.sleeping) {
- f =
- d.aabb;
- l = null;
- null != this.dtree.root && (this.dtree.root.next = l, l = this.dtree.root);
- for (; null != l;)
- if (h = function (a) {
- a = l;
- l = a.next;
- a.next = null;
- return a
- }(this), h != d)
- if (null == h.child1) {
- 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)) {
- e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
- n = e.pairs.length < g.pairs.length ? e : g;
- r = null;
- for (n = n.pairs.head; null != n;) {
- q = n.elt;
- if (q.id == k && q.di == p) {
- r = q;
- break
- }
- n = n.next
- }
- 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))
- }
- } 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));
- null != this.stree.root && (this.stree.root.next = l, l = this.stree.root);
- for (; null != l;)
- if (h = function (a) {
- a = l;
- l = a.next;
- a.next = null;
- return a
- }(this), h != d)
- if (null == h.child1) {
- 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)) {
- e.id < g.id ? (k = e.id, p = g.id) : (k = g.id, p = e.id);
- n = e.pairs.length < g.pairs.length ? e : g;
- r = null;
- for (n = n.pairs.head; null != n;) {
- q = n.elt;
- if (q.id == k && q.di == p) {
- r = q;
- break
- }
- n = n.next
- }
- 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))
- }
- } 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))
- }
- g = null;
- 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 &&
- 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 :
- 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)
- },
- sync_broadphase: function () {
- this.space.validation();
- if (null != this.syncs)
- if (null == this.moves) {
- for (var a = this.syncs; null != a;) {
- var b = a.shape;
- if (a.first_sync) a.first_sync = !1;
- else {
- var 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 = !0;
- a.mnext = a.snext;
- a.snext = null;
- a = a.mnext
- }
- a = this.syncs;
- this.syncs = this.moves;
- this.moves = a
- } else
- for (; null != this.syncs;) a = void 0,
- 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)
- },
- __sync: function (a) {
- var b = a.node;
- 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))
- },
- __remove: function (a) {
- var b = a.node;
- b.first_sync || (b.dyn ? this.dtree.removeLeaf(b) : this.stree.removeLeaf(b));
- a.node = null;
- if (b.synced) {
- for (var d = null, g = this.syncs; null != g && g != b;) d = g, g = g.snext;
- null == d ? this.syncs = g.snext : d.snext = g.snext;
- g.snext = null;
- b.synced = !1
- }
- if (b.moved) {
- d = null;
- for (g = this.moves; null != g && g != b;) d = g, g = g.mnext;
- null == d ? this.moves = g.mnext : d.mnext = g.mnext;
- g.mnext = null;
- b.moved = !1
- }
- d = null;
- for (g = this.pairs; null != g;) {
- var e = g.next;
- 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,
- g.next = c.space.ZPP_AABBPair.zpp_pool, c.space.ZPP_AABBPair.zpp_pool = g) : d = g;
- g = e
- }
- 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;
- g = b;
- g.free();
- g.next = c.space.ZPP_AABBNode.zpp_pool;
- c.space.ZPP_AABBNode.zpp_pool = g
- },
- __insert: function (a) {
- var b;
- null == c.space.ZPP_AABBNode.zpp_pool ? b = new c.space.ZPP_AABBNode :
- (b = c.space.ZPP_AABBNode.zpp_pool, c.space.ZPP_AABBNode.zpp_pool = b.next, b.next = null);
- 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);
- null;
- b.moved = !1;
- b.synced = !1;
- b.first_sync = !1;
- b.shape = a;
- a.node = b;
- b.synced = !0;
- b.first_sync = !0;
- b.snext = this.syncs;
- this.syncs = b
- },
- dyn: function (a) {
- return a.body.type == c.util.ZPP_Flags.id_BodyType_STATIC ? !1 : !a.body.component.sleeping
- },
- __class__: c.space.ZPP_DynAABBPhase
- });
- c.space.ZPP_Island =
- function () {
- this.waket = 0;
- this.sleep = !1;
- this.comps = null;
- this.length = 0;
- this._inuse = this.modified = this.pushmod = !1;
- this.next = null;
- this.comps = new c.util.ZNPList_ZPP_Component
- };
- s["zpp_nape.space.ZPP_Island"] = c.space.ZPP_Island;
- c.space.ZPP_Island.__name__ = ["zpp_nape", "space", "ZPP_Island"];
- c.space.ZPP_Island.prototype = {
- alloc: function () {
- this.waket = 0
- },
- free: function () {},
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a : null
- },
- iterator_at: function (a) {
- for (var b = this.next; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a =
- this.next, b = a; null != b;) a = b, b = b.next;
- return a
- },
- front: function () {
- return this.next
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.next; null != d;) {
- if (d == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.next
- },
- reverse: function () {
- for (var a = this.next, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.next = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {},
- clear: function () {},
- splice: function (a, b) {
- for (; 0 <
- b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- b._inuse = !1;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.next;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.next;
- this.next = a.next;
- a._inuse = !1;
- null == this.next && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- b._inuse = !0;
- null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
- this.pushmod = this.modified = !0;
- this.length++;
- return b
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.next; null != a;) this.add(a), a = a.next
- },
- inlined_add: function (a) {
- a._inuse = !0;
- a.next = this.next;
- this.next = a;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.next = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.next
- },
- elem: function () {
- return this
- },
- __class__: c.space.ZPP_Island
- };
- c.space.ZPP_Component = function () {
- this.woken = !1;
- this.waket = 0;
- this.sleeping = !1;
- this.body = this.constraint = this.island = null;
- this.isBody = !1;
- this.rank = 0;
- this.next = this.parent = null;
- this.sleeping = !1;
- this.island = null;
- this.parent = this;
- this.rank = 0;
- this.woken = !1
- };
- s["zpp_nape.space.ZPP_Component"] = c.space.ZPP_Component;
- c.space.ZPP_Component.__name__ = ["zpp_nape", "space", "ZPP_Component"];
- c.space.ZPP_Component.prototype = {
- reset: function () {
- this.sleeping = !1;
- this.island = null;
- this.parent =
- this;
- this.rank = 0
- },
- alloc: function () {},
- free: function () {
- this.constraint = this.body = null
- },
- __class__: c.space.ZPP_Component
- };
- c.space.ZPP_CallbackSet = function () {
- this.freed = this.lazydel = !1;
- this.length = 0;
- this._inuse = this.modified = this.pushmod = !1;
- this.int1 = this.int2 = this.next = null;
- this.id = this.di = 0;
- this.arbiters = new c.util.ZNPList_ZPP_Arbiter
- };
- s["zpp_nape.space.ZPP_CallbackSet"] = c.space.ZPP_CallbackSet;
- c.space.ZPP_CallbackSet.__name__ = ["zpp_nape", "space", "ZPP_CallbackSet"];
- c.space.ZPP_CallbackSet.get = function (a,
- b) {
- var d;
- 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);
- d.freed = !1;
- d.lazydel = !1;
- d.COLLISIONstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
- d.COLLISIONstamp = 0;
- d.SENSORstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
- d.SENSORstamp = 0;
- d.FLUIDstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
- d.FLUIDstamp = 0;
- a.id < b.id ? (d.int1 = a, d.int2 = b) : (d.int1 = b, d.int2 = a);
- d.id = d.int1.id;
- d.di = d.int2.id;
- return d
- };
- c.space.ZPP_CallbackSet.prototype = {
- sleeping: function () {
- var a;
- a = !0;
- for (var b = this.arbiters.head; null != b;)
- if (b.elt.sleeping) b = b.next;
- else {
- a = !1;
- break
- }
- return a
- },
- really_empty: function () {
- return null == this.arbiters.head
- },
- empty_arb: function (a) {
- var b;
- b = !0;
- for (var d = this.arbiters.head; null != d;)
- if (0 == (d.elt.type & a)) d = d.next;
- else {
- b = !1;
- break
- }
- return b
- },
- remove_arb: function (a) {
- this.arbiters.inlined_try_remove(a)
- },
- try_remove_arb: function (a) {
- return this.arbiters.inlined_try_remove(a)
- },
- add_arb: function (a) {
- if (this.arbiters.inlined_has(a)) return !1;
- this.arbiters.inlined_add(a);
- return !0
- },
- alloc: function () {
- this.lazydel = this.freed = !1;
- this.COLLISIONstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
- this.COLLISIONstamp = 0;
- this.SENSORstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
- this.SENSORstamp = 0;
- this.FLUIDstate = c.util.ZPP_Flags.id_PreFlag_ACCEPT;
- this.FLUIDstamp = 0
- },
- free: function () {
- this.int1 = this.int2 = null;
- this.id = this.di = -1;
- this.freed = !0
- },
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a : null
- },
- iterator_at: function (a) {
- for (var b = this.next; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a =
- this.next, b = a; null != b;) a = b, b = b.next;
- return a
- },
- front: function () {
- return this.next
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.next; null != d;) {
- if (d == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.next
- },
- reverse: function () {
- for (var a = this.next, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.next = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {},
- clear: function () {},
- splice: function (a, b) {
- for (; 0 <
- b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- b._inuse = !1;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.next, c = !1; null != d;) {
- if (d == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.next;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.next;
- this.next = a.next;
- a._inuse = !1;
- null == this.next && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- b._inuse = !0;
- null == a ? (b.next = this.next, this.next = b) : (b.next = a.next, a.next = b);
- this.pushmod = this.modified = !0;
- this.length++;
- return b
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.next; null != a;) this.add(a), a = a.next
- },
- inlined_add: function (a) {
- a._inuse = !0;
- a.next = this.next;
- this.next = a;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.next = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.next
- },
- elem: function () {
- return this
- },
- __class__: c.space.ZPP_CallbackSet
- };
- c.space.ZPP_CbSetManager = function (a) {
- this.cbsets = this.space = null;
- 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);
- null;
- this.cbsets.lt = c.callbacks.ZPP_CbSet.setlt;
- this.space = a
- };
- s["zpp_nape.space.ZPP_CbSetManager"] = c.space.ZPP_CbSetManager;
- c.space.ZPP_CbSetManager.__name__ = ["zpp_nape", "space", "ZPP_CbSetManager"];
- c.space.ZPP_CbSetManager.prototype = {
- valid_listener: function (a) {
- return a.space == this.space
- },
- pair: function (a, b) {
- for (var d = null, g = (a.cbpairs.length < b.cbpairs.length ? a.cbpairs : b.cbpairs).head; null != g;) {
- var e = g.elt;
- if (e.a == a && e.b == b || e.a == b && e.b == a) {
- d = e;
- break
- }
- g = g.next
- }
- null == d && (d = c.callbacks.ZPP_CbSetPair.get(a, b), a.cbpairs.add(d), b != a && b.cbpairs.add(d));
- d.zip_listeners && (d.zip_listeners = !1, d.__validate());
- return d
- },
- validate: function () {
- if (!this.cbsets.empty()) {
- for (var a = this.cbsets.parent; null != a.prev;) a = a.prev;
- for (; null != a;)
- if (a.data.validate(),
- null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- },
- clear: function () {},
- remove: function (a) {
- for (this.cbsets.remove(a); null != a.cbpairs.head;) {
- var b = a.cbpairs.pop_unsafe();
- b.a != b.b && (a == b.a ? b.b.cbpairs.remove(b) : b.a.cbpairs.remove(b));
- b.a = b.b = null;
- b.listeners.clear();
- b.next = c.callbacks.ZPP_CbSetPair.zpp_pool;
- c.callbacks.ZPP_CbSetPair.zpp_pool = b
- }
- a.manager = null
- },
- get: function (a) {
- if (null == a.head) return null;
- var b;
- 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);
- null;
- var d = b.cbTypes;
- b.cbTypes = a;
- var g = this.cbsets.find_weak(b);
- null != g ? a = g.data : (a = c.callbacks.ZPP_CbSet.get(a), this.cbsets.insert(a), a.manager = this);
- b.cbTypes = d;
- b.free();
- b.next = c.callbacks.ZPP_CbSet.zpp_pool;
- c.callbacks.ZPP_CbSet.zpp_pool = b;
- return a
- },
- __class__: c.space.ZPP_CbSetManager
- };
- c.space.ZPP_Space = function (a, b) {
- this.precb = this.prelisteners = null;
- this.continuous = !1;
- this.toiEvents =
- null;
- this.pre_dt = 0;
- 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;
- this.sortcontacts = !1;
- this.time = 0;
- this.midstep = !1;
- this.global_lin_drag = this.global_ang_drag = this.stamp = 0;
- this.wrap_gravity = this.bodies = this.wrap_bodies = this.compounds = this.wrap_compounds =
- this.constraints = this.wrap_constraints = this.kinematics = this.bphase = this.__static = null;
- this.gravityx = this.gravityy = 0;
- this.outer = this.userData = null;
- this.toiEvents = new c.util.ZNPList_ZPP_ToiEvent;
- this.global_ang_drag = this.global_lin_drag = 0.015;
- c.callbacks.ZPP_Callback.internal = !0;
- this.precb = new h.callbacks.PreCallback;
- this.precb.zpp_inner = new c.callbacks.ZPP_Callback;
- c.callbacks.ZPP_Callback.internal = !1;
- this.sortcontacts = !0;
- this.pre_dt = 0;
- var d;
- (d = null == b) || (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), d = b == c.util.ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE);
- 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)));
- this.time = 0;
- null != a ? (this.gravityx = a.x, this.gravityy = a.y) : this.gravityy = this.gravityx = 0;
- this.bodies = new c.util.ZNPList_ZPP_Body;
- this.wrap_bodies = c.util.ZPP_BodyList.get(this.bodies);
- this.wrap_bodies.zpp_inner.adder = A(this, this.bodies_adder);
- this.wrap_bodies.zpp_inner.subber = A(this, this.bodies_subber);
- this.wrap_bodies.zpp_inner._modifiable = A(this, this.bodies_modifiable);
- this.compounds = new c.util.ZNPList_ZPP_Compound;
- this.wrap_compounds = c.util.ZPP_CompoundList.get(this.compounds);
- this.wrap_compounds.zpp_inner.adder =
- A(this, this.compounds_adder);
- this.wrap_compounds.zpp_inner.subber = A(this, this.compounds_subber);
- this.wrap_compounds.zpp_inner._modifiable = A(this, this.compounds_modifiable);
- this.kinematics = new c.util.ZNPList_ZPP_Body;
- this.c_arbiters_true = new c.util.ZNPList_ZPP_ColArbiter;
- this.c_arbiters_false = new c.util.ZNPList_ZPP_ColArbiter;
- this.f_arbiters = new c.util.ZNPList_ZPP_FluidArbiter;
- this.s_arbiters = new c.util.ZNPList_ZPP_SensorArbiter;
- this.islands = new c.space.ZPP_Island;
- this.live = new c.util.ZNPList_ZPP_Body;
- this.wrap_live = c.util.ZPP_BodyList.get(this.live, !0);
- this.staticsleep = new c.util.ZNPList_ZPP_Body;
- this.constraints = new c.util.ZNPList_ZPP_Constraint;
- this.wrap_constraints = c.util.ZPP_ConstraintList.get(this.constraints);
- this.wrap_constraints.zpp_inner.adder = A(this, this.constraints_adder);
- this.wrap_constraints.zpp_inner.subber = A(this, this.constraints_subber);
- this.wrap_constraints.zpp_inner._modifiable = A(this, this.constraints_modifiable);
- this.live_constraints = new c.util.ZNPList_ZPP_Constraint;
- this.wrap_livecon =
- c.util.ZPP_ConstraintList.get(this.live_constraints, !0);
- this.__static = c.phys.ZPP_Body.__static();
- this.__static.zpp_inner.space = this;
- this.callbacks = new c.callbacks.ZPP_Callback;
- this.midstep = !1;
- this.listeners = new c.util.ZNPList_ZPP_Listener;
- this.wrap_listeners = c.util.ZPP_ListenerList.get(this.listeners);
- this.wrap_listeners.zpp_inner.adder = A(this, this.listeners_adder);
- this.wrap_listeners.zpp_inner.subber = A(this, this.listeners_subber);
- this.wrap_listeners.zpp_inner._modifiable = A(this, this.listeners_modifiable);
- this.callbackset_list = new c.space.ZPP_CallbackSet;
- this.mrca1 = new c.util.ZNPList_ZPP_Interactor;
- this.mrca2 = new c.util.ZNPList_ZPP_Interactor;
- this.prelisteners = new c.util.ZNPList_ZPP_InteractionListener;
- this.cbsets = new c.space.ZPP_CbSetManager(this)
- };
- s["zpp_nape.space.ZPP_Space"] = c.space.ZPP_Space;
- c.space.ZPP_Space.__name__ = ["zpp_nape", "space", "ZPP_Space"];
- c.space.ZPP_Space.prototype = {
- inlined_MRCA_chains: function (a, b) {
- this.mrca1.inlined_clear();
- this.mrca2.inlined_clear();
- null != a.cbSet && this.mrca1.inlined_add(a);
- null != a.body.cbSet && this.mrca1.inlined_add(a.body);
- null != b.cbSet && this.mrca2.inlined_add(b);
- null != b.body.cbSet && this.mrca2.inlined_add(b.body);
- 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)
- },
- MRCA_chains: function (a, b) {
- this.inlined_MRCA_chains(a, b)
- },
- narrowPhase: function (a, b, d, g, e) {
- var f = this,
- l = null,
- m = a.body,
- k = b.body,
- p = this.interactionType(a, b, m, k);
- if (-1 != p) {
- var n, q;
- 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);
- var s = n == b;
- if (0 == p) {
- g = null == g ? function (a) {
- a = null;
- for (var b = (m.arbiters.length < k.arbiters.length ? m : k).arbiters.head; null != b;) {
- var d = b.elt;
- if (d.id == n.id && d.di == q.id) {
- a = d;
- break
- }
- b = b.next
- }
- return a
- }(this) : g;
- var w = null == g,
- t, y = !1;
- 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) :
- 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;
- l = function (d) {
- var g = c.util.ZPP_Flags.id_InteractionType_FLUID;
- return w || t.stamp != d.stamp || e ? function (d) {
- t.stamp =
- d.stamp;
- return c.geom.ZPP_Collide.flowCollide(n, q, t) ? function (d) {
- 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;
- t.up_stamp = t.stamp;
- if (t.fresh || 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
- t.immState =
- c.util.ZPP_Flags.id_ImmState_ACCEPT;
- var l = !1;
- d.inlined_MRCA_chains(a, b);
- for (var m = d.mrca1.head; null != m;) {
- for (var k = m.elt, p = d.mrca2.head; null != p;) {
- var u = p.elt,
- s = k.cbSet,
- x = u.cbSet;
- if (null != s.manager.pair(s, x).listeners.head) {
- var A = null,
- D = null;
- d.prelisteners.inlined_clear();
- s.manager.pair(s, x).forall(c.util.ZPP_Flags.id_CbEvent_PRE, function (a) {
- return function (b) {
- 0 != (b.itype & g) && (a[0] = f.prelisteners.inlined_insert(a[0], b), l = l || !b.pure)
- }
- }([null]));
- if (null != d.prelisteners.head)
- 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.FLUIDstamp != d.stamp || e) && 0 == (A.FLUIDstate & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
- null != D && (A = D);
- if (null != A)
- 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;
- t.mutable = !0;
- null != t.wrap_position && (t.wrap_position.zpp_inner._immutable = !1);
- s = t.active;
- t.active = !0;
- d.precb.zpp_inner.pre_arbiter = t;
- d.precb.zpp_inner.set =
- A;
- for (u = d.prelisteners.head; null != u;) {
- x = u.elt;
- d.precb.zpp_inner.listener = x;
- c.phys.ZPP_Interactor.int_callback(A, x, d.precb.zpp_inner);
- d.precb.zpp_inner.pre_swapped = k != d.precb.zpp_inner.int1;
- D = x.handlerp(d.precb);
- if (null != D) {
- var x = t,
- E = D;
- 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);
- 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 && (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));
- x.immState = D
- }
- u = u.next
- }
- t.mutable = !1;
- null != t.wrap_position && (t.wrap_position.zpp_inner._immutable = !0);
- t.active = s;
- if (null != A)
- 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
- } 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
- }
- p = p.next
- }
- m = m.next
- }
- 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 && (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))))
- }
- 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))));
- t.sleeping && (t.sleeping = !1, d.f_arbiters.inlined_add(t));
- return t
- }(d) : w ? function (a) {
- a = t;
- a.next = c.dynamics.ZPP_FluidArbiter.zpp_pool;
- c.dynamics.ZPP_FluidArbiter.zpp_pool = a;
- return null
- }(d) : t
- }(d) : t
- }(this)
- } else if (1 == p) {
- var A = d ? this.c_arbiters_true : this.c_arbiters_false;
- g = null == g ? function (a) {
- a = null;
- for (var b = (m.arbiters.length < k.arbiters.length ? m : k).arbiters.head; null != b;) {
- var d = b.elt;
- if (d.id == n.id && d.di == q.id) {
- a = d;
- break
- }
- b = b.next
- }
- return a
- }(this) : g;
- w = null ==
- g;
- y = !1;
- 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 =
- 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))));
- l = function (d) {
- var g = c.util.ZPP_Flags.id_InteractionType_COLLISION;
- return w || t.stamp != d.stamp || e ? function (d) {
- t.stamp = d.stamp;
- return c.geom.ZPP_Collide.contactCollide(n, q, t, s) ? function (d) {
- 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.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 *
- 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;
- t.up_stamp = t.stamp;
- if (t.fresh || 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
- t.immState = c.util.ZPP_Flags.id_ImmState_ACCEPT;
- var l = !1;
- d.inlined_MRCA_chains(a, b);
- for (var m = d.mrca1.head; null !=
- m;) {
- for (var k = m.elt, p = d.mrca2.head; null != p;) {
- var u = p.elt,
- s = k.cbSet,
- x = u.cbSet;
- if (null != s.manager.pair(s, x).listeners.head) {
- var D = null,
- E = null;
- d.prelisteners.inlined_clear();
- s.manager.pair(s, x).forall(c.util.ZPP_Flags.id_CbEvent_PRE, function (a) {
- return function (b) {
- 0 != (b.itype & g) && (a[0] = f.prelisteners.inlined_insert(a[0], b), l = l || !b.pure)
- }
- }([null]));
- if (null != d.prelisteners.head)
- 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 !=
- d.stamp || e) && 0 == (D.COLLISIONstate & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
- null != E && (D = E);
- if (null != D)
- 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;
- t.mutable = !0;
- null != t.wrap_normal && (t.wrap_normal.zpp_inner._immutable = !1);
- null != t.wrap_contacts && (t.wrap_contacts.zpp_inner.immutable = !1);
- s = t.active;
- t.active = !0;
- t.cleanupContacts();
- d.precb.zpp_inner.pre_arbiter =
- t;
- d.precb.zpp_inner.set = D;
- for (u = d.prelisteners.head; null != u;) {
- x = u.elt;
- d.precb.zpp_inner.listener = x;
- c.phys.ZPP_Interactor.int_callback(D, x, d.precb.zpp_inner);
- d.precb.zpp_inner.pre_swapped = k != d.precb.zpp_inner.int1;
- E = x.handlerp(d.precb);
- if (null != E) {
- var x = t,
- F = E;
- 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);
- F == c.util.ZPP_Flags.PreFlag_ACCEPT ? E = c.util.ZPP_Flags.id_ImmState_ACCEPT | c.util.ZPP_Flags.id_ImmState_ALWAYS :
- (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 :
- c.util.ZPP_Flags.id_ImmState_IGNORE));
- x.immState = E
- }
- u = u.next
- }
- t.mutable = !1;
- null != t.wrap_normal && (t.wrap_normal.zpp_inner._immutable = !0);
- null != t.wrap_contacts && (t.wrap_contacts.zpp_inner.immutable = !0);
- t.active = s;
- if (null != D)
- 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
- } else null == D ? 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS) && (t.immState =
- c.util.ZPP_Flags.id_ImmState_ACCEPT) : t.immState = D.COLLISIONstate
- }
- p = p.next
- }
- m = m.next
- }
- 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 &&
- (m.kinematicDelaySleep = !0), m.component.sleeping && d.really_wake(m, !1))))
- }
- 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))));
- t.sleeping && (t.sleeping = !1, A.inlined_add(t));
- return t
- }(d) : w ? function (a) {
- a = t;
- a.userdef_dyn_fric = !1;
- a.userdef_stat_fric = !1;
- a.userdef_restitution = !1;
- a.userdef_rfric = !1;
- a.__ref_edge1 = a.__ref_edge2 = null;
- a.next = c.dynamics.ZPP_ColArbiter.zpp_pool;
- c.dynamics.ZPP_ColArbiter.zpp_pool = a;
- return null
- }(d) : t
- }(d) : t
- }(this)
- } else g = null == g ? function (a) {
- a = null;
- for (var b = (m.arbiters.length < k.arbiters.length ?
- m : k).arbiters.head; null != b;) {
- var d = b.elt;
- if (d.id == n.id && d.di == q.id) {
- a = d;
- break
- }
- b = b.next
- }
- return a
- }(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 ==
- 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) {
- var g = c.util.ZPP_Flags.id_InteractionType_SENSOR;
- return w || t.stamp != d.stamp || e ? function (d) {
- t.stamp = d.stamp;
- return c.geom.ZPP_Collide.testCollide(n, q) ? function (d) {
- 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, d.s_arbiters.inlined_add(t), t.fresh = !y) : t.fresh = t.up_stamp < d.stamp - 1 || t.endGenerated == d.stamp && e;
- t.up_stamp = t.stamp;
- if (t.fresh || 0 == (t.immState & c.util.ZPP_Flags.id_ImmState_ALWAYS)) {
- t.immState = c.util.ZPP_Flags.id_ImmState_ACCEPT;
- var l = !1;
- d.inlined_MRCA_chains(a, b);
- for (var m = d.mrca1.head; null != m;) {
- for (var k = m.elt, p = d.mrca2.head; null != p;) {
- var u = p.elt,
- s = k.cbSet,
- x = u.cbSet;
- if (null != s.manager.pair(s, x).listeners.head) {
- var A = null,
- D = null;
- d.prelisteners.inlined_clear();
- s.manager.pair(s, x).forall(c.util.ZPP_Flags.id_CbEvent_PRE, function (a) {
- return function (b) {
- 0 != (b.itype & g) && (a[0] = f.prelisteners.inlined_insert(a[0], b), l = l || !b.pure)
- }
- }([null]));
- if (null != d.prelisteners.head)
- 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)) {
- null != D && (A = D);
- if (null != A)
- 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) : A.SENSORstamp = d.stamp, u = u.next;
- s = t.active;
- t.active = !0;
- d.precb.zpp_inner.pre_arbiter = t;
- d.precb.zpp_inner.set = A;
- for (u = d.prelisteners.head; null != u;) {
- x = u.elt;
- d.precb.zpp_inner.listener = x;
- c.phys.ZPP_Interactor.int_callback(A, x, d.precb.zpp_inner);
- d.precb.zpp_inner.pre_swapped = k != d.precb.zpp_inner.int1;
- D = x.handlerp(d.precb);
- if (null != D) {
- var x = t,
- E = D;
- 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);
- 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 &&
- (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));
- x.immState = D
- }
- u = u.next
- }
- t.active = s;
- if (null != A)
- 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,
- u = u.next
- } 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
- }
- p = p.next
- }
- m = m.next
- }
- 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 =
- 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))))
- }
- t.sleeping && (t.sleeping = !1, d.s_arbiters.inlined_add(t));
- return t
- }(d) : w ? function (a) {
- a = t;
- a.next = c.dynamics.ZPP_SensorArbiter.zpp_pool;
- c.dynamics.ZPP_SensorArbiter.zpp_pool = a;
- return null
- }(d) : t
- }(d) : t
- }(this)
- }
- return l
- },
- interactionType: function (a, b, d, c) {
- var e;
- e = !1;
- for (var f = d.constraints.head; null != f;) {
- var h = f.elt;
- if (h.ignore && h.pair_exists(d.id,
- c.id)) {
- e = !0;
- break
- }
- f = f.next
- }
- 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
- },
- group_ignore: function (a, b) {
- var d = a.lookup_group();
- if (null == d) return !1;
- var c = b.lookup_group();
- if (null == c) return !1;
- for (var e = !1; null != d && null != c;) {
- if (d == c) {
- e =
- d.ignore;
- break
- }
- d.depth < c.depth ? c = c.group : d = d.group
- }
- return e
- },
- iteratePos: function (a) {
- for (var b = 0; b < a;) {
- b++;
- for (var d = null, g = this.live_constraints.head; null != g;) {
- var e = g.elt;
- !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)
- }
- d =
- this.c_arbiters_false.head;
- g = !0;
- null == d && (d = this.c_arbiters_true.head, g = !1);
- 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)
- }
- },
- iterateVel: function (a) {
- for (var b = 0; b < a;) {
- b++;
- for (var d = this.f_arbiters.head; null != d;) {
- var g = d.elt;
- g.active && 0 != (g.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && g.applyImpulseVel();
- d = d.next
- }
- g = null;
- for (d = this.live_constraints.head; null != d;) {
- var e = d.elt;
- e.applyImpulseVel() ?
- (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)
- }
- d = this.c_arbiters_false.head;
- e = !0;
- null == d && (d = this.c_arbiters_true.head, e = !1);
- 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,
- e = !1)
- }
- },
- warmStart: function () {
- for (var a = this.f_arbiters.head; null != a;) {
- var b = a.elt;
- b.active && 0 != (b.immState & c.util.ZPP_Flags.id_ImmState_ACCEPT) && b.warmStart();
- a = a.next
- }
- var a = this.c_arbiters_false.head,
- d = !0;
- null == a && (a = this.c_arbiters_true.head, d = !1);
- 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);
- for (a = this.live_constraints.head; null != a;) a.elt.warmStart(), a = a.next
- },
- prestep: function (a) {
- for (var b =
- null, d = this.live_constraints.head; null != d;) {
- var c = d.elt;
- 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)
- }
- var b = null,
- d = this.c_arbiters_true,
- c = d.head,
- e = null != this.c_arbiters_false;
- e && null == c && (e = !1, c = this.c_arbiters_false.head, d = this.c_arbiters_false, b =
- null);
- for (; null != c;) {
- var f = c.elt;
- this.presteparb(f, a) ? c = d.inlined_erase(b) : (b = c, c = c.next);
- e && null == c && (e = !1, c = this.c_arbiters_false.head, d = this.c_arbiters_false, b = null)
- }
- b = null;
- d = this.f_arbiters;
- c = d.head;
- e = !1;
- 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);
- b = null;
- d = this.s_arbiters;
- c = d.head;
- e = !1;
- 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)
- },
- presteparb: function (a,
- b, d) {
- null == d && (d = !1);
- var g = this;
- if (!a.cleared && a.b1.component.sleeping && a.b2.component.sleeping) return a.sleep_stamp = this.stamp, a.sleeping = !0;
- if (!a.cleared || 0 != a.present || a.intchange) {
- var e = !d && a.up_stamp == this.stamp - 1 && !a.cleared && !a.intchange;
- d = a.fresh && !a.cleared && !a.intchange;
- e && (a.endGenerated = this.stamp);
- if (d || e || a.cleared || a.intchange)
- for (this.inlined_MRCA_chains(a.ws1, a.ws2), e = this.mrca1.head; null != e;) {
- for (var f = e.elt, l = this.mrca2.head; null != l;) {
- var m = l.elt,
- k = f.cbSet,
- p = m.cbSet;
- if (null != k.manager.pair(k,
- p).listeners.head) {
- var n = [c.phys.ZPP_Interactor.get(f, m)];
- 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) {
- return function (d) {
- if (0 != (d.itype & a.type) && b[0].empty_arb(d.itype)) {
- var e = g.push_callback(d);
- e.event = c.util.ZPP_Flags.id_CbEvent_BEGIN;
- c.phys.ZPP_Interactor.int_callback(b[0], d, e);
- e.set = b[0]
- }
- }
- }(n)), n[0].arbiters.inlined_has(a) ? m = 0 : (n[0].arbiters.inlined_add(a), m = !0), m && a.present++) :
- (a.present--, n[0].remove_arb(a), k.manager.pair(k, p).forall(c.util.ZPP_Flags.id_CbEvent_END, function (b) {
- return function (d) {
- if (0 != (d.itype & a.type) && b[0].empty_arb(d.itype)) {
- var e = g.push_callback(d);
- e.event = c.util.ZPP_Flags.id_CbEvent_END;
- c.phys.ZPP_Interactor.int_callback(b[0], d, e);
- e.set = b[0]
- }
- }
- }(n)), null == n[0].arbiters.head && this.remove_callbackset(n[0]))
- }
- l = l.next
- }
- e = e.next
- }
- a.fresh = !1;
- a.intchange = !1
- }
- if (a.cleared || a.up_stamp + (a.type == c.dynamics.ZPP_Arbiter.COL ? h.Config.arbiterExpirationDelay : 0) < this.stamp) return a.type ==
- c.dynamics.ZPP_Arbiter.SENSOR ? a.sensorarb.retire() : a.type == c.dynamics.ZPP_Arbiter.FLUID ? a.fluidarb.retire() : a.colarb.retire(), !0;
- d = a.active;
- a.active = a.presentable = a.up_stamp == this.stamp;
- 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);
- d != a.active && (a.b1.arbiters.modified = !0, a.b2.arbiters.modified = !0, this.c_arbiters_true.modified =
- this.c_arbiters_false.modified = !0, this.s_arbiters.modified = this.f_arbiters.modified = !0);
- return !1
- },
- updatePos: function (a) {
- for (var b = 2 * Math.PI / a, d = this.live.head; null != d;) {
- var g = d.elt;
- g.pre_posx = g.posx;
- g.pre_posy = g.posy;
- g.pre_rot = g.rot;
- g.sweepTime = 0;
- g.sweep_angvel = g.angvel % b;
- g.sweepIntegrate(a);
- if (g.disableCCD) g.sweepFrozen = !0, g.bullet = !1;
- else {
- var e = h.Config.staticCCDLinearThreshold * g.sweepRadius,
- f = h.Config.staticCCDAngularThreshold;
- if ((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) {
- e = g.sweep_angvel;
- 0 > e && (e = -e);
- for (var f = 1 / e, l = g.shapes.head; null != l;) {
- var m = l.elt,
- k = m.aabb,
- n = k.minx,
- q = k.miny,
- r = k.maxx,
- s = k.maxy,
- w = e * a * m.sweepCoef * (1 / 120) | 0;
- 8 < w && (w = 8);
- var t = e * a / w;
- g.sweepIntegrate(a);
- m.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? m.circle._force_validate_aabb() : m.polygon._force_validate_aabb();
- n < k.minx ? k.minx = 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;
- for (var y = 1; y < w;) {
- var 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 = 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
- }
- this.bphase.sync(m);
- l = l.next
- }
- g.sweepFrozen = !1;
- 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)
- } else g.sweepFrozen = !0, g.bullet = !1
- }
- d = d.next
- }
- for (d = this.kinematics.head; null != d;) {
- g = d.elt;
- g.pre_posx = g.posx;
- g.pre_posy = g.posy;
- g.pre_rot = g.rot;
- g.sweepTime = 0;
- g.sweep_angvel = g.angvel % b;
- g.sweepIntegrate(a);
- if (g.disableCCD) g.sweepFrozen = !0, g.bullet = !1;
- 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) {
- e = g.sweep_angvel;
- 0 > e && (e = -e);
- f = 1 / e;
- for (l = g.shapes.head; null != l;) {
- m =
- l.elt;
- k = m.aabb;
- n = k.minx;
- q = k.miny;
- r = k.maxx;
- s = k.maxy;
- w = e * a * m.sweepCoef * (1 / 120) | 0;
- 8 < w && (w = 8);
- t = e * a / w;
- g.sweepIntegrate(a);
- m.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? m.circle._force_validate_aabb() : m.polygon._force_validate_aabb();
- n < k.minx ? k.minx = 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;
- 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 =
- 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;
- this.bphase.sync(m);
- l = l.next
- }
- g.sweepFrozen = !1;
- 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)
- } else g.sweepFrozen = !0, g.bullet = !1;
- d = d.next
- }
- },
- updateVel: function (a) {
- for (var b = 1 - a * this.global_lin_drag, d = 1 - a * this.global_ang_drag, c =
- this.live.head; null != c;) {
- var e = c.elt;
- if (0 != e.smass) {
- var f = a * e.imass;
- e.velx = b * e.velx + (e.forcex + this.gravityx * e.gravMass) * f;
- e.vely = b * e.vely + (e.forcey + this.gravityy * e.gravMass) * f
- }
- if (0 != e.sinertia) {
- var h = f = 0,
- f = e.worldCOMx - e.posx,
- h = e.worldCOMy - e.posy;
- e.angvel = d * e.angvel + (e.torque + (this.gravityy * f - this.gravityx * h) * e.gravMass) * a * e.iinertia
- }
- c = c.next
- }
- },
- validation: function () {
- this.cbsets.validate();
- for (var a = this.live.head; null != a;) {
- var b = a.elt;
- b.sweepRadius = 0;
- for (var d = b.shapes.head; null != d;) {
- var g = d.elt;
- if (g.type ==
- c.util.ZPP_Flags.id_ShapeType_POLYGON) {
- g.polygon.splice_collinear();
- var e = g.polygon.valid(),
- f = e;
- 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);
- if (f != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Cannot simulate with an invalid Polygon : " + g.polygon.outer.toString() + " is invalid : " + e.toString();
- g.polygon.validate_gaxi()
- }
- g.validate_sweepRadius();
- g.sweepRadius > b.sweepRadius &&
- (b.sweepRadius = g.sweepRadius);
- d = d.next
- }
- b.validate_mass();
- b.validate_inertia();
- null != b.shapes.head && (b.validate_aabb(), b.validate_worldCOM());
- b.validate_gravMass();
- b.zip_axis && (b.zip_axis = !1, b.axisx = Math.sin(b.rot), b.axisy = Math.cos(b.rot), null);
- 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";
- 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";
- if (b.component.woken && null != b.cbSet)
- 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;
- b.component.woken = !1;
- for (d = b.shapes.head; null != d;) b = d.elt, this.bphase.sync(b), d = d.next;
- a = a.next
- }
- for (a = this.kinematics.head; null != a;) {
- b = a.elt;
- b.sweepRadius = 0;
- for (d = b.shapes.head; null != d;) {
- g = d.elt;
- if (g.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
- g.polygon.splice_collinear();
- f = e = g.polygon.valid();
- 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);
- if (f != c.util.ZPP_Flags.ValidationResult_VALID) throw "Error: Cannot simulate with an invalid Polygon : " + g.polygon.outer.toString() + " is invalid : " + e.toString();
- g.polygon.validate_gaxi()
- }
- g.validate_sweepRadius();
- g.sweepRadius > b.sweepRadius && (b.sweepRadius = g.sweepRadius);
- d = d.next
- }
- b.validate_mass();
- b.validate_inertia();
- null != b.shapes.head &&
- (b.validate_aabb(), b.validate_worldCOM());
- b.validate_gravMass();
- b.zip_axis && (b.zip_axis = !1, b.axisx = Math.sin(b.rot), b.axisy = Math.cos(b.rot), null);
- 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";
- 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";
- for (d = b.shapes.head; null != d;) b =
- d.elt, this.bphase.sync(b), d = d.next;
- a = a.next
- }
- for (a = this.live_constraints.head; null != a;) {
- b = a.elt;
- if (b.active) {
- b.validate();
- if (b.component.woken && null != b.cbSet)
- 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;
- b.component.woken = !1
- }
- a = a.next
- }
- },
- static_validation: function (a) {
- null != a.shapes.head && a.validate_aabb();
- a.validate_mass();
- a.validate_inertia();
- if (0 != a.velx || 0 != a.vely ||
- 0 != a.angvel) throw "Error: Static body cannot have any real velocity, only kinematic or surface velocities";
- for (var b = a.shapes.head; null != b;) {
- var d = b.elt;
- if (d.type == c.util.ZPP_Flags.id_ShapeType_POLYGON) {
- d.polygon.splice_collinear();
- var g = d.polygon.valid(),
- e = g,
- f = void 0;
- 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);
- f = c.util.ZPP_Flags.ValidationResult_VALID;
- if (e != f) throw "Error: Cannot simulate with an invalid Polygon : " +
- d.polygon.outer.toString() + " is invalid : " + g.toString();
- d.polygon.validate_gaxi()
- }
- b = b.next
- }
- a.sweepFrozen = !0
- },
- sleepArbiters: function () {
- var a = null,
- b = this.c_arbiters_true,
- d = b.head,
- c = null != this.c_arbiters_false;
- c && null == d && (c = !1, d = this.c_arbiters_false.head, b = this.c_arbiters_false, a = null);
- for (; null != d;) {
- var 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 = this.c_arbiters_false.head, b = this.c_arbiters_false,
- a = null)
- }
- a = null;
- b = this.f_arbiters;
- d = b.head;
- c = !1;
- 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);
- a = null;
- b = this.s_arbiters;
- d = b.head;
- c = !1;
- 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)
- },
- doForests: function (a) {
- for (var b =
- this.c_arbiters_false.head; null != b;) {
- var d = b.elt;
- 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) {
- var g = d.b1.component == d.b1.component.parent ? d.b1.component : function (a) {
- a = d.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this),
- e = d.b2.component == d.b2.component.parent ? d.b2.component :
- function (a) {
- a = d.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(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
- }
- 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 ?
- d.b1.component : function (a) {
- a = d.b1.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(this), e = d.b2.component == d.b2.component.parent ? d.b2.component : function (a) {
- a = d.b2.component;
- for (var b = null; a != a.parent;) {
- var c = a.parent;
- a.parent = b;
- b = a;
- a = c
- }
- for (; null != b;) c = b.parent, b.parent = a, b = c;
- return a
- }(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;
- for (b = this.live_constraints.head; null != b;) g = b.elt,
- g.forest(), b = b.next;
- for (; null != this.live.head;) {
- var b = this.live.inlined_pop_unsafe(),
- f = b.component,
- g = f == f.parent ? f : function (a) {
- a = f;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this);
- 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);
- f.island = g.island;
- f.island.comps.inlined_add(f);
- b = b.atRest(a);
- f.island.sleep = f.island.sleep && b;
- f.waket > f.island.waket && (f.island.waket = f.waket)
- }
- for (; null != this.live_constraints.head;) b = this.live_constraints.inlined_pop_unsafe(), f = b.component, g = f == f.parent ? f : function (a) {
- a = f;
- for (var b = null; a != a.parent;) {
- var d = a.parent;
- a.parent = b;
- b = a;
- a = d
- }
- for (; null != b;) d = b.parent, b.parent = a, b = d;
- return a
- }(this), f.island = g.island, f.island.comps.inlined_add(f), f.waket > f.island.waket && (f.island.waket = f.waket);
- for (; null !=
- this.islands.next;)
- if (b = this.islands.inlined_pop_unsafe(), b.sleep)
- for (b = b.comps.head; null != b;) {
- a = b.elt;
- if (a.isBody) {
- g = a.body;
- g.velx = 0;
- g.vely = 0;
- g.angvel = 0;
- a.sleeping = !0;
- for (a = g.shapes.head; null != a;) this.bphase.sync(a.elt), a = a.next;
- this.bodyCbSleep(g)
- } else g = a.constraint, this.constraintCbSleep(g), a.sleeping = !0;
- b = b.next
- } else {
- 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 =
- null, a.parent = a, a.rank = 0;
- b.next = c.space.ZPP_Island.zpp_pool;
- c.space.ZPP_Island.zpp_pool = b
- }
- },
- wake_constraint: function (a, b) {
- null == b && (b = !1);
- 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
- },
- really_wake: function (a, b) {
- null == b && (b = !1);
- if (null == a.component.island) {
- a.component.sleeping = !1;
- 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);
- for (var d = a.constraints.head; null != d;) {
- var g = d.elt;
- g.space == this && this.wake_constraint(g);
- d = d.next
- }
- for (d = a.arbiters.head; null != d;) {
- g = d.elt;
- if (g.sleeping)
- if (g.sleeping = !1, g.up_stamp += this.stamp + (this.midstep ? 0 : 1) - g.sleep_stamp, g.type == c.dynamics.ZPP_Arbiter.COL) {
- var e = g.colarb;
- e.stat ? this.c_arbiters_true.inlined_add(e) : this.c_arbiters_false.inlined_add(e)
- } else g.type ==
- c.dynamics.ZPP_Arbiter.FLUID ? this.f_arbiters.inlined_add(g.fluidarb) : this.s_arbiters.inlined_add(g.sensorarb);
- 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))),
- 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))));
- d = d.next
- }
- b || a.type != c.util.ZPP_Flags.id_BodyType_DYNAMIC || this.bodyCbWake(a);
- if (!b && !this.bphase.is_sweep && a.type != c.util.ZPP_Flags.id_BodyType_STATIC)
- for (d = a.shapes.head; null != d;) g = d.elt, null != g.node && this.bphase.sync(g), d = d.next
- } else this.wakeIsland(a.component.island)
- },
- non_inlined_wake: function (a, b) {
- null == b && (b = !1);
- 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))
- },
- wakeIsland: function (a) {
- for (; null != a.comps.head;) {
- var b = a.comps.pop_unsafe();
- b.waket = this.stamp + (this.midstep ? 0 : 1);
- if (b.isBody) {
- var d = b.body;
- this.live.add(d);
- for (var g = d.arbiters.head; null != g;) {
- var e = g.elt;
- e.sleeping && (e.sleeping = !1, e.up_stamp += this.stamp - e.sleep_stamp, e.type ==
- 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));
- g = g.next
- }
- this.bodyCbWake(d);
- b.sleeping = !1;
- b.island = null;
- b.parent = b;
- b.rank = 0;
- if (d.type != c.util.ZPP_Flags.id_BodyType_STATIC)
- for (g = d.shapes.head; null != g;) b = g.elt, null != b.node && this.bphase.sync(b), g = g.next
- } else g = b.constraint, this.live_constraints.inlined_add(g), this.constraintCbWake(g),
- b.sleeping = !1, b.island = null, b.parent = b, b.rank = 0
- }
- a.next = c.space.ZPP_Island.zpp_pool;
- c.space.ZPP_Island.zpp_pool = a
- },
- wakeCompound: function (a) {
- for (var b = a.bodies.head; null != b;) {
- var 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
- }
- for (b = a.constraints.head; null != b;) d = b.elt, this.wake_constraint(d), b = b.next;
- for (b = a.compounds.head; null != b;) d = b.elt, this.wakeCompound(d),
- b = b.next
- },
- freshInteractorType: function (a, b) {
- null == b && (b = a);
- if (null != a.icompound) {
- for (var d = a.icompound, g = d.bodies.head; null != g;) this.freshInteractorType(g.elt, b), g = g.next;
- for (g = d.compounds.head; null != g;) this.freshInteractorType(g.elt, b), g = g.next
- } else
- for (d = null != a.ishape ? a.ishape : null, g = (null != a.ibody ? a.ibody : a.ishape.body).arbiters.head; null != g;) {
- var e = g.elt;
- if (e.presentable && (null == d || e.ws1 == d || e.ws2 == d)) {
- this.MRCA_chains(e.ws1, e.ws2);
- for (var f = this.mrca1.head; null != f;) {
- for (var h = f.elt, m = this.mrca2.head; null !=
- m;) {
- var k = m.elt;
- if (h == b || k == b) {
- var n = h.cbSet,
- q = k.cbSet;
- n.validate();
- q.validate();
- 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++)
- }
- m = m.next
- }
- f = f.next
- }
- }
- g = g.next
- }
- },
- freshListenerType: function (a, b) {
- for (var d = new c.util.ZNPList_ZPP_Interactor, g = a.interactors.head; null != g;) {
- var e = g.elt;
- d.add(e);
- g = g.next
- }
- if (a != b)
- for (g = b.interactors.head; null !=
- g;) e = g.elt, d.add(e), g = g.next;
- for (; null != d.head;)
- if (g = d.pop_unsafe(), null != g.icompound) {
- for (var f = g.icompound, g = f.bodies.head; null != g;) e = g.elt, d.add(e), g = g.next;
- for (g = f.compounds.head; null != g;) e = g.elt, d.add(e), g = g.next
- } else
- for (e = null != g.ishape ? g.ishape : null, g = (null != g.ibody ? g.ibody : g.ishape.body).arbiters.head; null != g;) {
- f = g.elt;
- if (f.presentable && (null == e || f.ws1 == e || f.ws2 == e)) {
- this.MRCA_chains(f.ws1, f.ws2);
- for (var h = this.mrca1.head; null != h;) {
- var m = h.elt;
- if (m.cbSet == a || m.cbSet == b)
- for (var k = this.mrca2.head; null !=
- k;) {
- var n = k.elt;
- if (!(m.cbSet == a && n.cbSet != b || m.cbSet == b && n.cbSet != a)) {
- var q = c.phys.ZPP_Interactor.get(m, n);
- null == q && (q = c.space.ZPP_CallbackSet.get(m, n), this.add_callbackset(q));
- q.arbiters.inlined_has(f) ? q = !1 : (n = void 0, q.arbiters.inlined_add(f), q = n = !0);
- q && f.present++
- }
- k = k.next
- }
- h = h.next
- }
- }
- g = g.next
- }
- },
- nullInteractorType: function (a, b) {
- null == b && (b = a);
- if (null != a.icompound) {
- for (var d = a.icompound, g = d.bodies.head; null != g;) this.nullInteractorType(g.elt, b), g = g.next;
- for (g = d.compounds.head; null != g;) this.nullInteractorType(g.elt,
- b), g = g.next
- } else
- for (d = null != a.ishape ? a.ishape : null, g = (null != a.ibody ? a.ibody : a.ishape.body).arbiters.head; null != g;) {
- var e = g.elt;
- if (0 != e.present && (null == d || e.ws1 == d || e.ws2 == d)) {
- this.MRCA_chains(e.ws1, e.ws2);
- for (var f = this.mrca1.head; null != f;) {
- for (var h = f.elt, m = this.mrca2.head; null != m;) {
- var k = m.elt;
- 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));
- m = m.next
- }
- f = f.next
- }
- }
- g = g.next
- }
- },
- nullListenerType: function (a, b) {
- for (var d =
- new c.util.ZNPList_ZPP_Interactor, g = a.interactors.head; null != g;) {
- var e = g.elt;
- d.add(e);
- g = g.next
- }
- if (a != b)
- for (g = b.interactors.head; null != g;) e = g.elt, d.add(e), g = g.next;
- for (; null != d.head;)
- if (g = d.pop_unsafe(), null != g.icompound) {
- for (var f = g.icompound, g = f.bodies.head; null != g;) e = g.elt, d.add(e), g = g.next;
- for (g = f.compounds.head; null != g;) e = g.elt, d.add(e), g = g.next
- } else
- for (e = null != g.ishape ? g.ishape : null, g = (null != g.ibody ? g.ibody : g.ishape.body).arbiters.head; null != g;) {
- f = g.elt;
- if (0 != f.present && (null == e || f.ws1 == e ||
- f.ws2 == e))
- for (this.MRCA_chains(f.ws1, f.ws2), f = this.mrca1.head; null != f;) {
- var h = f.elt;
- if (h.cbSet == a || h.cbSet == b)
- for (var m = this.mrca2.head; null != m;) {
- var k = m.elt;
- if (!(h.cbSet == a && k.cbSet != b || h.cbSet == b && k.cbSet != a) && (k = c.phys.ZPP_Interactor.get(h, k), null != k)) {
- for (; null != k.arbiters.head;) k.arbiters.pop_unsafe().present--;
- this.remove_callbackset(k)
- }
- m = m.next
- }
- f = f.next
- }
- g = g.next
- }
- },
- constraintCbBreak: function (a) {
- if (null != a.cbSet)
- for (var b = a.cbSet.conlisteners.head; null != b;) {
- var d = b.elt;
- d.event == c.util.ZPP_Flags.id_CbEvent_BREAK &&
- (d = this.push_callback(d), d.event = c.util.ZPP_Flags.id_CbEvent_BREAK, d.constraint = a);
- b = b.next
- }
- },
- constraintCbSleep: function (a) {
- if (null != a.cbSet)
- for (var b = a.cbSet.conlisteners.head; null != b;) {
- var d = b.elt;
- 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);
- b = b.next
- }
- },
- constraintCbWake: function (a) {
- if (null != a.cbSet)
- if (this.midstep)
- for (var b = a.cbSet.conlisteners.head; null != b;) {
- var d = b.elt;
- d.event == c.util.ZPP_Flags.id_CbEvent_WAKE && (d =
- this.push_callback(d), d.event = c.util.ZPP_Flags.id_CbEvent_WAKE, d.constraint = a);
- b = b.next
- } else a.component.woken = !0
- },
- bodyCbSleep: function (a) {
- if (a.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && null != a.cbSet)
- for (var b = a.cbSet.bodylisteners.head; null != b;) {
- var d = b.elt;
- 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);
- b = b.next
- }
- },
- bodyCbWake: function (a) {
- if (a.type == c.util.ZPP_Flags.id_BodyType_DYNAMIC && null != a.cbSet)
- if (this.midstep)
- for (var b =
- a.cbSet.bodylisteners.head; null != b;) {
- var d = b.elt;
- 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);
- b = b.next
- } else a.component.woken = !0
- },
- continuousEvent: function (a, b, d, g, e) {
- 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;
- var f = a.body,
- l = b.body;
- if (d || f.bullet || l.bullet) null == c.geom.ZPP_ToiEvent.zpp_pool ? e = new c.geom.ZPP_ToiEvent :
- (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 &&
- (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);
- return g
- },
- continuousCollisions: function (a) {
- var b = 2 * Math.PI / a;
- this.bphase.broadphase(this, !1);
- for (var d = 0; 1 > d && null != this.toiEvents.head;) {
- for (var g = null, e = 2, f = !1, l = null, m = null, d = this.toiEvents.head; null != d;) {
- var k = d.elt,
- n = k.s1.body,
- q = k.s2.body;
- if (n.sweepFrozen && q.sweepFrozen)
- if (0 != k.toi && c.geom.ZPP_Collide.testCollide_safe(k.s1, k.s2)) k.toi = 0;
- else {
- d = this.toiEvents.erase(m);
- n = k;
- n.next = c.geom.ZPP_ToiEvent.zpp_pool;
- c.geom.ZPP_ToiEvent.zpp_pool = n;
- continue
- }
- if (k.frozen1 != n.sweepFrozen || k.frozen2 != q.sweepFrozen)
- if (k.kinematic) {
- d = this.toiEvents.erase(m);
- n = k;
- n.next = c.geom.ZPP_ToiEvent.zpp_pool;
- c.geom.ZPP_ToiEvent.zpp_pool = n;
- continue
- } 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) {
- d = this.toiEvents.erase(m);
- n = k;
- n.next = c.geom.ZPP_ToiEvent.zpp_pool;
- c.geom.ZPP_ToiEvent.zpp_pool = n;
- continue
- }
- 0 <= k.toi && (k.toi < e || !f && k.kinematic) && (g = k, e = k.toi, f = k.kinematic, l = m);
- m = d;
- d = d.next
- }
- if (null == g) break;
- this.toiEvents.erase(l);
- d = g.toi;
- n = g.s1.body;
- q = g.s2.body;
- n.sweepFrozen ||
- (n.sweepIntegrate(d * a), n.sweepValidate(g.s1));
- q.sweepFrozen || (q.sweepIntegrate(d * a), q.sweepValidate(g.s2));
- e = this.narrowPhase(g.s1, g.s2, !0, g.arbiter, !0);
- 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(),
- n.sweep_angvel = n.angvel % b, q.sweep_angvel = q.angvel % b);
- 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 :
- q.sweep_angvel))
- }
- 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;
- for (d = this.kinematics.head; null != d;) b = d.elt, b.sweepIntegrate(a), b.sweepTime = 0, d = d.next;
- for (d = this.live.head; null != d;) b = d.elt, b.sweepFrozen || b.sweepIntegrate(a), b.sweepTime = 0, d = d.next
- },
- step: function (a, b, d) {
- var g = this;
- if (this.midstep) throw "Error: ... REALLY?? you're going to call space.step() inside of space.step()? COME ON!!";
- this.time += a;
- this.pre_dt = a;
- this.midstep = !0;
- this.stamp++;
- this.validation();
- this.bphase.broadphase(this, !0);
- this.prestep(a);
- if (this.sortcontacts) {
- var e = this.c_arbiters_false;
- if (null != e.head && null != e.head.next) {
- var f = e.head,
- h = null,
- m = null,
- k = null,
- n = null,
- q = 1,
- r, s, w;
- do {
- r = 0;
- m = f;
- for (h = f = null; null != m;) {
- r++;
- k = m;
- s = 0;
- for (w = q; null != k && s < q;) s++, k = k.next;
- 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 ?
- h.next = n : f = n, h = n;
- m = k
- }
- h.next = null;
- q <<= 1
- } while (1 < r);
- e.head = f;
- e.modified = !0;
- e.pushmod = !0
- }
- }
- this.updateVel(a);
- this.warmStart();
- this.iterateVel(b);
- 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;
- 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;
- this.updatePos(a);
- this.continuous = !0;
- this.continuousCollisions(a);
- this.continuous = !1;
- this.iteratePos(d);
- for (b = this.kinematics.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;
- 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;
- d = null;
- 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)) :
- (d = b, b = b.next);
- this.doForests(a);
- this.sleepArbiters();
- this.midstep = !1;
- a = null;
- 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) {
- return function (d) {
- if ((!a[0] || d.allowSleepingCallbacks) &&
- !b[0].empty_arb(d.itype)) {
- var e = g.push_callback(d);
- e.event = c.util.ZPP_Flags.id_CbEvent_ONGOING;
- c.phys.ZPP_Interactor.int_callback(b[0], d, e);
- e.set = b[0]
- }
- }
- }(a, d)), a = b, b = b.next);
- 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 &&
- (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
- },
- push_callback: function (a) {
- var b;
- 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);
- null;
- this.callbacks.push(b);
- b.listener =
- a;
- return b
- },
- convexMultiCast: function (a, b, d, g, e) {
- var f;
- 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);
- f.failed = !1;
- f.s1 = f.s2 = null;
- f.arbiter = null;
- a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.validate_worldCOM() : a.polygon.validate_gaxi();
- var l = a.body,
- m = l.posx,
- k = l.posy;
- l.sweepTime = 0;
- l.sweep_angvel = l.angvel;
- l.sweepIntegrate(b);
- var n = l.posx,
- q = l.posy;
- a.validate_sweepRadius();
- var r = a.sweepRadius,
- s;
- null ==
- 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);
- null;
- s.minx = (m < n ? m : n) - r;
- s.maxx = (m > n ? m : n) + r;
- s.miny = (k < q ? k : q) - r;
- s.maxy = (k > q ? k : q) + r;
- d = this.convexShapeList = this.bphase.shapesInAABB(s, !1, !1, null == d ? null : d.zpp_inner, this.convexShapeList);
- null != s.outer && (s.outer.zpp_inner = null, s.outer = null);
- s.wrap_min = s.wrap_max = null;
- s._invalidate = null;
- s._validate = null;
- s.next = c.geom.ZPP_AABB.zpp_pool;
- c.geom.ZPP_AABB.zpp_pool = s;
- e = null == e ? new h.geom.ConvexResultList :
- e;
- d.zpp_inner.valmod();
- for (s = h.shape.ShapeIterator.get(d); s.hasNext();)
- 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 !=
- 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)) {
- 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);
- k = null;
- for (n = e.zpp_inner.inner.head; null != n;) {
- q = n.elt;
- if (null != m.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- r = m.zpp_inner.toiDistance;
- if (null != q.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- if (r < q.zpp_inner.toiDistance) break;
- k = n;
- n = n.next
- }
- e.zpp_inner.inner.inlined_insert(k, m)
- }
- d.clear();
- s = f;
- s.next = c.geom.ZPP_ToiEvent.zpp_pool;
- c.geom.ZPP_ToiEvent.zpp_pool = s;
- l.sweepIntegrate(0);
- l.sweepValidate(a);
- return e
- },
- prepareCast: function (a) {
- a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.validate_worldCOM() : a.polygon.validate_gaxi()
- },
- convexCast: function (a, b, d, g) {
- var e;
- null == c.geom.ZPP_ToiEvent.zpp_pool ?
- e = new c.geom.ZPP_ToiEvent : (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;
- a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE ? a.circle.validate_worldCOM() : a.polygon.validate_gaxi();
- var f = a.body,
- l = f.posx,
- m = f.posy;
- f.sweepTime = 0;
- f.sweep_angvel = f.angvel;
- f.sweepIntegrate(b);
- var k = f.posx,
- n = f.posy;
- a.validate_sweepRadius();
- var q = a.sweepRadius,
- r;
- 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 =
- r.next, r.next = null);
- null;
- r.minx = (l < k ? l : k) - q;
- r.maxx = (l > k ? l : k) + q;
- r.miny = (m < n ? m : n) - q;
- r.maxy = (m > n ? m : n) + q;
- d = this.convexShapeList = this.bphase.shapesInAABB(r, !1, !1, null == d ? null : d.zpp_inner, this.convexShapeList);
- var s = r;
- null != s.outer && (s.outer.zpp_inner = null, s.outer = null);
- s.wrap_min = s.wrap_max = null;
- s._invalidate = null;
- s._validate = null;
- s.next = c.geom.ZPP_AABB.zpp_pool;
- c.geom.ZPP_AABB.zpp_pool = s;
- k = m = k = m = l = r = l = r = 0;
- n = null;
- q = b + 1;
- d.zpp_inner.valmod();
- for (s = h.shape.ShapeIterator.get(d); s.hasNext();) {
- var w = s.next();
- 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 ?
- 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))
- }
- d.clear();
- s = e;
- s.next = c.geom.ZPP_ToiEvent.zpp_pool;
- c.geom.ZPP_ToiEvent.zpp_pool = s;
- f.sweepIntegrate(0);
- f.sweepValidate(a);
- 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
- },
- rayMultiCast: function (a, b, d, c) {
- return this.bphase.rayMultiCast(a.zpp_inner,
- b, null == d ? null : d.zpp_inner, c)
- },
- rayCast: function (a, b, d) {
- return this.bphase.rayCast(a.zpp_inner, b, null == d ? null : d.zpp_inner)
- },
- bodiesInShape: function (a, b, d, c) {
- return this.bphase.bodiesInShape(a, b, d, c)
- },
- shapesInShape: function (a, b, d, c) {
- return this.bphase.shapesInShape(a, b, d, c)
- },
- bodiesInCircle: function (a, b, d, c, e) {
- return this.bphase.bodiesInCircle(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null !=
- a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), b, d, c, e)
- },
- shapesInCircle: function (a, b, d, c, e) {
- return this.bphase.shapesInCircle(function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.x
- }(this), function (b) {
- if (null != a && a.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- a.zpp_inner.validate();
- return a.zpp_inner.y
- }(this), b, d, c, e)
- },
- bodiesInAABB: function (a,
- b, d, c, e) {
- return this.bphase.bodiesInAABB(a.zpp_inner, b, d, c, e)
- },
- shapesInAABB: function (a, b, d, c, e) {
- return this.bphase.shapesInAABB(a.zpp_inner, b, d, c, e)
- },
- bodiesUnderPoint: function (a, b, d, c) {
- return this.bphase.bodiesUnderPoint(a, b, d, c)
- },
- shapesUnderPoint: function (a, b, d, c) {
- return this.bphase.shapesUnderPoint(a, b, d, c)
- },
- remBody: function (a, b) {
- null == b && (b = -1);
- if (a.type == c.util.ZPP_Flags.id_BodyType_STATIC) {
- var 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.staticsleep.remove(a)
- } 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 &&
- (d.kinematicDelaySleep = !0), d.component.sleeping && this.really_wake(d, !0)), this.staticsleep.remove(a));
- for (d = a.shapes.head; null != d;) this.removed_shape(d.elt, !0), d = d.next;
- a.removedFromSpace();
- a.space = null
- },
- addBody: function (a, b) {
- null == b && (b = -1);
- a.space = this;
- a.addedToSpace();
- a.component.sleeping = !0;
- 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));
- for (var d = a.shapes.head; null !=
- d;) this.added_shape(d.elt, !0), d = d.next;
- 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)
- },
- remCompound: function (a) {
- for (var b = a.bodies.head; null != b;) {
- var d = b.elt;
- this.remBody(d);
- b = b.next
- }
- for (b = a.constraints.head; null != b;) d = b.elt, this.remConstraint(d), b = b.next;
- for (b = a.compounds.head; null != b;) d = b.elt, this.remCompound(d), b = b.next;
- a.removedFromSpace();
- a.space = null
- },
- addCompound: function (a) {
- a.space =
- this;
- a.addedToSpace();
- for (var b = a.bodies.head; null != b;) {
- var d = b.elt;
- this.addBody(d);
- b = b.next
- }
- for (b = a.constraints.head; null != b;) d = b.elt, this.addConstraint(d), b = b.next;
- for (b = a.compounds.head; null != b;) d = b.elt, this.addCompound(d), b = b.next
- },
- remConstraint: function (a) {
- a.active && (this.wake_constraint(a, !0), this.live_constraints.remove(a));
- a.removedFromSpace();
- a.space = null
- },
- addConstraint: function (a) {
- a.space = this;
- a.addedToSpace();
- a.active && (a.component.sleeping = !0, this.wake_constraint(a, !0))
- },
- removed_shape: function (a,
- b) {
- null == b && (b = !1);
- var d = this,
- g = a.body;
- b || g.wake();
- for (var e = null, f = g.arbiters.head; null != f;) {
- var h = [f.elt];
- if (h[0].ws1 == a || h[0].ws2 == a) {
- if (0 != h[0].present)
- for (this.MRCA_chains(h[0].ws1, h[0].ws2), f = this.mrca1.head; null != f;) {
- for (var k = f.elt, n = this.mrca2.head; null != n;) {
- var p = n.elt,
- q = k.cbSet,
- r = p.cbSet;
- q.validate();
- r.validate();
- 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,
- b) {
- return function (e) {
- if (0 != (e.itype & b[0].type) && a[0].empty_arb(e.itype)) {
- var f = d.push_callback(e);
- f.event = c.util.ZPP_Flags.id_CbEvent_END;
- c.phys.ZPP_Interactor.int_callback(a[0], e, f);
- f.set = a[0]
- }
- }
- }(p, h)), null == p[0].arbiters.head && this.remove_callbackset(p[0]));
- n = n.next
- }
- f = f.next
- }
- 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 &&
- this.really_wake(f, !1)));
- 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)));
- h[0].cleared = !0;
- null != g && h[0].b2 != g || h[0].b1.arbiters.inlined_try_remove(h[0]);
- null != g && h[0].b1 != g || h[0].b2.arbiters.inlined_try_remove(h[0]);
- null != h[0].pair && (h[0].pair.arb = null, h[0].pair = null);
- h[0].active = !1;
- this.f_arbiters.modified = !0;
- f = g.arbiters.erase(e)
- } else e = f, f = f.next
- }
- this.bphase.remove(a);
- a.removedFromSpace()
- },
- added_shape: function (a, b) {
- null == b && (b = !1);
- if (!b) {
- var d = a.body;
- 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))
- }
- this.bphase.insert(a);
- a.addedToSpace()
- },
- transmitType: function (a, b) {
- var 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, !1));
- 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);
- a.type = b;
- a.type == c.util.ZPP_Flags.id_BodyType_KINEMATIC && this.kinematics.add(a);
- a.type == c.util.ZPP_Flags.id_BodyType_STATIC && this.static_validation(a);
- a.component.sleeping = !0;
- 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))
- },
- remove_callbackset: function (a) {
- a.lazydel = !0;
- a.int1.cbsets.inlined_try_remove(a);
- a.int2.cbsets.inlined_try_remove(a)
- },
- add_callbackset: function (a) {
- a.int1.cbsets.inlined_add(a);
- a.int2.cbsets.inlined_add(a);
- this.callbackset_list.inlined_add(a)
- },
- remListener: function (a) {
- null != a.interaction && null;
- a.removedFromSpace();
- a.space = null
- },
- addListener: function (a) {
- a.space =
- this;
- a.addedToSpace();
- null != a.interaction && null
- },
- unrevoke_listener: function (a) {},
- revoke_listener: function (a) {},
- listeners_modifiable: function () {
- if (this.midstep) throw "Error: Space::listeners cannot be set during space step()";
- },
- listeners_subber: function (a) {
- this.remListener(a.zpp_inner)
- },
- listeners_adder: function (a) {
- 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
- },
- constraints_modifiable: function () {
- if (this.midstep) throw "Error: Space::constraints cannot be set during space step()";
- },
- constraints_subber: function (a) {
- this.remConstraint(a.zpp_inner)
- },
- constraints_adder: function (a) {
- 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";
- 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
- },
- compounds_modifiable: function () {
- if (this.midstep) throw "Error: Space::compounds cannot be set during space step()";
- },
- compounds_subber: function (a) {
- this.remCompound(a.zpp_inner)
- },
- compounds_adder: function (a) {
- if (null != a.zpp_inner.compound) throw "Error: Cannot set the space of an inner Compound, only the root Compound space can be set";
- 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
- },
- bodies_modifiable: function () {
- if (this.midstep) throw "Error: Space::bodies cannot be set during space step()";
- },
- bodies_subber: function (a) {
- this.remBody(a.zpp_inner)
- },
- bodies_adder: function (a) {
- 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";
- 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
- },
- clear: function () {
- for (; null != this.listeners.head;) {
- var a = this.listeners.pop_unsafe();
- this.remListener(a)
- }
- for (; null != this.callbackset_list.next;) {
- a = this.callbackset_list.pop_unsafe();
- a.arbiters.clear();
- var b = a;
- b.int1 = b.int2 = null;
- b.id = b.di = -1;
- b.freed = !0;
- null;
- b.next = c.space.ZPP_CallbackSet.zpp_pool;
- c.space.ZPP_CallbackSet.zpp_pool = b
- }
- for (; null != this.c_arbiters_true.head;) a = this.c_arbiters_true.pop_unsafe(), a.retire();
- for (; null != this.c_arbiters_false.head;) a = this.c_arbiters_false.pop_unsafe(), a.retire();
- for (; null != this.s_arbiters.head;) a = this.s_arbiters.pop_unsafe(), a.retire();
- for (; null != this.f_arbiters.head;) a = this.f_arbiters.pop_unsafe(), a.retire();
- for (this.bphase.clear(); null != this.bodies.head;) {
- var d =
- this.bodies.pop_unsafe();
- if (null != d.component && (b = d.component.island, null != b)) {
- for (; null != b.comps.head;) a = b.comps.pop_unsafe(), a.sleeping = !1, a.island = null, a.parent = a, a.rank = 0;
- b.next = c.space.ZPP_Island.zpp_pool;
- c.space.ZPP_Island.zpp_pool = b
- }
- d.removedFromSpace();
- d.space = null
- }
- for (; null != this.constraints.head;) {
- a = this.constraints.pop_unsafe();
- if (null != a.component && (b = a.component.island, null != b)) {
- for (; null != b.comps.head;) d = b.comps.pop_unsafe(), d.sleeping = !1, d.island = null, d.parent = d, d.rank = 0;
- b.next = c.space.ZPP_Island.zpp_pool;
- c.space.ZPP_Island.zpp_pool = b
- }
- a.removedFromSpace();
- a.space = null
- }
- this.kinematics.clear();
- for (var g = new c.util.ZNPList_ZPP_Compound; null != this.compounds.head;) a = this.compounds.pop_unsafe(), g.add(a);
- for (; null != g.head;) {
- var e = g.pop_unsafe();
- e.removedFromSpace();
- e.space = null;
- for (var f = e.bodies.head; null != f;) {
- d = f.elt;
- if (null != d.component && (b = d.component.island, null != b)) {
- for (; null != b.comps.head;) a = b.comps.pop_unsafe(), a.sleeping = !1, a.island = null, a.parent = a, a.rank = 0;
- b.next = c.space.ZPP_Island.zpp_pool;
- c.space.ZPP_Island.zpp_pool =
- b
- }
- d.removedFromSpace();
- d.space = null;
- f = f.next
- }
- for (f = e.constraints.head; null != f;) {
- a = f.elt;
- if (null != a.component && (b = a.component.island, null != b)) {
- for (; null != b.comps.head;) d = b.comps.pop_unsafe(), d.sleeping = !1, d.island = null, d.parent = d, d.rank = 0;
- b.next = c.space.ZPP_Island.zpp_pool;
- c.space.ZPP_Island.zpp_pool = b
- }
- a.removedFromSpace();
- a.space = null;
- f = f.next
- }
- for (f = e.compounds.head; null != f;) b = f.elt, g.add(b), f = f.next
- }
- this.staticsleep.clear();
- this.live.clear();
- this.live_constraints.clear();
- this.time = this.stamp = 0;
- this.mrca1.clear();
- this.mrca2.clear();
- this.prelisteners.clear();
- this.cbsets.clear()
- },
- gravity_validate: function () {
- this.wrap_gravity.zpp_inner.x = this.gravityx;
- this.wrap_gravity.zpp_inner.y = this.gravityy
- },
- gravity_invalidate: function (a) {
- if (this.midstep) throw "Error: Space::gravity cannot be set during space step";
- this.gravityx = a.x;
- this.gravityy = a.y;
- a = new c.util.ZNPList_ZPP_Compound;
- for (var b = this.bodies.head; null != b;) {
- var 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
- }
- for (b = this.compounds.head; null != b;) {
- var g = b.elt;
- a.add(g);
- b = b.next
- }
- for (; null != a.head;) {
- g = a.pop_unsafe();
- 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;
- for (b = g.compounds.head; null != b;) g = b.elt, a.add(g), b = b.next
- }
- },
- getgravity: function () {
- this.wrap_gravity =
- h.geom.Vec2.get(this.gravityx, this.gravityy, null);
- this.wrap_gravity.zpp_inner._inuse = !0;
- this.wrap_gravity.zpp_inner._invalidate = A(this, this.gravity_invalidate);
- this.wrap_gravity.zpp_inner._validate = A(this, this.gravity_validate)
- },
- __class__: c.space.ZPP_Space
- };
- c.space.ZPP_SweepData = function () {
- this.next = this.prev = this.shape = this.aabb = null
- };
- s["zpp_nape.space.ZPP_SweepData"] = c.space.ZPP_SweepData;
- c.space.ZPP_SweepData.__name__ = ["zpp_nape", "space", "ZPP_SweepData"];
- c.space.ZPP_SweepData.prototype = {
- gt: function (a) {
- return this.aabb.minx >
- a.aabb.minx
- },
- alloc: function () {},
- free: function () {
- this.aabb = this.shape = this.prev = null
- },
- __class__: c.space.ZPP_SweepData
- };
- c.space.ZPP_SweepPhase = function (a) {
- this.list = this.failed = null;
- this.space = a;
- this.is_sweep = !0;
- this.sweep = this
- };
- s["zpp_nape.space.ZPP_SweepPhase"] = c.space.ZPP_SweepPhase;
- c.space.ZPP_SweepPhase.__name__ = ["zpp_nape", "space", "ZPP_SweepPhase"];
- c.space.ZPP_SweepPhase.__super__ = c.space.ZPP_Broadphase;
- c.space.ZPP_SweepPhase.prototype = I(c.space.ZPP_Broadphase.prototype, {
- rayMultiCast: function (a,
- b, d, g) {
- this.sync_broadphase();
- a.validate_dir();
- var e = a.rayAABB();
- g = null == g ? new h.geom.RayResultList : g;
- if (0 == a.dirx)
- for (var f = this.list; null != f && f.aabb.minx <= e.minx;) {
- if (f.aabb.intersect(e) && (null == d || f.shape.filter.shouldCollide(d))) {
- var 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
- } else if (0 > a.dirx) {
- f = this.list;
- for (l = null; null != f && f.aabb.minx <= e.maxx;) l = f, f = f.next;
- for (f = l; null != f;) 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.prev
- } else
- 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;
- null != e.outer && (e.outer.zpp_inner =
- null, e.outer = null);
- e.wrap_min = e.wrap_max = null;
- e._invalidate = null;
- e._validate = null;
- e.next = c.geom.ZPP_AABB.zpp_pool;
- c.geom.ZPP_AABB.zpp_pool = e;
- return g
- },
- rayCast: function (a, b, d) {
- this.sync_broadphase();
- a.validate_dir();
- var g = a.rayAABB(),
- e = a.maxdist,
- f = null;
- if (0 == a.dirx)
- for (var h = this.list; null != h && h.aabb.minx <= g.minx;) {
- if (h.aabb.intersect(g) && (null == d || h.shape.filter.shouldCollide(d))) {
- var k = a.aabbsect(h.aabb);
- if (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)) {
- if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- e = k.zpp_inner.toiDistance;
- if (null != f) {
- if (null != f.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- f.zpp_inner.free()
- }
- f = k
- }
- }
- h = h.next
- } else if (0 > a.dirx) {
- h = this.list;
- for (k = null; null != h && h.aabb.minx <= g.maxx;) k = h, h = h.next;
- for (h = k; null != h;) {
- if (h.aabb.intersect(g) && (null == 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))) {
- if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- e = k.zpp_inner.toiDistance;
- if (null != f) {
- if (null != f.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- f.zpp_inner.free()
- }
- f = k
- }
- h = h.prev
- }
- } else
- for (h = this.list; null != h && h.aabb.minx <= g.maxx && h.aabb.minx < a.originx + a.dirx * e;) {
- if (h.aabb.intersect(g) && (null ==
- 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))) {
- if (null != k.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- e = k.zpp_inner.toiDistance;
- if (null != f) {
- if (null != f.zpp_inner.next) throw "Error: This object has been disposed of and cannot be used";
- f.zpp_inner.free()
- }
- f = k
- }
- h = h.next
- }
- null != g.outer && (g.outer.zpp_inner = null, g.outer =
- null);
- g.wrap_min = g.wrap_max = null;
- g._invalidate = null;
- g._validate = null;
- g.next = c.geom.ZPP_AABB.zpp_pool;
- c.geom.ZPP_AABB.zpp_pool = g;
- return f
- },
- bodiesInShape: function (a, b, d, g) {
- this.sync_broadphase();
- this.validateShape(a);
- var e = a.aabb;
- g = null == g ? new h.phys.BodyList : g;
- null == this.failed && (this.failed = new h.phys.BodyList);
- for (var f = this.list; null != f && f.aabb.maxx < e.minx;) f = f.next;
- for (; null != f && f.aabb.minx <= e.maxx;) {
- if (f.aabb.intersect(e)) {
- var l = f.shape,
- k = l.body.outer;
- if (null == d || l.filter.shouldCollide(d)) b ? this.failed.has(k) ||
- (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)
- }
- f = f.next
- }
- this.failed.clear();
- return g
- },
- shapesInShape: function (a, b, d, g) {
- this.sync_broadphase();
- this.validateShape(a);
- var e = a.aabb;
- g = null == g ? new h.shape.ShapeList : g;
- for (var f = this.list; null != f && f.aabb.maxx < e.minx;) f = f.next;
- for (; null != f && f.aabb.minx <= e.maxx;) {
- if (f.aabb.intersect(e)) {
- var l = f.shape;
- if (null == d || l.filter.shouldCollide(d)) b ? c.geom.ZPP_Collide.containTest(a,
- l) && g.push(l.outer) : c.geom.ZPP_Collide.testCollide_safe(l, a) && g.push(l.outer)
- }
- f = f.next
- }
- return g
- },
- bodiesInCircle: function (a, b, d, g, e, f) {
- this.sync_broadphase();
- this.updateCircShape(a, b, d);
- a = this.circShape.zpp_inner.aabb;
- f = null == f ? new h.phys.BodyList : f;
- null == this.failed && (this.failed = new h.phys.BodyList);
- for (b = this.list; null != b && b.aabb.maxx < a.minx;) b = b.next;
- for (; null != b && b.aabb.minx <= a.maxx;) {
- if (b.aabb.intersect(a)) {
- var l = b.shape;
- d = l.body.outer;
- if (null == e || l.filter.shouldCollide(e)) g ? this.failed.has(d) ||
- (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)
- }
- b = b.next
- }
- this.failed.clear();
- return f
- },
- shapesInCircle: function (a, b, d, g, e, f) {
- this.sync_broadphase();
- this.updateCircShape(a, b, d);
- a = this.circShape.zpp_inner.aabb;
- f = null == f ? new h.shape.ShapeList : f;
- for (b = this.list; null != b && b.aabb.maxx < a.minx;) b = b.next;
- for (; null != b && b.aabb.minx <= a.maxx;) b.aabb.intersect(a) &&
- (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;
- return f
- },
- bodiesInAABB: function (a, b, d, g, e) {
- this.sync_broadphase();
- this.updateAABBShape(a);
- a = this.aabbShape.zpp_inner.aabb;
- e = null == e ? new h.phys.BodyList : e;
- null == this.failed && (this.failed = new h.phys.BodyList);
- for (var f = this.list; null != f && f.aabb.maxx < a.minx;) f = f.next;
- for (; null != f && f.aabb.minx <=
- a.maxx;) {
- var l = f.shape,
- k = l.body.outer;
- 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));
- f = f.next
- }
- this.failed.clear();
- return e
- },
- shapesInAABB: function (a, b, d, g, e) {
- this.sync_broadphase();
- this.updateAABBShape(a);
- a = this.aabbShape.zpp_inner.aabb;
- e = null == e ? new h.shape.ShapeList : e;
- for (var f = this.list; null != f && f.aabb.maxx < a.minx;) f = f.next;
- for (; null != f && f.aabb.minx <= a.maxx;) {
- var l = f.shape;
- 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) &&
- e.push(l.outer) : (d ? a.contains(f.aabb) : f.aabb.intersect(a)) && e.push(l.outer);
- f = f.next
- }
- return e
- },
- bodiesUnderPoint: function (a, b, d, g) {
- this.sync_broadphase();
- var e = c.geom.ZPP_Vec2.get(a, b, null);
- g = null == g ? new h.phys.BodyList : g;
- for (var f = this.list; null != f && f.aabb.minx > a;) f = f.next;
- for (; null != f && f.aabb.minx <= a;) {
- if (f.aabb.maxx >= a && f.aabb.miny <= b && f.aabb.maxy >= b) {
- var l = f.shape,
- k = l.body.outer;
- 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,
- e) && g.push(k) : c.geom.ZPP_Collide.polyContains(l.polygon, e) && g.push(k))
- }
- f = f.next
- }
- null != e.outer && (e.outer.zpp_inner = null, e.outer = null);
- e._isimmutable = null;
- e._validate = null;
- e._invalidate = null;
- e.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = e;
- return g
- },
- shapesUnderPoint: function (a, b, d, g) {
- this.sync_broadphase();
- var e = c.geom.ZPP_Vec2.get(a, b, null);
- g = null == g ? new h.shape.ShapeList : g;
- for (var f = this.list; null != f && f.aabb.minx > a;) f = f.next;
- for (; null != f && f.aabb.minx <= a;) {
- if (f.aabb.maxx >= a && f.aabb.miny <=
- b && f.aabb.maxy >= b) {
- var l = f.shape;
- 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)
- }
- f = f.next
- }
- null != e.outer && (e.outer.zpp_inner = null, e.outer = null);
- e._isimmutable = null;
- e._validate = null;
- e._invalidate = null;
- e.next = c.geom.ZPP_Vec2.zpp_pool;
- c.geom.ZPP_Vec2.zpp_pool = e;
- return g
- },
- clear: function () {
- for (; null != this.list;) this.list.shape.removedFromSpace(),
- this.__remove(this.list.shape)
- },
- broadphase: function (a, b) {
- if (null != this.list) {
- this.sync_broadphase_fast();
- for (var d = this.list; null != d;) {
- for (var g = d.next, e = d.shape, f = e.body, h = d.aabb.maxx; null != g && !(g.aabb.minx > h);) {
- var k = g.shape,
- n = k.body;
- 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,
- 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));
- g = g.next
- }
- d = d.next
- }
- }
- },
- sync_broadphase_fast: function () {
- for (var a = this.list.next; null != a;) {
- var b = a.next,
- d = a.prev;
- if (!(a.aabb.minx > d.aabb.minx)) {
- for (; null != d.prev && d.prev.aabb.minx > a.aabb.minx;) d = d.prev;
- var c = a.prev;
- c.next = a.next;
- null != a.next && (a.next.prev = c);
- 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)
- }
- a = b
- }
- },
- sync_broadphase: function () {
- this.space.validation();
- null != this.list && this.sync_broadphase_fast()
- },
- __sync: function (a) {
- !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())
- },
- __remove: function (a) {
- var b = a.sweep;
- null == b.prev ? this.list = b.next : b.prev.next = b.next;
- null != b.next && (b.next.prev = b.prev);
- a.sweep = null;
- b.prev = null;
- b.shape = null;
- b.aabb = null;
- b.next = c.space.ZPP_SweepData.zpp_pool;
- c.space.ZPP_SweepData.zpp_pool = b
- },
- __insert: function (a) {
- var b;
- null ==
- 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);
- null;
- a.sweep = b;
- b.shape = a;
- b.aabb = a.aabb;
- b.next = this.list;
- null != this.list && (this.list.prev = b);
- this.list = b
- },
- __class__: c.space.ZPP_SweepPhase
- });
- c.util.ZNPArray2_Float = function (a, b) {
- this.width = 0;
- this.list = null;
- this.width = a;
- this.list = []
- };
- s["zpp_nape.util.ZNPArray2_Float"] = c.util.ZNPArray2_Float;
- c.util.ZNPArray2_Float.__name__ = ["zpp_nape", "util", "ZNPArray2_Float"];
- c.util.ZNPArray2_Float.prototype = {
- set: function (a, b, d) {
- return this.list[b * this.width + a] = d
- },
- get: function (a, b) {
- return this.list[b * this.width + a]
- },
- resize: function (a, b, d) {
- this.width = a;
- var c = 0;
- for (a *= b; c < a;) b = c++, this.list[b] = d
- },
- __class__: c.util.ZNPArray2_Float
- };
- c.util.ZNPArray2_ZPP_GeomVert = function (a, b) {
- this.width = 0;
- this.list = null;
- this.width = a;
- this.list = []
- };
- s["zpp_nape.util.ZNPArray2_ZPP_GeomVert"] = c.util.ZNPArray2_ZPP_GeomVert;
- c.util.ZNPArray2_ZPP_GeomVert.__name__ = ["zpp_nape", "util", "ZNPArray2_ZPP_GeomVert"];
- c.util.ZNPArray2_ZPP_GeomVert.prototype = {
- set: function (a, b, d) {
- return this.list[b * this.width + a] = d
- },
- get: function (a, b) {
- return this.list[b * this.width + a]
- },
- resize: function (a, b, d) {
- this.width = a;
- var c = 0;
- for (a *= b; c < a;) b = c++, this.list[b] = d
- },
- __class__: c.util.ZNPArray2_ZPP_GeomVert
- };
- c.util.ZNPArray2_ZPP_MarchPair = function (a, b) {
- this.width = 0;
- this.list = null;
- this.width = a;
- this.list = []
- };
- s["zpp_nape.util.ZNPArray2_ZPP_MarchPair"] = c.util.ZNPArray2_ZPP_MarchPair;
- c.util.ZNPArray2_ZPP_MarchPair.__name__ = ["zpp_nape", "util",
- "ZNPArray2_ZPP_MarchPair"
- ];
- c.util.ZNPArray2_ZPP_MarchPair.prototype = {
- set: function (a, b, d) {
- return this.list[b * this.width + a] = d
- },
- get: function (a, b) {
- return this.list[b * this.width + a]
- },
- resize: function (a, b, d) {
- this.width = a;
- var c = 0;
- for (a *= b; c < a;) b = c++, this.list[b] = d
- },
- __class__: c.util.ZNPArray2_ZPP_MarchPair
- };
- c.util.ZPP_Debug = function (a, b) {
- this.viewport = this.iport = this.tmpab = null;
- this.xdet = this.width = this.height = 0;
- this.xnull = !1;
- this.xform = null;
- this.bg_r = this.bg_g = this.bg_b = this.bg_col = 0;
- this.d_shape = null;
- this.isbmp = !1;
- this.outer = null;
- this.xnull = !0;
- this.xdet = 1;
- this.width = a;
- this.height = b;
- this.viewport = c.geom.ZPP_AABB.get(0, 0, a, b);
- this.iport = c.geom.ZPP_AABB.get(0, 0, a, b);
- this.tmpab = new c.geom.ZPP_AABB
- };
- s["zpp_nape.util.ZPP_Debug"] = c.util.ZPP_Debug;
- c.util.ZPP_Debug.__name__ = ["zpp_nape", "util", "ZPP_Debug"];
- c.util.ZPP_Debug.prototype = {
- sup_setbg: function (a) {
- this.bg_r = a >> 16 & 255;
- this.bg_g = a >> 8 & 255;
- this.bg_b = a & 255;
- this.bg_col = a
- },
- cull: function (a) {
- if (this.xnull) return a.intersect(this.viewport);
- var b = 0,
- d = 0,
- c = 0,
- e = 0,
- c = a.minx,
- e = a.miny;
- this.tmpab.minx = this.xform.a * c + this.xform.b * e + this.xform.tx;
- this.tmpab.miny = this.xform.c * c + this.xform.d * e + this.xform.ty;
- this.tmpab.maxx = this.tmpab.minx;
- this.tmpab.maxy = this.tmpab.miny;
- c = a.maxx;
- b = this.xform.a * c + this.xform.b * e + this.xform.tx;
- d = this.xform.c * c + this.xform.d * e + this.xform.ty;
- this.tmpab.setExpandPoint(b, d);
- e = a.maxy;
- b = this.xform.a * c + this.xform.b * e + this.xform.tx;
- d = this.xform.c * c + this.xform.d * e + this.xform.ty;
- this.tmpab.setExpandPoint(b, d);
- c = a.minx;
- b = this.xform.a * c + this.xform.b * e + this.xform.tx;
- d = this.xform.c * c + this.xform.d * e + this.xform.ty;
- this.tmpab.setExpandPoint(b, d);
- return this.tmpab.intersect(this.viewport)
- },
- setform: function () {
- this.xform = (new h.geom.Mat23).zpp_inner;
- this.xform._invalidate = A(this, this.xform_invalidate)
- },
- xform_invalidate: function () {
- this.xdet = Math.sqrt(function (a) {
- a = a.xform.outer.get_determinant();
- return 0 > a ? -a : a
- }(this));
- 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;
- var a = this.xform.outer.inverse(),
- b =
- h.geom.Vec2.get(null, null, null),
- d = a.transform(b),
- c = this.iport;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.minx = d.zpp_inner.x;
- c = this.iport;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- c.miny = d.zpp_inner.y;
- this.iport.maxx = this.iport.minx;
- this.iport.maxy = this.iport.miny;
- d.dispose();
- b.set_x(this.width);
- d = a.transform(b);
- this.iport.setExpandPoint(function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.x
- }(this), function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.y
- }(this));
- d.dispose();
- b.set_y(this.height);
- d = a.transform(b);
- this.iport.setExpandPoint(function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.x
- }(this), function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.y
- }(this));
- d.dispose();
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.immutable();
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- 0 != b.zpp_inner.x && (b.zpp_inner.x = 0, b.zpp_inner.invalidate());
- if (null != b && b.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- b.zpp_inner.validate();
- b.zpp_inner.x;
- d = a.transform(b);
- this.iport.setExpandPoint(function (a) {
- if (null !=
- d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.x
- }(this), function (a) {
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- return d.zpp_inner.y
- }(this));
- d.dispose();
- b.dispose()
- },
- __class__: c.util.ZPP_Debug
- };
- c.util.ZPP_ShapeDebug = function (a, b) {
- this.outer_zn = this.shape = this.graphics = this.compoundstack = this.shapeList = this.bodyList = null;
- c.util.ZPP_Debug.call(this, a, b);
- this.shape = new k.display.Shape;
- this.shape.set_scrollRect(new k.geom.Rectangle(0, 0, a, b));
- this.graphics = this.shape.graphics;
- this.isbmp = !1;
- this.d_shape = this
- };
- s["zpp_nape.util.ZPP_ShapeDebug"] = c.util.ZPP_ShapeDebug;
- c.util.ZPP_ShapeDebug.__name__ = ["zpp_nape", "util", "ZPP_ShapeDebug"];
- c.util.ZPP_ShapeDebug.__super__ = c.util.ZPP_Debug;
- c.util.ZPP_ShapeDebug.prototype = I(c.util.ZPP_Debug.prototype, {
- draw_arbiter: function (a, b, d, g) {
- var e = 0,
- f = 0;
- if (a.outer.zpp_inner.type == c.dynamics.ZPP_Arbiter.SENSOR) {
- if (this.outer.drawSensorArbiters) {
- a = a.outer;
- this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
- a = ~a.bg_col;
- 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
- }(this), 1);
- if (g) {
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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()
- } else {
- d =
- b.a;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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();
- var h = b.b;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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;
- d = b.c;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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();
- h = b.d;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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
- }
- this.graphics.moveTo(e, f);
- if (g) {
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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()
- } else {
- g = b.a;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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();
- d = b.b;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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;
- g = b.c;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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();
- d = b.d;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- 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
- }
- this.graphics.lineTo(e, f)
- }
- } else if (a.outer.zpp_inner.type == c.dynamics.ZPP_Arbiter.FLUID) {
- if (this.outer.drawFluidArbiters) {
- a = a.outer.get_fluidArbiter();
- this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
- a = ~a.bg_col;
- 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
- }(this), 1);
- if (g) {
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
- e = a.zpp_inner.fluidarb.wrap_position.get_x();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
- f = a.zpp_inner.fluidarb.wrap_position.get_y()
- } else {
- g =
- b.a;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
- g *= a.zpp_inner.fluidarb.wrap_position.get_x();
- d = b.b;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
- e = g + d * a.zpp_inner.fluidarb.wrap_position.get_y() + b.tx;
- g = b.c;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.fluidarb.wrap_position &&
- a.zpp_inner.fluidarb.getposition();
- g *= a.zpp_inner.fluidarb.wrap_position.get_x();
- d = b.d;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.fluidarb.wrap_position && a.zpp_inner.fluidarb.getposition();
- f = g + d * a.zpp_inner.fluidarb.wrap_position.get_y() + b.ty
- }
- this.graphics.drawCircle(e, f, 0.75)
- }
- } else if (this.outer.drawCollisionArbiters) {
- a = a.outer.get_collisionArbiter();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_contacts &&
- a.zpp_inner.colarb.setupcontacts();
- if (!a.zpp_inner.colarb.wrap_contacts.empty()) {
- var k = 0;
- d = 0;
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
- if (2 == a.zpp_inner.colarb.wrap_contacts.get_length()) {
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
- h = a.zpp_inner.colarb.wrap_contacts.at(0).get_position();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
- d = a.zpp_inner.colarb.wrap_contacts.at(1).get_position();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_normal && a.zpp_inner.colarb.getnormal();
- var k = a.zpp_inner.colarb.wrap_normal,
- n = 0.661437828,
- p = 0.75;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e = k.zpp_inner.y;
- if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- e *= h.zpp_inner.x;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f = k.zpp_inner.x;
- if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- e -= f * h.zpp_inner.y;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f = k.zpp_inner.y;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- var f = f * d.zpp_inner.x,
- q;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- q = k.zpp_inner.x;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e < f - q * d.zpp_inner.y && (n = -n, p = -p);
- this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
- a = ~a.bg_col;
- 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
- }(this), 1);
- if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- e = h.zpp_inner.x;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e += k.zpp_inner.x * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e -= k.zpp_inner.y * n;
- if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- f = h.zpp_inner.y;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f += k.zpp_inner.y * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f += k.zpp_inner.x * n;
- g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
- this.graphics.moveTo(e, f);
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e = d.zpp_inner.x;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e += k.zpp_inner.x * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e += k.zpp_inner.y * n;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f = d.zpp_inner.y;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f += k.zpp_inner.y * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f -= k.zpp_inner.x * n;
- g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
- this.graphics.lineTo(e, f);
- this.graphics.lineStyle(this.outer_zn.thickness,
- function (a) {
- a = ~a.bg_col;
- 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
- }(this), 1);
- if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- e = h.zpp_inner.x;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e -= k.zpp_inner.x * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e -= k.zpp_inner.y * n;
- if (null !=
- h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- f = h.zpp_inner.y;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f -= k.zpp_inner.y * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f += k.zpp_inner.x * n;
- g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
- this.graphics.moveTo(e, f);
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- e = d.zpp_inner.x;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e -= k.zpp_inner.x * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- e += k.zpp_inner.y * n;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- f = d.zpp_inner.y;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- p = f - k.zpp_inner.y * p;
- if (null != k && k.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- k.zpp_inner.validate();
- f = p - k.zpp_inner.x * n;
- g || (q = b.a * e + b.b * f + b.tx, f = b.c * e + b.d * f + b.ty, e = q);
- this.graphics.lineTo(e, f);
- if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- k = h.zpp_inner.x;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- k = 0.5 * (k + d.zpp_inner.x);
- if (null != h && h.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- h.zpp_inner.validate();
- h = h.zpp_inner.y;
- if (null != d && d.zpp_disp) throw "Error: Vec2 has been disposed and cannot be used!";
- d.zpp_inner.validate();
- d = 0.5 * (h + d.zpp_inner.y);
- g || (q = b.a * k + b.b * d + b.tx, d = b.c * k + b.d * d + b.ty, k = q)
- } else {
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_contacts && a.zpp_inner.colarb.setupcontacts();
- k = a.zpp_inner.colarb.wrap_contacts.at(0).get_position().get_x();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_contacts &&
- a.zpp_inner.colarb.setupcontacts();
- d = a.zpp_inner.colarb.wrap_contacts.at(0).get_position().get_y();
- g || (q = b.a * k + b.b * d + b.tx, d = b.c * k + b.d * d + b.ty, k = q);
- this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
- a = ~a.bg_col;
- 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
- }(this), 1);
- this.graphics.drawCircle(k, d, 1)
- }
- this.graphics.lineStyle(this.outer_zn.thickness, function (a) {
- var b = ~a.bg_col;
- a = a.bg_col;
- return -16777216 | (0.7 * (b >> 16 & 255) + (a >> 16 & 255) * (1 - 0.7) |
- 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
- }(this), 1);
- this.graphics.moveTo(k, d);
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_normal && a.zpp_inner.colarb.getnormal();
- e = 5 * a.zpp_inner.colarb.wrap_normal.get_x();
- if (!a.zpp_inner.active) throw "Error: Arbiter not currently in use";
- null == a.zpp_inner.colarb.wrap_normal && a.zpp_inner.colarb.getnormal();
- f = 5 * a.zpp_inner.colarb.wrap_normal.get_y();
- g || (q = b.a * e + b.b * f, f = b.c * e + b.d * f,
- e = q);
- this.graphics.lineTo(k + e, d + f)
- }
- }
- },
- draw_shape: function (a, b, d, g) {
- var e = function (b) {
- b = null == b.outer.colour ? 16777215 * Math.exp(-(a.id % 500) / 1500) | 0 : b.outer.colour(a.id);
- return -16777216 | (0.7 * ((b & 16711680) >> 16) | 0) << 16 | (0.7 * ((b & 65280) >> 8) | 0) << 8 | 0.7 * (b & 255) | 0
- }(this),
- f = a.body;
- if (null != f) {
- var h = function (a) {
- var b;
- b = null == a.outer.colour ? 16777215 * Math.exp(-(f.id % 500) / 1500) | 0 : a.outer.colour(f.id);
- var d = 0.7 * ((b & 16711680) >> 16),
- c = 0.7 * ((b & 65280) >> 8);
- b = 0.7 * (b & 255);
- null != f.space && f.outer.get_isSleeping() && (d = 0.4 * d +
- 0.6 * a.bg_r, c = 0.4 * c + 0.6 * a.bg_g, b = 0.4 * b + 0.6 * a.bg_b);
- return -16777216 | (d | 0) << 16 | (c | 0) << 8 | b | 0
- }(this),
- e = function (a) {
- a = e;
- 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
- }(this);
- this.graphics.lineStyle(this.outer_zn.thickness, e, 1);
- if (a.type == c.util.ZPP_Flags.id_ShapeType_CIRCLE) {
- var k = a.circle;
- 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));
- var n = k.worldCOMx,
- p = k.worldCOMy;
- if (!g) var q = b.a * n + b.b * p + b.tx,
- p = b.c * n + b.d * p + b.ty,
- n = q;
- this.graphics.drawCircle(n, p, k.radius * d);
- this.outer.drawShapeAngleIndicators && (n = k.worldCOMx + 0.3 * k.radius * f.axisy, p = k.worldCOMy + 0.3 * k.radius *
- 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))
- } else {
- k = a.polygon;
- k.validate_gverts();
- q = k.gverts.next;
- 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.moveTo(n, p);
- d = n;
- 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;
- this.graphics.lineTo(d,
- r);
- 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,
- 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))
- }
- 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 *
- 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) {
- a = e;
- 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
- }(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 ?
- 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)))
- }
- },
- draw_body: function (a, b,
- d, c) {
- for (var e = a.shapes.head; null != e;) this.draw_shape(e.elt, b, d, c), e = e.next;
- if (this.outer.drawBodyDetail) {
- var f;
- f = null == this.outer.colour ? 16777215 * Math.exp(-(a.id % 500) / 1500) | 0 : this.outer.colour(a.id);
- d = 0.7 * ((f & 16711680) >> 16);
- e = 0.7 * ((f & 65280) >> 8);
- f = 0.7 * (f & 255);
- 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);
- d = -16777216 | (d | 0) << 16 | (e | 0) << 8 | f | 0;
- this.graphics.lineStyle(this.outer_zn.thickness, -16777216 | (0.8 * (d >> 16 & 255) + 255 * (1 - 0.8) | 0) << 16 | (0.8 *
- (d >> 8 & 255) + 0 * (1 - 0.8) | 0) << 8 | 0.8 * (d & 255) + 0 * (1 - 0.8) | 0, 1);
- var h = f = e = d = 0;
- if (null != a.shapes.head)
- 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());
- else {
- e = d = 0;
- d = b.a * a.aabb.minx + b.b * a.aabb.miny + b.tx;
- e = b.c * a.aabb.minx + b.d * a.aabb.miny + b.ty;
- f = a.aabb.width();
- var h = 0,
- k = b.a * f + b.b * h,
- h = b.c * f + b.d * h;
- f = k;
- var n = 0,
- p = a.aabb.height(),
- k = b.a * n + b.b * p,
- p = b.c * n + b.d * p,
- n = k;
- this.graphics.moveTo(d, e);
- this.graphics.lineTo(d + f, e + h);
- this.graphics.lineTo(d + f + n, e + h + p);
- this.graphics.lineTo(d + n, e + p);
- this.graphics.lineTo(d, e)
- }
- 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);
- 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);
- this.graphics.moveTo(f, h);
- this.graphics.lineTo(d, e);
- this.graphics.drawCircle(d, e, 1)
- }
- },
- draw_space: function (a,
- b, d, g) {
- if (this.outer.cullingEnabled) {
- if (this.outer.drawBodies)
- if (this.outer.drawBodyDetail)
- for (var e = this.bodyList = a.bphase.bodiesInAABB(this.iport, !1, !1, null, this.bodyList); null != e.zpp_inner.inner.head;) {
- var f = e.shift();
- f.debugDraw && this.draw_body(f.zpp_inner, b, d, g)
- } else
- 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)
- } else if (this.outer.drawBodies) {
- null ==
- this.compoundstack && (this.compoundstack = new c.util.ZNPList_ZPP_Compound);
- for (e = a.bodies.head; null != e;) f = e.elt, f.outer.debugDraw && this.draw_body(f, b, d, g), e = e.next;
- for (e = a.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next;
- for (; null != this.compoundstack.head;) {
- 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;
- for (e = h.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next
- }
- }
- if (this.outer.drawCollisionArbiters ||
- this.outer.drawFluidArbiters || this.outer.drawSensorArbiters)
- for (f = a.outer.get_arbiters().iterator(); f.hasNext();) e = f.next(), this.draw_arbiter(e.zpp_inner, b, d, g);
- if (this.outer.drawConstraints) {
- null == this.compoundstack && (this.compoundstack = new c.util.ZNPList_ZPP_Compound);
- for (e = a.constraints.head; null != e;) f = e.elt, f.active && f.outer.debugDraw && f.draw(this.outer), e = e.next;
- for (e = a.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next;
- for (; null != this.compoundstack.head;) {
- h = this.compoundstack.pop_unsafe();
- for (e = h.constraints.head; null != e;) f = e.elt, f.active && f.outer.debugDraw && f.draw(this.outer), e = e.next;
- for (e = h.compounds.head; null != e;) f = e.elt, this.compoundstack.add(f), e = e.next
- }
- }
- },
- draw_compound: function (a, b, d, c) {
- for (var e = a.compounds.head; null != e;) {
- var f = e.elt;
- this.draw_compound(f, b, d, c);
- e = e.next
- }
- for (e = a.bodies.head; null != e;) f = e.elt, f.outer.debugDraw && this.draw_body(f, b, d, c), e = e.next;
- for (e = a.constraints.head; null != e;) f = e.elt, f.active && f.outer.debugDraw && f.draw(this.outer), e = e.next
- },
- setbg: function (a) {
- this.sup_setbg(a)
- },
- __class__: c.util.ZPP_ShapeDebug
- });
- c.util.Hashable2_Boolfalse = function () {
- this.id = this.di = 0;
- this.next = this.hnext = null;
- this.value = !1
- };
- s["zpp_nape.util.Hashable2_Boolfalse"] = c.util.Hashable2_Boolfalse;
- c.util.Hashable2_Boolfalse.__name__ = ["zpp_nape", "util", "Hashable2_Boolfalse"];
- c.util.Hashable2_Boolfalse.get = function (a, b, d) {
- a = c.util.Hashable2_Boolfalse.getpersist(a, b);
- a.value = d;
- return a
- };
- c.util.Hashable2_Boolfalse.getpersist = function (a, b) {
- var d;
- null == c.util.Hashable2_Boolfalse.zpp_pool ? d = new c.util.Hashable2_Boolfalse :
- (d = c.util.Hashable2_Boolfalse.zpp_pool, c.util.Hashable2_Boolfalse.zpp_pool = d.next, d.next = null);
- null;
- d.id = a;
- d.di = b;
- return d
- };
- c.util.Hashable2_Boolfalse.ordered_get = function (a, b, d) {
- return a <= b ? c.util.Hashable2_Boolfalse.get(a, b, d) : c.util.Hashable2_Boolfalse.get(b, a, d)
- };
- c.util.Hashable2_Boolfalse.ordered_get_persist = function (a, b) {
- return a <= b ? c.util.Hashable2_Boolfalse.getpersist(a, b) : c.util.Hashable2_Boolfalse.getpersist(b, a)
- };
- c.util.Hashable2_Boolfalse.prototype = {
- alloc: function () {},
- free: function () {},
- __class__: c.util.Hashable2_Boolfalse
- };
- c.util.FastHash2_Hashable2_Boolfalse = function () {
- this.cnt = 0;
- this.table = null;
- this.cnt = 0;
- this.table = [];
- for (var a = 0; 1048576 > a;) a++, this.table.push(null)
- };
- s["zpp_nape.util.FastHash2_Hashable2_Boolfalse"] = c.util.FastHash2_Hashable2_Boolfalse;
- c.util.FastHash2_Hashable2_Boolfalse.__name__ = ["zpp_nape", "util", "FastHash2_Hashable2_Boolfalse"];
- c.util.FastHash2_Hashable2_Boolfalse.prototype = {
- hash: function (a, b) {
- return 106039 * a + b & 1048575
- },
- remove: function (a) {
- var b = 106039 * a.id +
- a.di & 1048575,
- d = this.table[b];
- if (d == a) this.table[b] = d.hnext;
- else if (null != d) {
- do b = d, d = d.hnext; while (null != d && d != a);
- b.hnext = d.hnext
- }
- a.hnext = null;
- this.cnt--
- },
- add: function (a) {
- var b = 106039 * a.id + a.di & 1048575,
- d = this.table[b];
- null == d ? (this.table[b] = a, a.hnext = null) : (a.hnext = d.hnext, d.hnext = a);
- this.cnt++
- },
- maybeAdd: function (a) {
- var b = 106039 * a.id + a.di & 1048575,
- d = this.table[b];
- null == d ? (this.table[b] = a, a.hnext = null) : (a.hnext = d.hnext, d.hnext = a);
- this.cnt++
- },
- has: function (a, b) {
- var d = this.table[106039 * a + b & 1048575];
- if (null ==
- d) return !1;
- if (d.id == a && d.di == b) return !0;
- do d = d.hnext; while (null != d && (d.id != a || d.di != b));
- return null != d
- },
- ordered_get: function (a, b) {
- if (a > b) {
- var d = a;
- a = b;
- b = d
- }
- return this.get(a, b)
- },
- get: function (a, b) {
- var d = this.table[106039 * a + b & 1048575];
- if (null == d) return null;
- if (d.id != a || d.di != b) {
- do d = d.hnext; while (null != d && (d.id != a || d.di != b))
- }
- return d
- },
- clear: function () {
- for (var a = 0, b = this.table.length; a < b;) {
- var d = a++,
- c = this.table[d];
- if (null != c) {
- for (; null != c;) {
- var e = c.hnext;
- c.hnext = null;
- c;
- c = e
- }
- this.table[d] = null
- }
- }
- },
- empty: function () {
- return 0 ==
- this.cnt
- },
- __class__: c.util.FastHash2_Hashable2_Boolfalse
- };
- c.util.ZNPList_ZPP_CallbackSet = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_CallbackSet"] = c.util.ZNPList_ZPP_CallbackSet;
- c.util.ZNPList_ZPP_CallbackSet.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CallbackSet"];
- c.util.ZNPList_ZPP_CallbackSet.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null !=
- this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CallbackSet.zpp_pool;
- c.util.ZNPNode_ZPP_CallbackSet.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CallbackSet.zpp_pool;
- c.util.ZNPNode_ZPP_CallbackSet.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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 =
- d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_CallbackSet
- };
- c.util.ZNPList_ZPP_Shape = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Shape"] = c.util.ZNPList_ZPP_Shape;
- c.util.ZNPList_ZPP_Shape.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Shape"];
- c.util.ZNPList_ZPP_Shape.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a =
- this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Shape.zpp_pool;
- c.util.ZNPNode_ZPP_Shape.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Shape.zpp_pool;
- c.util.ZNPNode_ZPP_Shape.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_ZPP_Shape.zpp_pool ? d = new c.util.ZNPNode_ZPP_Shape :
- (d = c.util.ZNPNode_ZPP_Shape.zpp_pool, c.util.ZNPNode_ZPP_Shape.zpp_pool = d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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 =
- b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Shape
- };
- c.util.ZNPList_ZPP_Body = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Body"] = c.util.ZNPList_ZPP_Body;
- c.util.ZNPList_ZPP_Body.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Body"];
- c.util.ZNPList_ZPP_Body.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null ==
- this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Body.zpp_pool;
- c.util.ZNPNode_ZPP_Body.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt ==
- a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Body.zpp_pool;
- c.util.ZNPNode_ZPP_Body.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_Body.zpp_pool ? b = new c.util.ZNPNode_ZPP_Body :
- (b = c.util.ZNPNode_ZPP_Body.zpp_pool, c.util.ZNPNode_ZPP_Body.zpp_pool = b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Body
- };
- c.util.ZNPList_ZPP_Compound = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Compound"] = c.util.ZNPList_ZPP_Compound;
- c.util.ZNPList_ZPP_Compound.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Compound"];
- c.util.ZNPList_ZPP_Compound.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Compound.zpp_pool;
- c.util.ZNPNode_ZPP_Compound.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Compound.zpp_pool;
- c.util.ZNPNode_ZPP_Compound.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt),
- a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Compound
- };
- c.util.ZNPList_ZPP_Arbiter =
- function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Arbiter"] = c.util.ZNPList_ZPP_Arbiter;
- c.util.ZNPList_ZPP_Arbiter.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Arbiter"];
- c.util.ZNPList_ZPP_Arbiter.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Arbiter.zpp_pool;
- c.util.ZNPNode_ZPP_Arbiter.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head,
- c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt =
- null;
- a.next = c.util.ZNPNode_ZPP_Arbiter.zpp_pool;
- c.util.ZNPNode_ZPP_Arbiter.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod =
- this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Arbiter
- };
- c.util.ZNPList_ZPP_CbSetPair = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_CbSetPair"] = c.util.ZNPList_ZPP_CbSetPair;
- c.util.ZNPList_ZPP_CbSetPair.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CbSetPair"];
- c.util.ZNPList_ZPP_CbSetPair.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null !=
- b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null !=
- this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CbSetPair.zpp_pool;
- c.util.ZNPNode_ZPP_CbSetPair.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CbSetPair.zpp_pool;
- c.util.ZNPNode_ZPP_CbSetPair.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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 =
- d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_CbSetPair
- };
- c.util.ZNPList_ZPP_CutInt = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_CutInt"] = c.util.ZNPList_ZPP_CutInt;
- c.util.ZNPList_ZPP_CutInt.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CutInt"];
- c.util.ZNPList_ZPP_CutInt.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a =
- this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CutInt.zpp_pool;
- c.util.ZNPNode_ZPP_CutInt.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d =
- d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CutInt.zpp_pool;
- c.util.ZNPNode_ZPP_CutInt.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_ZPP_CutInt.zpp_pool ?
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_CutInt.zpp_pool ? b = new c.util.ZNPNode_ZPP_CutInt : (b = c.util.ZNPNode_ZPP_CutInt.zpp_pool,
- c.util.ZNPNode_ZPP_CutInt.zpp_pool = b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_CutInt
- };
- c.util.ZNPList_ZPP_CutVert = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_CutVert"] = c.util.ZNPList_ZPP_CutVert;
- c.util.ZNPList_ZPP_CutVert.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_CutVert"];
- c.util.ZNPList_ZPP_CutVert.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CutVert.zpp_pool;
- c.util.ZNPNode_ZPP_CutVert.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head,
- c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_CutVert.zpp_pool;
- c.util.ZNPNode_ZPP_CutVert.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a,
- b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_CutVert.zpp_pool ?
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_CutVert
- };
- c.util.ZNPList_ZPP_PartitionVertex = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_PartitionVertex"] =
- c.util.ZNPList_ZPP_PartitionVertex;
- c.util.ZNPList_ZPP_PartitionVertex.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_PartitionVertex"];
- c.util.ZNPList_ZPP_PartitionVertex.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt ==
- a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool;
- c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b =
- d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool;
- c.util.ZNPNode_ZPP_PartitionVertex.zpp_pool =
- a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a,
- b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_PartitionVertex
- };
- c.util.ZNPList_ZPP_PartitionedPoly = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_PartitionedPoly"] = c.util.ZNPList_ZPP_PartitionedPoly;
- c.util.ZNPList_ZPP_PartitionedPoly.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_PartitionedPoly"];
- c.util.ZNPList_ZPP_PartitionedPoly.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null !=
- this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool;
- c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool;
- c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool ? d = new c.util.ZNPNode_ZPP_PartitionedPoly : (d = c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool,
- c.util.ZNPNode_ZPP_PartitionedPoly.zpp_pool = d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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 =
- b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_PartitionedPoly
- };
- c.util.ZNPList_ZPP_GeomVert = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_GeomVert"] = c.util.ZNPList_ZPP_GeomVert;
- c.util.ZNPList_ZPP_GeomVert.__name__ = ["zpp_nape",
- "util", "ZNPList_ZPP_GeomVert"
- ];
- c.util.ZNPList_ZPP_GeomVert.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_GeomVert.zpp_pool;
- c.util.ZNPNode_ZPP_GeomVert.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d =
- this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_GeomVert.zpp_pool;
- c.util.ZNPNode_ZPP_GeomVert.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_GeomVert.zpp_pool ?
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_GeomVert
- };
- c.util.ZNPList_ZPP_SimplifyP = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_SimplifyP"] =
- c.util.ZNPList_ZPP_SimplifyP;
- c.util.ZNPList_ZPP_SimplifyP.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SimplifyP"];
- c.util.ZNPList_ZPP_SimplifyP.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b,
- d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SimplifyP.zpp_pool;
- c.util.ZNPNode_ZPP_SimplifyP.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SimplifyP.zpp_pool;
- c.util.ZNPNode_ZPP_SimplifyP.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt),
- a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_SimplifyP
- };
- c.util.ZNPList_ZPP_SimpleVert =
- function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_SimpleVert"] = c.util.ZNPList_ZPP_SimpleVert;
- c.util.ZNPList_ZPP_SimpleVert.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SimpleVert"];
- c.util.ZNPList_ZPP_SimpleVert.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next = b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SimpleVert.zpp_pool;
- c.util.ZNPNode_ZPP_SimpleVert.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d =
- this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SimpleVert.zpp_pool;
- c.util.ZNPNode_ZPP_SimpleVert.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod =
- this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_SimpleVert
- };
- c.util.ZNPList_ZPP_SimpleEvent = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_SimpleEvent"] = c.util.ZNPList_ZPP_SimpleEvent;
- c.util.ZNPList_ZPP_SimpleEvent.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SimpleEvent"];
- c.util.ZNPList_ZPP_SimpleEvent.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt :
- null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var d = this.head; null != d;) {
- if (d.elt == a) {
- b = !0;
- break
- }
- d = d.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var d = a.next;
- a.next =
- b;
- b = this.head = a;
- a = d
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool;
- c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, d = this.head, c = !1; null != d;) {
- if (d.elt == a) {
- this.inlined_erase(b);
- c = !0;
- break
- }
- b = d;
- d = d.next
- }
- return c
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool;
- c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool ? d = new c.util.ZNPNode_ZPP_SimpleEvent :
- (d = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool, c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool ? b = new c.util.ZNPNode_ZPP_SimpleEvent : (b = c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool,
- c.util.ZNPNode_ZPP_SimpleEvent.zpp_pool = b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_SimpleEvent
- };
- c.util.ZNPList_ZPP_AABBPair = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_AABBPair"] = c.util.ZNPList_ZPP_AABBPair;
- c.util.ZNPList_ZPP_AABBPair.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_AABBPair"];
- c.util.ZNPList_ZPP_AABBPair.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_AABBPair.zpp_pool;
- c.util.ZNPNode_ZPP_AABBPair.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c =
- this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_AABBPair.zpp_pool;
- c.util.ZNPNode_ZPP_AABBPair.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_AABBPair.zpp_pool ?
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_AABBPair
- };
- c.util.ZNPList_ZPP_Edge = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Edge"] =
- c.util.ZNPList_ZPP_Edge;
- c.util.ZNPList_ZPP_Edge.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Edge"];
- c.util.ZNPList_ZPP_Edge.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Edge.zpp_pool;
- c.util.ZNPNode_ZPP_Edge.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b =
- null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Edge.zpp_pool;
- c.util.ZNPNode_ZPP_Edge.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_Edge.zpp_pool ?
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Edge
- };
- c.util.ZNPList_ZPP_Component = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Component"] =
- c.util.ZNPList_ZPP_Component;
- c.util.ZNPList_ZPP_Component.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Component"];
- c.util.ZNPList_ZPP_Component.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b,
- d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Component.zpp_pool;
- c.util.ZNPNode_ZPP_Component.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Component.zpp_pool;
- c.util.ZNPNode_ZPP_Component.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt),
- a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Component
- };
- c.util.ZNPList_ZPP_AABBNode =
- function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_AABBNode"] = c.util.ZNPList_ZPP_AABBNode;
- c.util.ZNPList_ZPP_AABBNode.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_AABBNode"];
- c.util.ZNPList_ZPP_AABBNode.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_AABBNode.zpp_pool;
- c.util.ZNPNode_ZPP_AABBNode.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head,
- g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt =
- null;
- a.next = c.util.ZNPNode_ZPP_AABBNode.zpp_pool;
- c.util.ZNPNode_ZPP_AABBNode.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head =
- a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_AABBNode
- };
- c.util.ZNPList_ZPP_InteractionGroup = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_InteractionGroup"] = c.util.ZNPList_ZPP_InteractionGroup;
- c.util.ZNPList_ZPP_InteractionGroup.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_InteractionGroup"];
- c.util.ZNPList_ZPP_InteractionGroup.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool;
- c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool;
- c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool ? d = new c.util.ZNPNode_ZPP_InteractionGroup :
- (d = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool, c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null == c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool ? b = new c.util.ZNPNode_ZPP_InteractionGroup : (b = c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool,
- c.util.ZNPNode_ZPP_InteractionGroup.zpp_pool = b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_InteractionGroup
- };
- c.util.ZNPList_ZPP_FluidArbiter = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_FluidArbiter"] = c.util.ZNPList_ZPP_FluidArbiter;
- c.util.ZNPList_ZPP_FluidArbiter.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_FluidArbiter"];
- c.util.ZNPList_ZPP_FluidArbiter.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool;
- c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool;
- c.util.ZNPNode_ZPP_FluidArbiter.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null !=
- a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_FluidArbiter
- };
- c.util.ZNPList_ZPP_SensorArbiter = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_SensorArbiter"] = c.util.ZNPList_ZPP_SensorArbiter;
- c.util.ZNPList_ZPP_SensorArbiter.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_SensorArbiter"];
- c.util.ZNPList_ZPP_SensorArbiter.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null !=
- b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool;
- c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a =
- this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool;
- c.util.ZNPNode_ZPP_SensorArbiter.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head,
- this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_SensorArbiter
- };
- c.util.ZNPList_ZPP_Listener = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_Listener"] = c.util.ZNPList_ZPP_Listener;
- c.util.ZNPList_ZPP_Listener.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_Listener"];
- c.util.ZNPList_ZPP_Listener.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null !=
- a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Listener.zpp_pool;
- c.util.ZNPNode_ZPP_Listener.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_Listener.zpp_pool;
- c.util.ZNPNode_ZPP_Listener.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_ZPP_Listener.zpp_pool ? d = new c.util.ZNPNode_ZPP_Listener : (d = c.util.ZNPNode_ZPP_Listener.zpp_pool,
- c.util.ZNPNode_ZPP_Listener.zpp_pool = d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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 =
- null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_Listener
- };
- c.util.ZNPList_ZPP_ColArbiter = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_ColArbiter"] = c.util.ZNPList_ZPP_ColArbiter;
- c.util.ZNPList_ZPP_ColArbiter.__name__ = ["zpp_nape", "util",
- "ZNPList_ZPP_ColArbiter"
- ];
- c.util.ZNPList_ZPP_ColArbiter.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_ColArbiter.zpp_pool;
- c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null,
- c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_ColArbiter.zpp_pool;
- c.util.ZNPNode_ZPP_ColArbiter.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- null ==
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_ColArbiter
- };
- c.util.ZNPList_ZPP_ToiEvent = function () {
- this.length = 0;
- this.modified =
- this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_ToiEvent"] = c.util.ZNPList_ZPP_ToiEvent;
- c.util.ZNPList_ZPP_ToiEvent.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_ToiEvent"];
- c.util.ZNPList_ZPP_ToiEvent.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a,
- b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_ToiEvent.zpp_pool;
- c.util.ZNPNode_ZPP_ToiEvent.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt ==
- a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_ToiEvent.zpp_pool;
- c.util.ZNPNode_ZPP_ToiEvent.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a,
- b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_ToiEvent
- };
- c.util.ZNPList_ConvexResult = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ConvexResult"] = c.util.ZNPList_ConvexResult;
- c.util.ZNPList_ConvexResult.__name__ = ["zpp_nape", "util", "ZNPList_ConvexResult"];
- c.util.ZNPList_ConvexResult.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head,
- b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ConvexResult.zpp_pool;
- c.util.ZNPNode_ConvexResult.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a =
- this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ConvexResult.zpp_pool;
- c.util.ZNPNode_ConvexResult.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next =
- d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ConvexResult
- };
- c.util.ZNPList_ZPP_GeomPoly = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_ZPP_GeomPoly"] = c.util.ZNPList_ZPP_GeomPoly;
- c.util.ZNPList_ZPP_GeomPoly.__name__ = ["zpp_nape", "util", "ZNPList_ZPP_GeomPoly"];
- c.util.ZNPList_ZPP_GeomPoly.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b =
- this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a = this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_GeomPoly.zpp_pool;
- c.util.ZNPNode_ZPP_GeomPoly.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a =
- this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_ZPP_GeomPoly.zpp_pool;
- c.util.ZNPNode_ZPP_GeomPoly.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- 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 =
- d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_ZPP_GeomPoly
- };
- c.util.ZNPList_RayResult = function () {
- this.length = 0;
- this.modified = this.pushmod = !1;
- this.head = null
- };
- s["zpp_nape.util.ZNPList_RayResult"] = c.util.ZNPList_RayResult;
- c.util.ZNPList_RayResult.__name__ = ["zpp_nape", "util", "ZNPList_RayResult"];
- c.util.ZNPList_RayResult.prototype = {
- at: function (a) {
- a = this.iterator_at(a);
- return null != a ? a.elt : null
- },
- iterator_at: function (a) {
- for (var b = this.head; 0 < a-- && null != b;) b = b.next;
- return b
- },
- back: function () {
- for (var a = this.head, b = a; null != b;) a = b, b = b.next;
- return a.elt
- },
- front: function () {
- return this.head.elt
- },
- inlined_has: function (a) {
- var b;
- b = !1;
- for (var c = this.head; null != c;) {
- if (c.elt == a) {
- b = !0;
- break
- }
- c = c.next
- }
- return b
- },
- has: function (a) {
- return this.inlined_has(a)
- },
- size: function () {
- return this.length
- },
- empty: function () {
- return null == this.head
- },
- reverse: function () {
- for (var a =
- this.head, b = null; null != a;) {
- var c = a.next;
- a.next = b;
- b = this.head = a;
- a = c
- }
- this.pushmod = this.modified = !0
- },
- inlined_clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- clear: function () {
- for (; null != this.head;) this.inlined_pop();
- this.pushmod = !0
- },
- splice: function (a, b) {
- for (; 0 < b-- && null != a.next;) this.erase(a);
- return a.next
- },
- inlined_erase: function (a) {
- var b, d;
- 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));
- a = b;
- a.elt = null;
- a.next = c.util.ZNPNode_RayResult.zpp_pool;
- c.util.ZNPNode_RayResult.zpp_pool = a;
- this.modified = !0;
- this.length--;
- this.pushmod = !0;
- return d
- },
- erase: function (a) {
- return this.inlined_erase(a)
- },
- inlined_try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.inlined_erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- inlined_remove: function (a) {
- this.inlined_try_remove(a)
- },
- try_remove: function (a) {
- for (var b = null, c = this.head, g = !1; null != c;) {
- if (c.elt == a) {
- this.erase(b);
- g = !0;
- break
- }
- b = c;
- c = c.next
- }
- return g
- },
- remove: function (a) {
- this.inlined_try_remove(a)
- },
- inlined_pop_unsafe: function () {
- var a = this.head.elt;
- this.pop();
- return a
- },
- pop_unsafe: function () {
- return this.inlined_pop_unsafe()
- },
- inlined_pop: function () {
- var a = this.head;
- this.head = a.next;
- a.elt = null;
- a.next = c.util.ZNPNode_RayResult.zpp_pool;
- c.util.ZNPNode_RayResult.zpp_pool = a;
- null == this.head && (this.pushmod = !0);
- this.modified = !0;
- this.length--
- },
- pop: function () {
- this.inlined_pop()
- },
- inlined_insert: function (a, b) {
- var d;
- null == c.util.ZNPNode_RayResult.zpp_pool ? d = new c.util.ZNPNode_RayResult :
- (d = c.util.ZNPNode_RayResult.zpp_pool, c.util.ZNPNode_RayResult.zpp_pool = d.next, d.next = null);
- null;
- d.elt = b;
- null == a ? (d.next = this.head, this.head = d) : (d.next = a.next, a.next = d);
- this.pushmod = this.modified = !0;
- this.length++;
- return d
- },
- insert: function (a, b) {
- return this.inlined_insert(a, b)
- },
- addAll: function (a) {
- for (a = a.head; null != a;) this.add(a.elt), a = a.next
- },
- inlined_add: function (a) {
- var b;
- 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 =
- b.next, b.next = null);
- null;
- b.elt = a;
- b.next = this.head;
- this.head = b;
- this.modified = !0;
- this.length++;
- return a
- },
- add: function (a) {
- return this.inlined_add(a)
- },
- setbegin: function (a) {
- this.head = a;
- this.pushmod = this.modified = !0
- },
- begin: function () {
- return this.head
- },
- __class__: c.util.ZNPList_RayResult
- };
- c.util.ZNPNode_ZPP_CbType = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_CbType"] = c.util.ZNPNode_ZPP_CbType;
- c.util.ZNPNode_ZPP_CbType.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CbType"];
- c.util.ZNPNode_ZPP_CbType.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_CbType
- };
- c.util.ZNPNode_ZPP_CallbackSet = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_CallbackSet"] = c.util.ZNPNode_ZPP_CallbackSet;
- c.util.ZNPNode_ZPP_CallbackSet.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CallbackSet"];
- c.util.ZNPNode_ZPP_CallbackSet.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_CallbackSet
- };
- c.util.ZNPNode_ZPP_Shape = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Shape"] = c.util.ZNPNode_ZPP_Shape;
- c.util.ZNPNode_ZPP_Shape.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Shape"];
- c.util.ZNPNode_ZPP_Shape.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Shape
- };
- c.util.ZNPNode_ZPP_Body = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Body"] = c.util.ZNPNode_ZPP_Body;
- c.util.ZNPNode_ZPP_Body.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Body"];
- c.util.ZNPNode_ZPP_Body.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Body
- };
- c.util.ZNPNode_ZPP_Constraint = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Constraint"] = c.util.ZNPNode_ZPP_Constraint;
- c.util.ZNPNode_ZPP_Constraint.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Constraint"];
- c.util.ZNPNode_ZPP_Constraint.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt =
- null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Constraint
- };
- c.util.ZNPNode_ZPP_Compound = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Compound"] = c.util.ZNPNode_ZPP_Compound;
- c.util.ZNPNode_ZPP_Compound.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Compound"];
- c.util.ZNPNode_ZPP_Compound.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Compound
- };
- c.util.ZNPNode_ZPP_InteractionListener = function () {
- this.next = this.elt =
- null
- };
- s["zpp_nape.util.ZNPNode_ZPP_InteractionListener"] = c.util.ZNPNode_ZPP_InteractionListener;
- c.util.ZNPNode_ZPP_InteractionListener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_InteractionListener"];
- c.util.ZNPNode_ZPP_InteractionListener.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_InteractionListener
- };
- c.util.ZNPNode_ZPP_CbSet = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_CbSet"] = c.util.ZNPNode_ZPP_CbSet;
- c.util.ZNPNode_ZPP_CbSet.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CbSet"];
- c.util.ZNPNode_ZPP_CbSet.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_CbSet
- };
- c.util.ZNPNode_ZPP_Interactor = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Interactor"] = c.util.ZNPNode_ZPP_Interactor;
- c.util.ZNPNode_ZPP_Interactor.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Interactor"];
- c.util.ZNPNode_ZPP_Interactor.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Interactor
- };
- c.util.ZNPNode_ZPP_Arbiter = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Arbiter"] = c.util.ZNPNode_ZPP_Arbiter;
- c.util.ZNPNode_ZPP_Arbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Arbiter"];
- c.util.ZNPNode_ZPP_Arbiter.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Arbiter
- };
- c.util.ZNPNode_ZPP_BodyListener = function () {
- this.next =
- this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_BodyListener"] = c.util.ZNPNode_ZPP_BodyListener;
- c.util.ZNPNode_ZPP_BodyListener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_BodyListener"];
- c.util.ZNPNode_ZPP_BodyListener.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_BodyListener
- };
- c.util.ZNPNode_ZPP_ConstraintListener = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_ConstraintListener"] = c.util.ZNPNode_ZPP_ConstraintListener;
- c.util.ZNPNode_ZPP_ConstraintListener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_ConstraintListener"];
- c.util.ZNPNode_ZPP_ConstraintListener.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_ConstraintListener
- };
- c.util.ZNPNode_ZPP_CbSetPair = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_CbSetPair"] = c.util.ZNPNode_ZPP_CbSetPair;
- c.util.ZNPNode_ZPP_CbSetPair.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CbSetPair"];
- c.util.ZNPNode_ZPP_CbSetPair.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_CbSetPair
- };
- c.util.ZNPNode_ZPP_CutInt = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_CutInt"] = c.util.ZNPNode_ZPP_CutInt;
- c.util.ZNPNode_ZPP_CutInt.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CutInt"];
- c.util.ZNPNode_ZPP_CutInt.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_CutInt
- };
- c.util.ZNPNode_ZPP_CutVert =
- function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_CutVert"] = c.util.ZNPNode_ZPP_CutVert;
- c.util.ZNPNode_ZPP_CutVert.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_CutVert"];
- c.util.ZNPNode_ZPP_CutVert.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_CutVert
- };
- c.util.ZNPNode_ZPP_PartitionVertex = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_PartitionVertex"] = c.util.ZNPNode_ZPP_PartitionVertex;
- c.util.ZNPNode_ZPP_PartitionVertex.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_PartitionVertex"];
- c.util.ZNPNode_ZPP_PartitionVertex.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_PartitionVertex
- };
- c.util.ZNPNode_ZPP_PartitionedPoly = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_PartitionedPoly"] = c.util.ZNPNode_ZPP_PartitionedPoly;
- c.util.ZNPNode_ZPP_PartitionedPoly.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_PartitionedPoly"];
- c.util.ZNPNode_ZPP_PartitionedPoly.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_PartitionedPoly
- };
- c.util.ZNPNode_ZPP_GeomVert = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_GeomVert"] = c.util.ZNPNode_ZPP_GeomVert;
- c.util.ZNPNode_ZPP_GeomVert.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_GeomVert"];
- c.util.ZNPNode_ZPP_GeomVert.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_GeomVert
- };
- c.util.ZNPNode_ZPP_SimplifyP = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_SimplifyP"] = c.util.ZNPNode_ZPP_SimplifyP;
- c.util.ZNPNode_ZPP_SimplifyP.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SimplifyP"];
- c.util.ZNPNode_ZPP_SimplifyP.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_SimplifyP
- };
- c.util.ZNPNode_ZPP_SimpleVert = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_SimpleVert"] = c.util.ZNPNode_ZPP_SimpleVert;
- c.util.ZNPNode_ZPP_SimpleVert.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SimpleVert"];
- c.util.ZNPNode_ZPP_SimpleVert.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_SimpleVert
- };
- c.util.ZNPNode_ZPP_SimpleEvent = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_SimpleEvent"] = c.util.ZNPNode_ZPP_SimpleEvent;
- c.util.ZNPNode_ZPP_SimpleEvent.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SimpleEvent"];
- c.util.ZNPNode_ZPP_SimpleEvent.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_SimpleEvent
- };
- c.util.ZNPNode_ZPP_AABBPair = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_AABBPair"] = c.util.ZNPNode_ZPP_AABBPair;
- c.util.ZNPNode_ZPP_AABBPair.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_AABBPair"];
- c.util.ZNPNode_ZPP_AABBPair.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_AABBPair
- };
- c.util.ZNPNode_ZPP_Edge =
- function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Edge"] = c.util.ZNPNode_ZPP_Edge;
- c.util.ZNPNode_ZPP_Edge.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Edge"];
- c.util.ZNPNode_ZPP_Edge.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Edge
- };
- c.util.ZNPNode_ZPP_Vec2 = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Vec2"] = c.util.ZNPNode_ZPP_Vec2;
- c.util.ZNPNode_ZPP_Vec2.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Vec2"];
- c.util.ZNPNode_ZPP_Vec2.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Vec2
- };
- c.util.ZNPNode_ZPP_Component = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Component"] = c.util.ZNPNode_ZPP_Component;
- c.util.ZNPNode_ZPP_Component.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Component"];
- c.util.ZNPNode_ZPP_Component.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Component
- };
- c.util.ZNPNode_ZPP_AABBNode = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_AABBNode"] = c.util.ZNPNode_ZPP_AABBNode;
- c.util.ZNPNode_ZPP_AABBNode.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_AABBNode"];
- c.util.ZNPNode_ZPP_AABBNode.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_AABBNode
- };
- c.util.ZNPNode_ZPP_InteractionGroup = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_InteractionGroup"] = c.util.ZNPNode_ZPP_InteractionGroup;
- c.util.ZNPNode_ZPP_InteractionGroup.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_InteractionGroup"];
- c.util.ZNPNode_ZPP_InteractionGroup.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_InteractionGroup
- };
- c.util.ZNPNode_ZPP_FluidArbiter = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_FluidArbiter"] = c.util.ZNPNode_ZPP_FluidArbiter;
- c.util.ZNPNode_ZPP_FluidArbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_FluidArbiter"];
- c.util.ZNPNode_ZPP_FluidArbiter.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_FluidArbiter
- };
- c.util.ZNPNode_ZPP_SensorArbiter = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_SensorArbiter"] = c.util.ZNPNode_ZPP_SensorArbiter;
- c.util.ZNPNode_ZPP_SensorArbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_SensorArbiter"];
- c.util.ZNPNode_ZPP_SensorArbiter.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt =
- null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_SensorArbiter
- };
- c.util.ZNPNode_ZPP_Listener = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_Listener"] = c.util.ZNPNode_ZPP_Listener;
- c.util.ZNPNode_ZPP_Listener.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_Listener"];
- c.util.ZNPNode_ZPP_Listener.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_Listener
- };
- c.util.ZNPNode_ZPP_ColArbiter = function () {
- this.next = this.elt =
- null
- };
- s["zpp_nape.util.ZNPNode_ZPP_ColArbiter"] = c.util.ZNPNode_ZPP_ColArbiter;
- c.util.ZNPNode_ZPP_ColArbiter.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_ColArbiter"];
- c.util.ZNPNode_ZPP_ColArbiter.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_ColArbiter
- };
- c.util.ZNPNode_ZPP_ToiEvent = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_ToiEvent"] = c.util.ZNPNode_ZPP_ToiEvent;
- c.util.ZNPNode_ZPP_ToiEvent.__name__ = ["zpp_nape",
- "util", "ZNPNode_ZPP_ToiEvent"
- ];
- c.util.ZNPNode_ZPP_ToiEvent.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_ToiEvent
- };
- c.util.ZNPNode_ConvexResult = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ConvexResult"] = c.util.ZNPNode_ConvexResult;
- c.util.ZNPNode_ConvexResult.__name__ = ["zpp_nape", "util", "ZNPNode_ConvexResult"];
- c.util.ZNPNode_ConvexResult.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt =
- null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ConvexResult
- };
- c.util.ZNPNode_ZPP_GeomPoly = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_ZPP_GeomPoly"] = c.util.ZNPNode_ZPP_GeomPoly;
- c.util.ZNPNode_ZPP_GeomPoly.__name__ = ["zpp_nape", "util", "ZNPNode_ZPP_GeomPoly"];
- c.util.ZNPNode_ZPP_GeomPoly.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_ZPP_GeomPoly
- };
- c.util.ZNPNode_RayResult = function () {
- this.next = this.elt = null
- };
- s["zpp_nape.util.ZNPNode_RayResult"] =
- c.util.ZNPNode_RayResult;
- c.util.ZNPNode_RayResult.__name__ = ["zpp_nape", "util", "ZNPNode_RayResult"];
- c.util.ZNPNode_RayResult.prototype = {
- elem: function () {
- return this.elt
- },
- free: function () {
- this.elt = null
- },
- alloc: function () {},
- __class__: c.util.ZNPNode_RayResult
- };
- c.util.ZPP_MixVec2List = function () {
- this.at_index = 0;
- this.at_ite = null;
- this.zip_length = !1;
- this._length = 0;
- this.inner = null;
- h.geom.Vec2List.call(this);
- this.at_ite = null;
- this.at_index = 0;
- this.zip_length = !0;
- this._length = 0
- };
- s["zpp_nape.util.ZPP_MixVec2List"] =
- c.util.ZPP_MixVec2List;
- c.util.ZPP_MixVec2List.__name__ = ["zpp_nape", "util", "ZPP_MixVec2List"];
- c.util.ZPP_MixVec2List.get = function (a, b) {
- null == b && (b = !1);
- var d = new c.util.ZPP_MixVec2List;
- d.inner = a;
- d.zpp_inner.immutable = b;
- return d
- };
- c.util.ZPP_MixVec2List.__super__ = h.geom.Vec2List;
- c.util.ZPP_MixVec2List.prototype = I(h.geom.Vec2List.prototype, {
- clear: function () {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- if (this.zpp_inner.reverse_flag)
- for (; !this.empty();) this.pop();
- else
- for (; !this.empty();) this.shift()
- },
- remove: function (a) {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- var b;
- b = !1;
- for (var c = this.inner.next; null != c;) {
- if (a.zpp_inner == c) {
- b = !0;
- break
- }
- c = c.next
- }
- 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());
- return b
- },
- shift: function () {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- if (this.empty()) throw "Error: Cannot remove from empty list";
- this.zpp_vm();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- null != this.at_ite && null == this.at_ite.next && (this.at_ite = null);
- var b = 1 == this.zpp_gl() ? null : this.inner.iterator_at(this.zpp_gl() - 2),
- a = null == b ? this.inner.next : b.next,
- c = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(c);
- this.zpp_inner.dontremove || this.inner.erase(b)
- } 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();
- this.zpp_inner.invalidate();
- return c =
- a.wrapper()
- },
- pop: function () {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- if (this.empty()) throw "Error: Cannot remove from empty list";
- this.zpp_vm();
- var a = null;
- if (this.zpp_inner.reverse_flag) {
- var a = this.inner.next,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.inner.pop()
- } else {
- null != this.at_ite && null == this.at_ite.next && (this.at_ite = null);
- var c = 1 == this.zpp_gl() ? null : this.inner.iterator_at(this.zpp_gl() -
- 2),
- a = null == c ? this.inner.next : c.next,
- b = a.wrapper();
- null != this.zpp_inner.subber && this.zpp_inner.subber(b);
- this.zpp_inner.dontremove || this.inner.erase(c)
- }
- this.zpp_inner.invalidate();
- return b = a.wrapper()
- },
- unshift: function (a) {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- if (a.zpp_inner._inuse) throw "Error: Vec2 is already in use";
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- if (b) {
- if (this.zpp_inner.reverse_flag) {
- var c = this.inner.iterator_at(this.zpp_gl() -
- 1);
- this.inner.insert(c, a.zpp_inner)
- } else this.inner.add(a.zpp_inner);
- this.zpp_inner.invalidate();
- null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a)
- }
- return b
- },
- push: function (a) {
- if (this.zpp_inner.immutable) throw "Error: Vec2List is immutable";
- this.zpp_inner.modify_test();
- this.zpp_vm();
- if (a.zpp_inner._inuse) throw "Error: Vec2 is already in use";
- var b = null != this.zpp_inner.adder ? this.zpp_inner.adder(a) : !0;
- if (b) {
- if (this.zpp_inner.reverse_flag) this.inner.add(a.zpp_inner);
- else {
- var c = this.inner.iterator_at(this.zpp_gl() -
- 1);
- this.inner.insert(c, a.zpp_inner)
- }
- this.zpp_inner.invalidate();
- null != this.zpp_inner.post_adder && this.zpp_inner.post_adder(a)
- }
- return b
- },
- at: function (a) {
- this.zpp_vm();
- if (0 > a || a >= this.zpp_gl()) throw "Error: Index out of bounds";
- this.zpp_inner.reverse_flag && (a = this.zpp_gl() - 1 - a);
- if (a < this.at_index || null == this.at_ite)
- for (this.at_index = 0, this.at_ite = this.inner.next;;) break;
- for (; this.at_index != a;)
- for (this.at_index++, this.at_ite = this.at_ite.next;;) break;
- return this.at_ite.wrapper()
- },
- zpp_vm: function () {
- this.zpp_inner.validate();
- this.inner.modified && (this.zip_length = !0, this._length = 0, this.at_ite = null)
- },
- zpp_gl: function () {
- this.zpp_vm();
- if (this.zip_length) {
- this._length = 0;
- for (var a = this.inner.next; null != a;) this._length++, a = a.next;
- this.zip_length = !1
- }
- return this._length
- },
- __class__: c.util.ZPP_MixVec2List
- });
- c.util.ZPP_ConstraintList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder =
- this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Constraint;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_ConstraintList"] = c.util.ZPP_ConstraintList;
- c.util.ZPP_ConstraintList.__name__ = ["zpp_nape", "util", "ZPP_ConstraintList"];
- c.util.ZPP_ConstraintList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.constraint.ConstraintList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_ConstraintList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_ConstraintList
- };
- c.util.ZPP_BodyList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Body;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_BodyList"] = c.util.ZPP_BodyList;
- c.util.ZPP_BodyList.__name__ = ["zpp_nape",
- "util", "ZPP_BodyList"
- ];
- c.util.ZPP_BodyList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.phys.BodyList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_BodyList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_BodyList
- };
- c.util.ZPP_InteractorList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable =
- this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Interactor;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_InteractorList"] = c.util.ZPP_InteractorList;
- c.util.ZPP_InteractorList.__name__ = ["zpp_nape", "util", "ZPP_InteractorList"];
- c.util.ZPP_InteractorList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.phys.InteractorList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_InteractorList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_InteractorList
- };
- c.util.ZPP_CompoundList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Compound;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_CompoundList"] = c.util.ZPP_CompoundList;
- c.util.ZPP_CompoundList.__name__ = ["zpp_nape", "util", "ZPP_CompoundList"];
- c.util.ZPP_CompoundList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.phys.CompoundList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_CompoundList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_CompoundList
- };
- c.util.ZPP_ListenerList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable =
- this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Listener;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_ListenerList"] = c.util.ZPP_ListenerList;
- c.util.ZPP_ListenerList.__name__ = ["zpp_nape", "util", "ZPP_ListenerList"];
- c.util.ZPP_ListenerList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.callbacks.ListenerList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_ListenerList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_ListenerList
- };
- c.util.ZPP_CbTypeList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_CbType;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_CbTypeList"] = c.util.ZPP_CbTypeList;
- c.util.ZPP_CbTypeList.__name__ = ["zpp_nape", "util", "ZPP_CbTypeList"];
- c.util.ZPP_CbTypeList.get =
- function (a, b) {
- null == b && (b = !1);
- var c = new h.callbacks.CbTypeList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_CbTypeList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite =
- null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_CbTypeList
- };
- c.util.ZPP_Vec2List = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Vec2;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_Vec2List"] = c.util.ZPP_Vec2List;
- c.util.ZPP_Vec2List.__name__ = ["zpp_nape", "util", "ZPP_Vec2List"];
- c.util.ZPP_Vec2List.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.geom.Vec2List;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_Vec2List.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated &&
- (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_Vec2List
- };
- c.util.ZPP_GeomPolyList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite =
- null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_GeomPoly;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_GeomPolyList"] = c.util.ZPP_GeomPolyList;
- c.util.ZPP_GeomPolyList.__name__ = ["zpp_nape", "util", "ZPP_GeomPolyList"];
- c.util.ZPP_GeomPolyList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.geom.GeomPolyList;
- c.zpp_inner.inner =
- a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_GeomPolyList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_GeomPolyList
- };
- c.util.ZPP_RayResultList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_RayResult;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_RayResultList"] = c.util.ZPP_RayResultList;
- c.util.ZPP_RayResultList.__name__ = ["zpp_nape", "util", "ZPP_RayResultList"];
- c.util.ZPP_RayResultList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.geom.RayResultList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_RayResultList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_RayResultList
- };
- c.util.ZPP_ConvexResultList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite =
- null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ConvexResult;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_ConvexResultList"] = c.util.ZPP_ConvexResultList;
- c.util.ZPP_ConvexResultList.__name__ = ["zpp_nape", "util", "ZPP_ConvexResultList"];
- c.util.ZPP_ConvexResultList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.geom.ConvexResultList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_ConvexResultList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_ConvexResultList
- };
- c.util.ZPP_EdgeList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Edge;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_EdgeList"] = c.util.ZPP_EdgeList;
- c.util.ZPP_EdgeList.__name__ = ["zpp_nape", "util", "ZPP_EdgeList"];
- c.util.ZPP_EdgeList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.shape.EdgeList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_EdgeList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate &&
- this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_EdgeList
- };
- c.util.ZPP_ShapeList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove =
- this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Shape;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_ShapeList"] = c.util.ZPP_ShapeList;
- c.util.ZPP_ShapeList.__name__ = ["zpp_nape", "util", "ZPP_ShapeList"];
- c.util.ZPP_ShapeList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.shape.ShapeList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_ShapeList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_ShapeList
- };
- c.util.ZPP_InteractionGroupList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_InteractionGroup;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_InteractionGroupList"] =
- c.util.ZPP_InteractionGroupList;
- c.util.ZPP_InteractionGroupList.__name__ = ["zpp_nape", "util", "ZPP_InteractionGroupList"];
- c.util.ZPP_InteractionGroupList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.dynamics.InteractionGroupList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_InteractionGroupList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_InteractionGroupList
- };
- c.util.ZPP_ArbiterList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite =
- null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.util.ZNPList_ZPP_Arbiter;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_ArbiterList"] = c.util.ZPP_ArbiterList;
- c.util.ZPP_ArbiterList.__name__ = ["zpp_nape", "util", "ZPP_ArbiterList"];
- c.util.ZPP_ArbiterList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.dynamics.ArbiterList;
- c.zpp_inner.inner =
- a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_ArbiterList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate && this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_ArbiterList
- };
- c.util.ZPP_ContactList = function () {
- this.user_length = 0;
- this.zip_length = !1;
- this.at_ite = this.push_ite = null;
- this.at_index = 0;
- this.dontremove = this.reverse_flag = !1;
- this._invalidate = this._validate = this._modifiable = this.adder = this.post_adder = this.subber = null;
- this.immutable = this._invalidated = !1;
- this.outer = this.inner = null;
- this.inner = new c.dynamics.ZPP_Contact;
- this._invalidated = !0
- };
- s["zpp_nape.util.ZPP_ContactList"] = c.util.ZPP_ContactList;
- c.util.ZPP_ContactList.__name__ = ["zpp_nape", "util", "ZPP_ContactList"];
- c.util.ZPP_ContactList.get = function (a, b) {
- null == b && (b = !1);
- var c = new h.dynamics.ContactList;
- c.zpp_inner.inner = a;
- b && (c.zpp_inner.immutable = !0);
- c.zpp_inner.zip_length = !0;
- return c
- };
- c.util.ZPP_ContactList.prototype = {
- invalidate: function () {
- this._invalidated = !0;
- null != this._invalidate && this._invalidate(this)
- },
- validate: function () {
- this._invalidated && (this._invalidated = !1, null != this._validate &&
- this._validate())
- },
- modify_test: function () {
- null != this._modifiable && this._modifiable()
- },
- modified: function () {
- this.zip_length = !0;
- this.push_ite = this.at_ite = null
- },
- valmod: function () {
- this.validate();
- 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)
- },
- __class__: c.util.ZPP_ContactList
- };
- c.util.ZPP_Math = function () {};
- s["zpp_nape.util.ZPP_Math"] = c.util.ZPP_Math;
- c.util.ZPP_Math.__name__ = ["zpp_nape", "util", "ZPP_Math"];
- c.util.ZPP_Math.sqrt =
- function (a) {
- return Math.sqrt(a)
- };
- c.util.ZPP_Math.invsqrt = function (a) {
- return 1 / Math.sqrt(a)
- };
- c.util.ZPP_Math.sqr = function (a) {
- return a * a
- };
- c.util.ZPP_Math.clamp2 = function (a, b) {
- return c.util.ZPP_Math.clamp(a, -b, b)
- };
- c.util.ZPP_Math.clamp = function (a, b, c) {
- return a < b ? b : a > c ? c : a
- };
- c.util.ZPP_PubPool = function () {};
- s["zpp_nape.util.ZPP_PubPool"] = c.util.ZPP_PubPool;
- c.util.ZPP_PubPool.__name__ = ["zpp_nape", "util", "ZPP_PubPool"];
- c.util.ZPP_Set_ZPP_Body = function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev =
- this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_Body"] = c.util.ZPP_Set_ZPP_Body;
- c.util.ZPP_Set_ZPP_Body.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_Body"];
- c.util.ZPP_Set_ZPP_Body.prototype = {
- insert: function (a) {
- var b;
- 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;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev =
- b;
- b.parent = a;
- break
- } else a = a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return d;
- null == b.parent ?
- b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b = a.parent,
- c =
- b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null != h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent = f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f = a.next,
- h = f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next = f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.next = k;
- null != k && (k.parent = f);
- f.prev = b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_Body.zpp_pool;
- c.util.ZPP_Set_ZPP_Body.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null != this.parent) {
- for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b = b.prev;
- var d =
- a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d = a.parent;
- null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_Body.zpp_pool;
- c.util.ZPP_Set_ZPP_Body.zpp_pool = a
- },
- predecessor: function (a) {
- a = this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a = a.next;
- else {
- var b = a;
- for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a =
- this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b = null;
- if (!this.empty()) {
- for (var c = this.parent; null != c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null != c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b = this.parent; null != b;)
- if (this.lt(a,
- b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null != this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null != b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g = this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g = g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_Body
- };
- c.util.ZPP_Set_ZPP_CbSetPair = function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_CbSetPair"] = c.util.ZPP_Set_ZPP_CbSetPair;
- c.util.ZPP_Set_ZPP_CbSetPair.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_CbSetPair"];
- c.util.ZPP_Set_ZPP_CbSetPair.prototype = {
- insert: function (a) {
- var b;
- 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;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev = b;
- b.parent = a;
- break
- } else a = a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return d;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour &&
- this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b =
- a.parent,
- c = b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null != h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent =
- f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f = a.next,
- h = f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next =
- f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.next = k;
- null != k && (k.parent = f);
- f.prev = b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool;
- c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null != this.parent) {
- for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b =
- b.prev;
- var d = a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d = a.parent;
- null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool;
- c.util.ZPP_Set_ZPP_CbSetPair.zpp_pool = a
- },
- predecessor: function (a) {
- a = this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a = a.next;
- else {
- var b = a;
- for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a =
- this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b = null;
- if (!this.empty()) {
- for (var c = this.parent; null != c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null != c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b = this.parent; null != b;)
- if (this.lt(a,
- b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null != this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null != b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g = this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g = g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_CbSetPair
- };
- c.util.ZPP_Set_ZPP_PartitionVertex = function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_PartitionVertex"] = c.util.ZPP_Set_ZPP_PartitionVertex;
- c.util.ZPP_Set_ZPP_PartitionVertex.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_PartitionVertex"];
- c.util.ZPP_Set_ZPP_PartitionVertex.prototype = {
- insert: function (a) {
- var b;
- 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;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev = b;
- b.parent =
- a;
- break
- } else a = a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a,
- d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return d;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d =
- this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b = a.parent,
- c = b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null != h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent = f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f =
- a.next,
- h = f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next = f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.next = k;
- null != k && (k.parent =
- f);
- f.prev = b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool;
- c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null != this.parent) {
- for (var b =
- this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b = b.prev;
- var d = a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d =
- a.parent;
- null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool;
- c.util.ZPP_Set_ZPP_PartitionVertex.zpp_pool = a
- },
- predecessor: function (a) {
- a = this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a = a.next;
- else {
- var b = a;
- for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b = null;
- if (!this.empty()) {
- for (var c = this.parent; null != c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null != c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b = this.parent; null != b;)
- if (this.lt(a, b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data != a;) b =
- this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null != this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null != b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a =
- this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g = this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g = g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_PartitionVertex
- };
- c.util.ZPP_Set_ZPP_PartitionPair = function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_PartitionPair"] = c.util.ZPP_Set_ZPP_PartitionPair;
- c.util.ZPP_Set_ZPP_PartitionPair.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_PartitionPair"];
- c.util.ZPP_Set_ZPP_PartitionPair.prototype = {
- insert: function (a) {
- var b;
- 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;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev = b;
- b.parent = a;
- break
- } else a = a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return d;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b =
- a.parent,
- c = b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null != h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent =
- f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f = a.next,
- h = f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next =
- f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.next = k;
- null != k && (k.parent = f);
- f.prev = b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool;
- c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null != this.parent) {
- for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b =
- b.prev;
- var d = a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d = a.parent;
- null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool;
- c.util.ZPP_Set_ZPP_PartitionPair.zpp_pool = a
- },
- predecessor: function (a) {
- a =
- this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a = a.next;
- else {
- var b = a;
- for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b = null;
- if (!this.empty()) {
- for (var c = this.parent; null != c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null != c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b =
- this.parent; null != b;)
- if (this.lt(a, b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null != this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null != b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b =
- b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g = this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g =
- g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_PartitionPair
- };
- c.util.ZPP_Set_ZPP_SimpleVert = function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_SimpleVert"] =
- c.util.ZPP_Set_ZPP_SimpleVert;
- c.util.ZPP_Set_ZPP_SimpleVert.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_SimpleVert"];
- c.util.ZPP_Set_ZPP_SimpleVert.prototype = {
- insert: function (a) {
- var b;
- 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;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev = b;
- b.parent = a;
- break
- } else a =
- a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d =
- d.next;
- else break; if (null == b) return d;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b = a.parent,
- c = b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null !=
- h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent = f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f = a.next,
- h = f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next = f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.next = k;
- null != k && (k.parent = f);
- f.prev = b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool;
- c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null != this.parent) {
- for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b = b.prev;
- var d = a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d = a.parent;
- null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped =
- null;
- a.next = c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool;
- c.util.ZPP_Set_ZPP_SimpleVert.zpp_pool = a
- },
- predecessor: function (a) {
- a = this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a = a.next;
- else {
- var b = a;
- for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b = null;
- if (!this.empty()) {
- for (var c = this.parent; null != c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null !=
- c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b = this.parent; null != b;)
- if (this.lt(a, b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null != this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null !=
- b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g = this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g = g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_SimpleVert
- };
- c.util.ZPP_Set_ZPP_SimpleSeg =
- function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_SimpleSeg"] = c.util.ZPP_Set_ZPP_SimpleSeg;
- c.util.ZPP_Set_ZPP_SimpleSeg.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_SimpleSeg"];
- c.util.ZPP_Set_ZPP_SimpleSeg.prototype = {
- insert: function (a) {
- var b;
- 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;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev = b;
- b.parent = a;
- break
- } else a = a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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 = b;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return d;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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 =
- b;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b = a.parent,
- c = b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null != h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent = f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f = a.next,
- h =
- f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next = f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.next = k;
- null != k && (k.parent = f);
- f.prev =
- b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool;
- c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null != this.parent) {
- for (var b = this.parent; null !=
- b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b = b.prev;
- var d = a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 ==
- g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d = a.parent;
- null == d ?
- this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool;
- c.util.ZPP_Set_ZPP_SimpleSeg.zpp_pool = a
- },
- predecessor: function (a) {
- a = this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a = a.next;
- else {
- var b = a;
- for (a = a.parent; null !=
- a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b = null;
- if (!this.empty()) {
- for (var c = this.parent; null !=
- c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null != c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b = this.parent; null != b;)
- if (this.lt(a, b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null !=
- this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null != b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g =
- this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g = g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_SimpleSeg
- };
- c.util.ZPP_Set_ZPP_SimpleEvent = function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_SimpleEvent"] = c.util.ZPP_Set_ZPP_SimpleEvent;
- c.util.ZPP_Set_ZPP_SimpleEvent.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_SimpleEvent"];
- c.util.ZPP_Set_ZPP_SimpleEvent.prototype = {
- insert: function (a) {
- var b;
- 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);
- null;
- b.data = a;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev = b;
- b.parent = a;
- break
- } else a = a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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 = b.next, b.next = null), null, b.data = a, this.parent = b;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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);
- null;
- b.data = a;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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);
- null;
- b.data = a;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return d;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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 =
- b.next, b.next = null), null, b.data = a, this.parent = b;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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);
- null;
- b.data = a;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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);
- null;
- b.data = a;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b = a.parent,
- c = b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null != h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent = f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f = a.next,
- h = f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next = f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data,
- f.data);
- f.next = k;
- null != k && (k.parent = f);
- f.prev = b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool;
- c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null !=
- this.parent) {
- for (var b = this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b = b.prev;
- var d = a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d = a.parent;
- null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool;
- c.util.ZPP_Set_ZPP_SimpleEvent.zpp_pool = a
- },
- predecessor: function (a) {
- a = this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a =
- a.next;
- else {
- var b = a;
- for (a = a.parent; null != a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b =
- null;
- if (!this.empty()) {
- for (var c = this.parent; null != c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null != c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b = this.parent; null != b;)
- if (this.lt(a, b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data !=
- a;) b = this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null != this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null != b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a =
- this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g = this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g = g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_SimpleEvent
- };
- c.util.ZPP_Set_ZPP_CbSet = function () {
- this.colour = 0;
- this.lt = this.swapped = this.data = this.prev = this.next = this.parent = null
- };
- s["zpp_nape.util.ZPP_Set_ZPP_CbSet"] = c.util.ZPP_Set_ZPP_CbSet;
- c.util.ZPP_Set_ZPP_CbSet.__name__ = ["zpp_nape", "util", "ZPP_Set_ZPP_CbSet"];
- c.util.ZPP_Set_ZPP_CbSet.prototype = {
- insert: function (a) {
- var b;
- 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);
- null;
- b.data = a;
- if (null == this.parent) this.parent = b;
- else
- for (a = this.parent;;)
- if (this.lt(b.data, a.data))
- if (null == a.prev) {
- a.prev = b;
- b.parent = a;
- break
- } else a = a.prev;
- else if (null == a.next) {
- a.next = b;
- b.parent = a;
- break
- } else a = a.next;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert: function (a) {
- var b = null,
- d = null;
- 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 = b.next, b.next = null), null, b.data = a, this.parent = b;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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);
- null;
- b.data = a;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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);
- null;
- b.data = a;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return d;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return b
- },
- try_insert_bool: function (a) {
- var b = null,
- d = null;
- 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 =
- b.next, b.next = null), null, b.data = a, this.parent = b;
- else
- for (d = this.parent;;)
- if (this.lt(a, d.data))
- if (null == d.prev) {
- 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);
- null;
- b.data = a;
- d.prev = b;
- b.parent = d;
- break
- } else d = d.prev;
- else if (this.lt(d.data, a))
- if (null == d.next) {
- 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);
- null;
- b.data = a;
- d.next = b;
- b.parent = d;
- break
- } else d = d.next;
- else break; if (null == b) return !1;
- null == b.parent ? b.colour = 1 : (b.colour = 0, 0 == b.parent.colour && this.__fix_dbl_red(b));
- return !0
- },
- __fix_dbl_red: function (a) {
- for (;;) {
- var b = a.parent,
- c = b.parent;
- if (null == c) {
- b.colour = 1;
- break
- }
- var g, e, f, h, k, n, p;
- 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));
- a = c.parent;
- null == a ? this.parent = e : a.prev == c ? a.prev = e : a.next = e;
- null != e && (e.parent = a);
- g.prev = h;
- null != h && (h.parent = g);
- g.next = k;
- null != k && (k.parent = g);
- e.prev = g;
- null != g && (g.parent = e);
- e.next = f;
- null != f && (f.parent = e);
- f.prev = n;
- null != n && (n.parent = f);
- f.next = p;
- null != p && (p.parent = f);
- e.colour = c.colour - 1;
- g.colour = 1;
- f.colour = 1;
- if (e == this.parent) this.parent.colour = 1;
- else if (0 == e.colour && 0 == e.parent.colour) {
- a = e;
- continue
- }
- break
- }
- },
- __fix_neg_red: function (a) {
- var b = a.parent,
- c = b.prev == a ? function (c) {
- var d = a.prev,
- f =
- a.next,
- h = f.prev,
- k = f.next;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.next = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.prev = k;
- null != k && (k.parent = f);
- f.next = b.next;
- null != b.next && (b.next.parent = f);
- b.next = f;
- null != f && (f.parent = b);
- return d
- }(this) : function (c) {
- var d = a.next,
- f = a.prev,
- h = f.next,
- k = f.prev;
- d.colour = 0;
- a.colour = b.colour = 1;
- a.prev = h;
- null != h && (h.parent = a);
- h = b.data;
- b.data = f.data;
- f.data = h;
- null != c.swapped && c.swapped(b.data, f.data);
- f.next = k;
- null != k && (k.parent =
- f);
- f.prev = b.prev;
- null != b.prev && (b.prev.parent = f);
- b.prev = f;
- null != f && (f.parent = b);
- return d
- }(this);
- 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)
- },
- clear_node: function (a, b) {
- b(a.data);
- var d = a.parent;
- null != d && (a == d.prev ? d.prev = null : d.next = null, a.parent = null);
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_CbSet.zpp_pool;
- c.util.ZPP_Set_ZPP_CbSet.zpp_pool = a;
- return d
- },
- clear_with: function (a) {
- if (null != this.parent) {
- for (var b =
- this.parent; null != b;) b = null != b.prev ? b.prev : null != b.next ? b.next : this.clear_node(b, a);
- this.parent = null
- }
- },
- clear: function () {
- this.clear_with(function (a) {})
- },
- remove_node: function (a) {
- if (null != a.next && null != a.prev) {
- for (var b = a.next; null != b.prev;) b = b.prev;
- var d = a.data;
- a.data = b.data;
- b.data = d;
- null != this.swapped && this.swapped(a.data, b.data);
- a = b
- }
- b = null == a.prev ? a.next : a.prev;
- if (1 == a.colour)
- if (null != a.prev || null != a.next) b.colour = 1;
- else if (null != a.parent)
- for (d = a.parent;;) {
- d.colour++;
- d.prev.colour--;
- d.next.colour--;
- var g = d.prev;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- g = d.next;
- if (-1 == g.colour) {
- this.__fix_neg_red(g);
- break
- } else if (0 == g.colour) {
- if (null != g.prev && 0 == g.prev.colour) {
- this.__fix_dbl_red(g.prev);
- break
- }
- if (null != g.next && 0 == g.next.colour) {
- this.__fix_dbl_red(g.next);
- break
- }
- }
- if (2 == d.colour)
- if (null == d.parent) d.colour = 1;
- else {
- d = d.parent;
- continue
- }
- break
- }
- d =
- a.parent;
- null == d ? this.parent = b : d.prev == a ? d.prev = b : d.next = b;
- null != b && (b.parent = d);
- a.parent = a.prev = a.next = null;
- a.data = null;
- a.lt = null;
- a.swapped = null;
- a.next = c.util.ZPP_Set_ZPP_CbSet.zpp_pool;
- c.util.ZPP_Set_ZPP_CbSet.zpp_pool = a
- },
- predecessor: function (a) {
- a = this.predecessor_node(this.find(a));
- return null == a ? null : a.data
- },
- successor: function (a) {
- a = this.successor_node(this.find(a));
- return null == a ? null : a.data
- },
- predecessor_node: function (a) {
- if (null != a.prev)
- for (a = a.prev; null != a.next;) a = a.next;
- else {
- var b = a;
- for (a = a.parent; null !=
- a && a.next != b;) b = a, a = a.parent
- }
- return a
- },
- successor_node: function (a) {
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- var b = a;
- for (a = a.parent; null != a && a.prev != b;) b = a, a = a.parent
- }
- return a
- },
- remove: function (a) {
- a = this.find(a);
- this.remove_node(a)
- },
- pop_front: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- var b = a.data;
- this.remove_node(a);
- return b
- },
- first: function () {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- return a.data
- },
- lower_bound: function (a) {
- var b = null;
- if (!this.empty()) {
- for (var c = this.parent; null !=
- c.prev;) c = c.prev;
- for (; null != c;) {
- var g = c.data;
- if (!this.lt(g, a)) {
- b = g;
- break
- }
- if (null != c.next)
- for (c = c.next; null != c.prev;) c = c.prev;
- else {
- for (; null != c.parent && c == c.parent.next;) c = c.parent;
- c = c.parent
- }
- }
- }
- return b
- },
- find_weak: function (a) {
- for (var b = this.parent; null != b;)
- if (this.lt(a, b.data)) b = b.prev;
- else if (this.lt(b.data, a)) b = b.next;
- else break;
- return b
- },
- has_weak: function (a) {
- return null != this.find_weak(a)
- },
- find: function (a) {
- for (var b = this.parent; null != b && b.data != a;) b = this.lt(a, b.data) ? b.prev : b.next;
- return b
- },
- has: function (a) {
- return null !=
- this.find(a)
- },
- size: function () {
- var a = 0;
- if (!this.empty()) {
- for (var b = this.parent; null != b.prev;) b = b.prev;
- for (; null != b;)
- if (a++, null != b.next)
- for (b = b.next; null != b.prev;) b = b.prev;
- else {
- for (; null != b.parent && b == b.parent.next;) b = b.parent;
- b = b.parent
- }
- }
- return a
- },
- singular: function () {
- return null != this.parent && null == this.parent.prev && null == this.parent.next
- },
- empty: function () {
- return null == this.parent
- },
- verify: function () {
- if (!this.empty()) {
- for (var a = this.parent; null != a.prev;) a = a.prev;
- for (; null != a;) {
- var b = a.data,
- c = !0;
- if (!this.empty()) {
- for (var g =
- this.parent; null != g.prev;) g = g.prev;
- for (; null != g;) {
- var e = g.data;
- if (!c) {
- if (!this.lt(b, e) && this.lt(e, b)) return !1
- } else if (b == e) c = !1;
- else if (!this.lt(e, b) && this.lt(b, e)) return !1;
- if (null != g.next)
- for (g = g.next; null != g.prev;) g = g.prev;
- else {
- for (; null != g.parent && g == g.parent.next;) g = g.parent;
- g = g.parent
- }
- }
- }
- if (null != a.next)
- for (a = a.next; null != a.prev;) a = a.prev;
- else {
- for (; null != a.parent && a == a.parent.next;) a = a.parent;
- a = a.parent
- }
- }
- }
- return !0
- },
- alloc: function () {},
- free: function () {
- this.swapped = this.lt = this.data = null
- },
- __class__: c.util.ZPP_Set_ZPP_CbSet
- };
- var da, va = 0;
- k.display.DisplayObject.remapTouch = new y.ds.StringMap;
- k.display.DisplayObject.remapTouch.set("mousedown", "touchstart");
- k.display.DisplayObject.remapTouch.set("mousemove", "touchmove");
- k.display.DisplayObject.remapTouch.set("mouseup", "touchend");
- Array.prototype.indexOf && (S.remove = function (a, b) {
- var c = a.indexOf(b);
- if (-1 == c) return !1;
- a.splice(c, 1);
- return !0
- });
- Math.__name__ = ["Math"];
- Math.NaN = Number.NaN;
- Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
- Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
- s.Math = Math;
- Math.isFinite = function (a) {
- return isFinite(a)
- };
- Math.isNaN = function (a) {
- return isNaN(a)
- };
- String.prototype.__class__ = s.String = String;
- String.__name__ = ["String"];
- Array.prototype.__class__ = s.Array = Array;
- Array.__name__ = ["Array"];
- Date.prototype.__class__ = s.Date = Date;
- Date.__name__ = ["Date"];
- var wa = s.Int = {
- __name__: ["Int"]
- },
- xa = s.Dynamic = {
- __name__: ["Dynamic"]
- },
- sa = s.Float = Number;
- sa.__name__ = ["Float"];
- var ta = s.Bool = Boolean;
- ta.__ename__ = ["Bool"];
- var ya = s.Class = {
- __name__: ["Class"]
- },
- za = {};
- O.Element = "element";
- O.PCData = "pcdata";
- O.CData = "cdata";
- O.Comment = "comment";
- O.DocType = "doctype";
- O.ProcessingInstruction = "processingInstruction";
- O.Document = "document";
- k.Lib.schList = [];
- k.Lib.schLength = 0;
- window.reqAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) {
- window.setTimeout(a, 700 / k.Lib.frameRate, null)
- };
- (function () {
- var a = Event.prototype,
- b = k.events.Event.prototype;
- a.clone = b.clone;
- a.isDefaultPrevented =
- b.isDefaultPrevented;
- a.get_target = b.get_target;
- a.set_target = b.set_target;
- a.get_currentTarget = b.get_currentTarget;
- a.set_currentTarget = b.set_currentTarget
- })();
- (function () {
- var a = MouseEvent.prototype,
- b = k.events.MouseEvent.prototype;
- a.get_buttonDown = b.get_buttonDown;
- a.get_delta = b.get_delta;
- a.get_stageX = b.get_stageX;
- a.get_stageY = b.get_stageY;
- a.get_localX = b.get_localX;
- a.get_localY = b.get_localY;
- a.get_localPoint = b.get_localPoint
- })();
- y.Resource.content = [{
- name: "levels",
- 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"
- }, {
- name: "definitions",
- 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%"
- }];
- F.JQuery = window.jQuery;
- R.WIDTH = 480;
- R.HEIGHT = 600;
- R.FPS = 30;
- T.currentLevel = 0;
- T.NUMLEVELS = 25;
- D.KEYNUM = 256;
- D.UP = 38;
- D.DOWN = 40;
- D.LEFT = 37;
- D.RIGHT = 39;
- D.INSERT = 45;
- D.DELETE = 46;
- D.PAGE_UP = 33;
- D.PAGE_DOWN = 34;
- D.END = 35;
- D.HOME = 36;
- D.SPACE = 32;
- D.D0 = 48;
- D.D1 = 49;
- D.D2 = 50;
- D.D3 = 51;
- D.D4 = 52;
- D.D5 = 53;
- D.D6 = 54;
- D.D7 = 55;
- D.D8 = 56;
- D.D9 = 57;
- D.mOffsetX = 0;
- D.mOffsetY = 0;
- E.Frames = [
- [485, 237, 256, 256, 0, 0],
- [795, 178, 190, 82, 150.7, 41],
- [520, 918, 151, 63, 150.65, 41],
- [629, 813, 106, 103, 54.5, 54.5],
- [743, 327, 107, 103, 51.2, 48.7],
- [743, 262, 212, 63, 196.7, 41],
- [852,
- 327, 107, 103, 51.2, 48.7
- ],
- [825, 638, 56, 55, 28.75, 27.7],
- [737, 813, 144, 63, 150.7, 41],
- [520, 813, 107, 103, 51.2, 48.7],
- [2, 2, 481, 600, 0, 0],
- [967, 2, 48, 60, 24, 30],
- [743, 432, 242, 22, 121, 11],
- [737, 878, 20, 20, 10, 10],
- [975, 456, 22, 242, 11, 121],
- [967, 126, 40, 40, 20, 20],
- [673, 918, 84, 84, 41.5, 41.5],
- [924, 896, 44, 44, 21.5, 21.5],
- [759, 878, 84, 84, 41.5, 41.5],
- [883, 823, 18, 53, 8.9, 43.4],
- [883, 574, 90, 93, 45, 45],
- [485, 2, 308, 233, 12.05, 6.05],
- [967, 64, 48, 60, 24, 30],
- [2, 876, 516, 78, 257.35, 38.6],
- [391, 604, 149, 150, 72.85, 79.75],
- [795, 2, 170, 174, 85, 86.5],
- [845, 878, 77, 75,
- 33.5, 32.5
- ],
- [883, 669, 77, 75, 33.5, 32.5],
- [883, 746, 77, 75, 33.5, 32.5],
- [485, 495, 482, 77, 241, 23.75],
- [542, 702, 282, 61, 124.3, 34.35],
- [2, 956, 483, 62, 225.85, 34.55],
- [804, 964, 40, 40, 20, 20],
- [2, 604, 387, 270, 191.05, 69],
- [759, 964, 43, 38, 20.8, 18.55],
- [924, 823, 81, 71, 39.5, 34.95],
- [542, 574, 339, 62, 152.4, 34.8],
- [542, 638, 281, 62, 123.55, 34.3],
- [391, 756, 114, 110, 56.9, 54.15],
- [520, 765, 304, 46, 140.35, 22.7]
- ];
- E.bmpBrick = {
- name: "bmpBrick",
- tilesheetId: -1,
- frames: [0]
- };
- E.btnBack = {
- name: "btnBack",
- tilesheetId: -1,
- frames: [1]
- };
- E.btnCredits = {
- name: "btnCredits",
- tilesheetId: -1,
- frames: [2]
- };
- E.btnIconPlay = {
- name: "btnIconPlay",
- tilesheetId: -1,
- frames: [3]
- };
- E.btnLevels = {
- name: "btnLevels",
- tilesheetId: -1,
- frames: [4]
- };
- E.btnMoreGames = {
- name: "btnMoreGames",
- tilesheetId: -1,
- frames: [5]
- };
- E.btnNext = {
- name: "btnNext",
- tilesheetId: -1,
- frames: [6]
- };
- E.btnPause = {
- name: "btnPause",
- tilesheetId: -1,
- frames: [7]
- };
- E.btnPlay = {
- name: "btnPlay",
- tilesheetId: -1,
- frames: [8]
- };
- E.btnRestart = {
- name: "btnRestart",
- tilesheetId: -1,
- frames: [9]
- };
- E.cmcBG = {
- name: "cmcBG",
- tilesheetId: -1,
- frames: [10]
- };
- E.cmcBGGGG = {
- name: "cmcBGGGG",
- tilesheetId: -1,
- frames: [11]
- };
- E.cmcBlock12x1 = {
- name: "cmcBlock12x1",
- tilesheetId: -1,
- frames: [12]
- };
- E.cmcBlock1x1 = {
- name: "cmcBlock1x1",
- tilesheetId: -1,
- frames: [13]
- };
- E.cmcBlock1x12 = {
- name: "cmcBlock1x12",
- tilesheetId: -1,
- frames: [14]
- };
- E.cmcBlock2x2 = {
- name: "cmcBlock2x2",
- tilesheetId: -1,
- frames: [15]
- };
- E.cmcBlock4x4 = {
- name: "cmcBlock4x4",
- tilesheetId: -1,
- frames: [16]
- };
- E.cmcCircle2x2 = {
- name: "cmcCircle2x2",
- tilesheetId: -1,
- frames: [17]
- };
- E.cmcCircle4x4 = {
- name: "cmcCircle4x4",
- tilesheetId: -1,
- frames: [18]
- };
- E.cmcClockArrow = {
- name: "cmcClockArrow",
- tilesheetId: -1,
- frames: [19]
- };
- E.cmcClockBG = {
- name: "cmcClockBG",
- tilesheetId: -1,
- frames: [20]
- };
- E.cmcCreditsText = {
- name: "cmcCreditsText",
- tilesheetId: -1,
- frames: [21]
- };
- E.cmcDialogBG = {
- name: "cmcDialogBG",
- tilesheetId: -1,
- frames: [22]
- };
- E.cmcGGGBig = {
- name: "cmcGGGBig",
- tilesheetId: -1,
- frames: [23]
- };
- E.cmcHooda = {
- name: "cmcHooda",
- tilesheetId: -1,
- frames: [24]
- };
- E.cmcInstructions = {
- name: "cmcInstructions",
- tilesheetId: -1,
- frames: [25]
- };
- E.cmcLevelSelectButton = {
- name: "cmcLevelSelectButton",
- tilesheetId: -1,
- frames: [26, 27, 28]
- };
- E.cmcNext = {
- name: "cmcNext",
- tilesheetId: -1,
- frames: [29]
- };
- E.cmcPausedText = {
- name: "cmcPausedText",
- tilesheetId: -1,
- frames: [30]
- };
- E.cmcSelectALevel = {
- name: "cmcSelectALevel",
- tilesheetId: -1,
- frames: [31]
- };
- E.cmcStaticBlock2x2 = {
- name: "cmcStaticBlock2x2",
- tilesheetId: -1,
- frames: [32]
- };
- E.cmcSuperHoodaTitle = {
- name: "cmcSuperHoodaTitle",
- tilesheetId: -1,
- frames: [33]
- };
- E.cmcTriangle2x2 = {
- name: "cmcTriangle2x2",
- tilesheetId: -1,
- frames: [34]
- };
- E.cmcTriangle4x4 = {
- name: "cmcTriangle4x4",
- tilesheetId: -1,
- frames: [35]
- };
- E.cmcYouLoseText = {
- name: "cmcYouLoseText",
- tilesheetId: -1,
- frames: [36]
- };
- E.cmcYouWinText = {
- name: "cmcYouWinText",
- tilesheetId: -1,
- frames: [37]
- };
- E.hoodaGameObject = {
- name: "hoodaGameObject",
- tilesheetId: -1,
- frames: [38]
- };
- E.sponsorGGG = {
- name: "sponsorGGG",
- tilesheetId: -1,
- frames: [39]
- };
- E.BitmapName = "Objects.png";
- k.Lib.qTimeStamp = Date.now() + 0;
- k.Lib.mouseX = 0;
- k.Lib.mouseY = 0;
- k.geom.Transform.DEG_TO_RAD = Math.PI / 180;
- y.Serializer.USE_CACHE = !1;
- y.Serializer.USE_ENUM_INDEX = !1;
- y.Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
- y.Unserializer.DEFAULT_RESOLVER =
- Y;
- y.Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
- y.ds.ObjectMap.count = 0;
- y.xml.Parser.escapes = function (a) {
- a = new y.ds.StringMap;
- a.set("lt", "<");
- a.set("gt", ">");
- a.set("amp", "&");
- a.set("quot", '"');
- a.set("apos", "'");
- a.set("nbsp", String.fromCharCode(160));
- return a
- }(this);
- F.Browser.window = "undefined" != typeof window ? window : null;
- F.Browser.document = "undefined" != typeof window ? window.document : null;
- h.Config.epsilon = 1E-8;
- h.Config.fluidAngularDragFriction = 2.5;
- h.Config.fluidAngularDrag =
- 100;
- h.Config.fluidVacuumDrag = 0.5;
- h.Config.fluidLinearDrag = 0.5;
- h.Config.collisionSlop = 0.2;
- h.Config.collisionSlopCCD = 0.5;
- h.Config.distanceThresholdCCD = 0.05;
- h.Config.staticCCDLinearThreshold = 0.05;
- h.Config.staticCCDAngularThreshold = 0.005;
- h.Config.bulletCCDLinearThreshold = 0.125;
- h.Config.bulletCCDAngularThreshold = 0.0125;
- h.Config.dynamicSweepLinearThreshold = 17;
- h.Config.dynamicSweepAngularThreshold = 0.6;
- h.Config.angularCCDSlipScale = 0.75;
- h.Config.arbiterExpirationDelay = 6;
- h.Config.staticFrictionThreshold = 2;
- h.Config.elasticThreshold = 20;
- h.Config.sleepDelay = 60;
- h.Config.linearSleepThreshold = 0.2;
- h.Config.angularSleepThreshold = 0.4;
- h.Config.contactBiasCoef = 0.3;
- h.Config.contactStaticBiasCoef = 0.6;
- h.Config.contactContinuousBiasCoef = 0.4;
- h.Config.contactContinuousStaticBiasCoef = 0.5;
- h.Config.constraintLinearSlop = 0.1;
- h.Config.constraintAngularSlop = 0.001;
- h.Config.illConditionedThreshold = 2E8;
- X.className = new y.ds.StringMap;
- X.library = new y.ds.StringMap;
- X.path = new y.ds.StringMap;
- X.type = new y.ds.StringMap;
- X.initialized = !1;
- J.Assets.cachedBitmapData = new y.ds.StringMap;
- J.Assets.initialized = !1;
- q.OzEvent.CLICK = 1;
- q.OzEvent.DOWN = 2;
- q.OzEvent.OVER = 3;
- q.OzEvent.OUT = 4;
- q.OzGeometry.MAX_OBJECTS = 1E4;
- q.OzGeometry.RECTANGLE = 1;
- q.OzGeometry.CIRCLE = 2;
- q.OzGeometry.POLYGON = 3;
- q.OzGeometry.LINE = 4;
- q.OzGeometry.DOT = 5;
- q.OzGeometry.TRIANGLE = 6;
- q.OzGeometry.oo = 2E6;
- q.OzGeometry._d = ":";
- q.OzGeometry.temp2 = [];
- q.OzMatrix.MAX_MATRICES = 1E3;
- q.OzUtil.EPS = 1E-6;
- M.StatePlay.NORMAL = 0;
- M.StatePlay.WAITING = 1;
- M.StatePlay.WIN = 2;
- M.StatePlay.LOSE = 3;
- c.ZPP_Const.FMAX =
- 1E100;
- c.ZPP_ID._Constraint = 0;
- c.ZPP_ID._Interactor = 0;
- c.ZPP_ID._CbType = 0;
- c.ZPP_ID._CbSet = 0;
- c.ZPP_ID._Listener = 0;
- c.ZPP_ID._ZPP_SimpleVert = 0;
- c.ZPP_ID._ZPP_SimpleSeg = 0;
- c.ZPP_ID._Space = 0;
- c.ZPP_ID._InteractionGroup = 0;
- c.callbacks.ZPP_Callback.internal = !1;
- c.callbacks.ZPP_CbType.ANY_SHAPE = new h.callbacks.CbType;
- c.callbacks.ZPP_CbType.ANY_BODY = new h.callbacks.CbType;
- c.callbacks.ZPP_CbType.ANY_COMPOUND = new h.callbacks.CbType;
- c.callbacks.ZPP_CbType.ANY_CONSTRAINT = new h.callbacks.CbType;
- c.util.ZPP_Flags.internal = !1;
- c.util.ZPP_Flags.id_ImmState_ACCEPT = 1;
- c.util.ZPP_Flags.id_ImmState_IGNORE = 2;
- c.util.ZPP_Flags.id_ImmState_ALWAYS = 4;
- c.util.ZPP_Flags.id_GravMassMode_DEFAULT = 0;
- c.util.ZPP_Flags.id_GravMassMode_FIXED = 1;
- c.util.ZPP_Flags.id_GravMassMode_SCALED = 2;
- c.util.ZPP_Flags.id_InertiaMode_DEFAULT = 0;
- c.util.ZPP_Flags.id_InertiaMode_FIXED = 1;
- c.util.ZPP_Flags.id_MassMode_DEFAULT = 0;
- c.util.ZPP_Flags.id_MassMode_FIXED = 1;
- c.util.ZPP_Flags.id_BodyType_STATIC = 1;
- c.util.ZPP_Flags.id_BodyType_DYNAMIC = 2;
- c.util.ZPP_Flags.id_BodyType_KINEMATIC =
- 3;
- c.util.ZPP_Flags.id_ListenerType_BODY = 0;
- c.util.ZPP_Flags.id_PreFlag_ACCEPT = 1;
- c.util.ZPP_Flags.id_ListenerType_CONSTRAINT = 1;
- c.util.ZPP_Flags.id_PreFlag_IGNORE = 2;
- c.util.ZPP_Flags.id_ListenerType_INTERACTION = 2;
- c.util.ZPP_Flags.id_PreFlag_ACCEPT_ONCE = 3;
- c.util.ZPP_Flags.id_ListenerType_PRE = 3;
- c.util.ZPP_Flags.id_PreFlag_IGNORE_ONCE = 4;
- c.util.ZPP_Flags.id_InteractionType_COLLISION = 1;
- c.util.ZPP_Flags.id_CbEvent_BEGIN = 0;
- c.util.ZPP_Flags.id_InteractionType_SENSOR = 2;
- c.util.ZPP_Flags.id_CbEvent_ONGOING = 6;
- c.util.ZPP_Flags.id_InteractionType_FLUID =
- 4;
- c.util.ZPP_Flags.id_CbEvent_END = 1;
- c.util.ZPP_Flags.id_InteractionType_ANY = 7;
- c.util.ZPP_Flags.id_CbEvent_WAKE = 2;
- c.util.ZPP_Flags.id_CbEvent_SLEEP = 3;
- c.util.ZPP_Flags.id_CbEvent_BREAK = 4;
- c.util.ZPP_Flags.id_CbEvent_PRE = 5;
- c.util.ZPP_Flags.id_Winding_UNDEFINED = 0;
- c.util.ZPP_Flags.id_Winding_CLOCKWISE = 1;
- c.util.ZPP_Flags.id_Winding_ANTICLOCKWISE = 2;
- c.util.ZPP_Flags.id_ValidationResult_VALID = 0;
- c.util.ZPP_Flags.id_ValidationResult_DEGENERATE = 1;
- c.util.ZPP_Flags.id_ValidationResult_CONCAVE = 2;
- c.util.ZPP_Flags.id_ValidationResult_SELF_INTERSECTING =
- 3;
- c.util.ZPP_Flags.id_ShapeType_CIRCLE = 0;
- c.util.ZPP_Flags.id_ShapeType_POLYGON = 1;
- c.util.ZPP_Flags.id_Broadphase_DYNAMIC_AABB_TREE = 0;
- c.util.ZPP_Flags.id_Broadphase_SWEEP_AND_PRUNE = 1;
- c.util.ZPP_Flags.id_ArbiterType_COLLISION = 1;
- c.util.ZPP_Flags.id_ArbiterType_SENSOR = 2;
- c.util.ZPP_Flags.id_ArbiterType_FLUID = 4;
- c.callbacks.ZPP_Listener.internal = !1;
- ca = c.callbacks.ZPP_Listener;
- 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);
- var ha = c.util.ZPP_Flags.ListenerType_BODY,
- ia;
- 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);
- ia = c.util.ZPP_Flags.ListenerType_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);
- var oa = c.util.ZPP_Flags.ListenerType_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);
- ca.types = [ha, ia, oa, c.util.ZPP_Flags.ListenerType_PRE];
- ca = c.callbacks.ZPP_Listener;
- 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);
- ha = c.util.ZPP_Flags.CbEvent_BEGIN;
- 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);
- ia = c.util.ZPP_Flags.CbEvent_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);
- var oa = c.util.ZPP_Flags.CbEvent_WAKE,
- ua;
- 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);
- ua = c.util.ZPP_Flags.CbEvent_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);
- var Aa = c.util.ZPP_Flags.CbEvent_BREAK;
- 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);
- var Ba = c.util.ZPP_Flags.CbEvent_PRE;
- 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);
- ca.events = [ha, ia, oa, ua, Aa, Ba, c.util.ZPP_Flags.CbEvent_ONGOING];
- c.callbacks.ZPP_InteractionListener.UCbSet = new c.util.ZNPList_ZPP_CbSet;
- c.callbacks.ZPP_InteractionListener.VCbSet = new c.util.ZNPList_ZPP_CbSet;
- c.callbacks.ZPP_InteractionListener.WCbSet = new c.util.ZNPList_ZPP_CbSet;
- c.callbacks.ZPP_InteractionListener.UCbType = new c.util.ZNPList_ZPP_CbType;
- c.callbacks.ZPP_InteractionListener.VCbType = new c.util.ZNPList_ZPP_CbType;
- c.callbacks.ZPP_InteractionListener.WCbType = new c.util.ZNPList_ZPP_CbType;
- c.constraint.ZPP_AngleDraw.maxarc =
- Math.PI / 4;
- c.dynamics.ZPP_Arbiter.internal = !1;
- c.dynamics.ZPP_Arbiter.COL = 1;
- c.dynamics.ZPP_Arbiter.FLUID = 4;
- c.dynamics.ZPP_Arbiter.SENSOR = 2;
- ca = c.dynamics.ZPP_Arbiter;
- 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);
- ha = c.util.ZPP_Flags.ArbiterType_COLLISION;
- 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);
- ia = c.util.ZPP_Flags.ArbiterType_FLUID;
- 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);
- ca.types = [ha, ia, c.util.ZPP_Flags.ArbiterType_SENSOR];
- c.dynamics.ZPP_ColArbiter.FACE1 = 0;
- c.dynamics.ZPP_ColArbiter.FACE2 = 1;
- c.dynamics.ZPP_ColArbiter.CIRCLE = 2;
- c.dynamics.ZPP_Contact.internal = !1;
- c.dynamics.ZPP_InteractionGroup.SHAPE = 1;
- c.dynamics.ZPP_InteractionGroup.BODY =
- 2;
- c.geom.ZPP_Collide.flowpoly = new c.util.ZNPList_ZPP_Vec2;
- c.geom.ZPP_Collide.flowsegs = new c.util.ZNPList_ZPP_Vec2;
- c.geom.ZPP_ConvexRayResult.internal = !1;
- c.geom.ZPP_GeomVertexIterator.internal = !1;
- c.geom.ZPP_MarchingSquares.me = new c.geom.ZPP_MarchingSquares;
- c.geom.ZPP_MarchingSquares.look_march = [-1, 224, 56, 216, 14, -1, 54, 214, 131, 99, -1, 91, 141, 109, 181, 85];
- c.geom.ZPP_PartitionVertex.nextId = 0;
- c.geom.ZPP_Ray.internal = !1;
- ca = c.phys.ZPP_Body;
- 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);
- ha = 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);
- ia = c.util.ZPP_Flags.BodyType_DYNAMIC;
- 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);
- ca.types = [null, ha, ia, c.util.ZPP_Flags.BodyType_KINEMATIC];
- c.phys.ZPP_Body.cur_graph_depth = 0;
- c.phys.ZPP_Material.WAKE = 1;
- c.phys.ZPP_Material.PROPS = 2;
- c.phys.ZPP_Material.ANGDRAG = 4;
- c.phys.ZPP_Material.ARBITERS = 8;
- ca = c.shape.ZPP_Shape;
- 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);
- ha = c.util.ZPP_Flags.ShapeType_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);
- ca.types = [ha, c.util.ZPP_Flags.ShapeType_POLYGON];
- c.shape.ZPP_Edge.internal = !1;
- c.space.ZPP_AABBTree.tmpaabb = new c.geom.ZPP_AABB;
- c.space.ZPP_DynAABBPhase.FATTEN = 3;
- c.space.ZPP_DynAABBPhase.VEL_STEPS = 2;
- c.util.ZPP_Debug.internal = !1;
- c.util.ZPP_ConstraintList.internal = !1;
- c.util.ZPP_BodyList.internal = !1;
- c.util.ZPP_InteractorList.internal = !1;
- c.util.ZPP_CompoundList.internal = !1;
- c.util.ZPP_ListenerList.internal = !1;
- c.util.ZPP_CbTypeList.internal = !1;
- c.util.ZPP_Vec2List.internal = !1;
- c.util.ZPP_GeomPolyList.internal = !1;
- c.util.ZPP_RayResultList.internal = !1;
- c.util.ZPP_ConvexResultList.internal = !1;
- c.util.ZPP_EdgeList.internal = !1;
- c.util.ZPP_ShapeList.internal = !1;
- c.util.ZPP_InteractionGroupList.internal = !1;
- c.util.ZPP_ArbiterList.internal = !1;
- c.util.ZPP_ContactList.internal = !1;
- P.main()
- })();
|